From 46e8cb3e49219d01e61279455fdc6778b64cd954 Mon Sep 17 00:00:00 2001 From: florian Date: Mon, 23 Mar 2020 20:54:56 +0000 Subject: [PATCH] + Xtensa: make use of ADDI git-svn-id: trunk@44349 - --- compiler/xtensa/cgcpu.pas | 3 ++- compiler/xtensa/xtensaatt.inc | 1 + compiler/xtensa/xtensaop.inc | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler/xtensa/cgcpu.pas b/compiler/xtensa/cgcpu.pas index e49d18105c..ec897b752f 100644 --- a/compiler/xtensa/cgcpu.pas +++ b/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); diff --git a/compiler/xtensa/xtensaatt.inc b/compiler/xtensa/xtensaatt.inc index c8a0f4442c..51b0f6403c 100644 --- a/compiler/xtensa/xtensaatt.inc +++ b/compiler/xtensa/xtensaatt.inc @@ -1,6 +1,7 @@ ( 'none', 'add', +'addi', 'and', 'b', 'bt', diff --git a/compiler/xtensa/xtensaop.inc b/compiler/xtensa/xtensaop.inc index e450dcf608..b25e8e6b24 100644 --- a/compiler/xtensa/xtensaop.inc +++ b/compiler/xtensa/xtensaop.inc @@ -1,6 +1,7 @@ ( A_NONE, A_ADD, +A_ADDI, A_AND, A_Bcc, A_BT,