Browse Source

+ Xtensa: make use of ADDI

git-svn-id: trunk@44349 -
florian 5 years ago
parent
commit
46e8cb3e49
3 changed files with 4 additions and 1 deletions
  1. 2 1
      compiler/xtensa/cgcpu.pas
  2. 1 0
      compiler/xtensa/xtensaatt.inc
  3. 1 0
      compiler/xtensa/xtensaop.inc

+ 2 - 1
compiler/xtensa/cgcpu.pas

@@ -449,7 +449,8 @@ implementation
           it saves us a register }
         else if (op in [OP_MUL,OP_IMUL]) and ispowerof2(a,l1) then
           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
           begin
             tmpreg:=getintregister(list,size);

+ 1 - 0
compiler/xtensa/xtensaatt.inc

@@ -1,6 +1,7 @@
 (
 'none',
 'add',
+'addi',
 'and',
 'b',
 'bt',

+ 1 - 0
compiler/xtensa/xtensaop.inc

@@ -1,6 +1,7 @@
 (
 A_NONE,
 A_ADD,
+A_ADDI,
 A_AND,
 A_Bcc,
 A_BT,