Bläddra i källkod

+ Xtensa: make use of slli and srli

git-svn-id: trunk@44357 -
florian 5 år sedan
förälder
incheckning
470cc8eb1c
3 ändrade filer med 8 tillägg och 0 borttagningar
  1. 4 0
      compiler/xtensa/cgcpu.pas
  2. 2 0
      compiler/xtensa/xtensaatt.inc
  3. 2 0
      compiler/xtensa/xtensaop.inc

+ 4 - 0
compiler/xtensa/cgcpu.pas

@@ -469,6 +469,10 @@ implementation
           a_op_const_reg_reg(list,OP_SHL,size,l1,src,dst)
         else if (op=OP_ADD) and (a>=-128) and (a<=127) then
           list.concat(taicpu.op_reg_reg_const(A_ADDI,dst,src,a))
+        else if (op=OP_SHL) and (a>=1) and (a<=31) then
+          list.concat(taicpu.op_reg_reg_const(A_SLLI,dst,src,a))
+        else if (op=OP_SHR) and (a>=0) and (a<=15) then
+          list.concat(taicpu.op_reg_reg_const(A_SRLI,dst,src,a))
         else
           begin
             tmpreg:=getintregister(list,size);

+ 2 - 0
compiler/xtensa/xtensaatt.inc

@@ -36,8 +36,10 @@
 's32i',
 'sext',
 'sll',
+'slli',
 'sra',
 'srl',
+'srli',
 'ssi',
 'ssl',
 'ssr',

+ 2 - 0
compiler/xtensa/xtensaop.inc

@@ -36,8 +36,10 @@ A_S16I,
 A_S32I,
 A_SEXT,
 A_SLL,
+A_SLLI,
 A_SRA,
 A_SRL,
+A_SRLI,
 A_SSI,
 A_SSL,
 A_SSR,