mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 19:29:18 +02:00
* Xtensa: set is_jmp flag so branch optimization works
git-svn-id: trunk@46960 -
This commit is contained in:
parent
ffef243908
commit
112f8a41ad
@ -464,8 +464,8 @@ Unit AoptObj;
|
|||||||
|
|
||||||
function JumpTargetOp(ai: taicpu): poper; inline;
|
function JumpTargetOp(ai: taicpu): poper; inline;
|
||||||
begin
|
begin
|
||||||
{$if defined(MIPS) or defined(riscv64) or defined(riscv32)}
|
{$if defined(MIPS) or defined(riscv64) or defined(riscv32) or defined(xtensa)}
|
||||||
{ MIPS or RiscV branches can have 1,2 or 3 operands, target label is the last one. }
|
{ MIPS, Xtensa or RiscV branches can have 1,2 or 3 operands, target label is the last one. }
|
||||||
result:=ai.oper[ai.ops-1];
|
result:=ai.oper[ai.ops-1];
|
||||||
{$elseif defined(SPARC64)}
|
{$elseif defined(SPARC64)}
|
||||||
if ai.ops=2 then
|
if ai.ops=2 then
|
||||||
@ -1644,6 +1644,11 @@ Unit AoptObj;
|
|||||||
p.loadreg(0, NR_X0);
|
p.loadreg(0, NR_X0);
|
||||||
p.ops:=2;
|
p.ops:=2;
|
||||||
{$endif}
|
{$endif}
|
||||||
|
{$ifdef xtensa}
|
||||||
|
p.opcode := aopt_uncondjmp;
|
||||||
|
p.loadoper(0, p.oper[p.ops-1]^);
|
||||||
|
p.ops:=1;
|
||||||
|
{$endif}
|
||||||
{$endif not avr}
|
{$endif not avr}
|
||||||
{$ifdef mips}
|
{$ifdef mips}
|
||||||
{ MIPS conditional jump instructions also conntain register
|
{ MIPS conditional jump instructions also conntain register
|
||||||
|
@ -621,6 +621,7 @@ implementation
|
|||||||
begin
|
begin
|
||||||
instr:=taicpu.op_reg_sym(A_B,f.register,l);
|
instr:=taicpu.op_reg_sym(A_B,f.register,l);
|
||||||
instr.condition:=flags_to_cond(f.flag);
|
instr.condition:=flags_to_cond(f.flag);
|
||||||
|
instr.is_jmp:=true;
|
||||||
list.concat(instr);
|
list.concat(instr);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -905,6 +906,7 @@ implementation
|
|||||||
end;
|
end;
|
||||||
instr:=taicpu.op_reg_sym(A_B,reg,l);
|
instr:=taicpu.op_reg_sym(A_B,reg,l);
|
||||||
instr.condition:=op;
|
instr.condition:=op;
|
||||||
|
instr.is_jmp:=true;
|
||||||
list.concat(instr);
|
list.concat(instr);
|
||||||
end
|
end
|
||||||
else if is_b4const(a) and
|
else if is_b4const(a) and
|
||||||
@ -921,6 +923,7 @@ implementation
|
|||||||
|
|
||||||
instr:=taicpu.op_reg_const_sym(A_B,reg,a,l);
|
instr:=taicpu.op_reg_const_sym(A_B,reg,a,l);
|
||||||
instr.condition:=op;
|
instr.condition:=op;
|
||||||
|
instr.is_jmp:=true;
|
||||||
list.concat(instr);
|
list.concat(instr);
|
||||||
end
|
end
|
||||||
else if is_b4constu(a) and
|
else if is_b4constu(a) and
|
||||||
@ -935,6 +938,7 @@ implementation
|
|||||||
|
|
||||||
instr:=taicpu.op_reg_const_sym(A_B,reg,a,l);
|
instr:=taicpu.op_reg_const_sym(A_B,reg,a,l);
|
||||||
instr.condition:=op;
|
instr.condition:=op;
|
||||||
|
instr.is_jmp:=true;
|
||||||
list.concat(instr);
|
list.concat(instr);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -958,6 +962,7 @@ implementation
|
|||||||
|
|
||||||
instr:=taicpu.op_reg_reg_sym(A_B,reg2,reg1,l);
|
instr:=taicpu.op_reg_reg_sym(A_B,reg2,reg1,l);
|
||||||
instr.condition:=TOpCmp2AsmCond[cmp_op];
|
instr.condition:=TOpCmp2AsmCond[cmp_op];
|
||||||
|
instr.is_jmp:=true;
|
||||||
list.concat(instr);
|
list.concat(instr);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user