Browse Source

* Xtensa: do SAR by a constant using SRAI

git-svn-id: trunk@45000 -
florian 5 years ago
parent
commit
74abe87315
1 changed files with 2 additions and 0 deletions
  1. 2 0
      compiler/xtensa/cgcpu.pas

+ 2 - 0
compiler/xtensa/cgcpu.pas

@@ -515,6 +515,8 @@ implementation
           end
           end
         else if (op=OP_SHL) and (a>=1) and (a<=31) then
         else if (op=OP_SHL) and (a>=1) and (a<=31) then
           list.concat(taicpu.op_reg_reg_const(A_SLLI,dst,src,a))
           list.concat(taicpu.op_reg_reg_const(A_SLLI,dst,src,a))
+        else if (op=OP_SAR) and (a>=0) and (a<=31) then
+          list.concat(taicpu.op_reg_reg_const(A_SRAI,dst,src,a))
         else if (op=OP_SHR) and (a>=0) and (a<=15) then
         else if (op=OP_SHR) and (a>=0) and (a<=15) then
           list.concat(taicpu.op_reg_reg_const(A_SRLI,dst,src,a))
           list.concat(taicpu.op_reg_reg_const(A_SRLI,dst,src,a))
         else if (op=OP_SHR) and (a>15) and (a<=31) then
         else if (op=OP_SHR) and (a>15) and (a<=31) then