mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 01:09:27 +02:00
+ condition code operand for aarch64
+ taicpu.op_reg_cond() constructor * use this operand for cset git-svn-id: trunk@29889 -
This commit is contained in:
parent
5c6afe259e
commit
d246ababff
@ -156,6 +156,7 @@ uses
|
||||
taicpu = class(tai_cpu_abstract_sym)
|
||||
oppostfix : TOpPostfix;
|
||||
procedure loadshifterop(opidx:longint;const so:tshifterop);
|
||||
procedure loadconditioncode(opidx: longint; const c: tasmcond);
|
||||
constructor op_none(op : tasmop);
|
||||
|
||||
constructor op_reg(op : tasmop;_op1 : tregister);
|
||||
@ -164,6 +165,7 @@ uses
|
||||
|
||||
constructor op_reg_reg(op : tasmop;_op1,_op2 : tregister);
|
||||
constructor op_reg_ref(op : tasmop;_op1 : tregister;const _op2 : treference);
|
||||
constructor op_reg_cond(op: tasmop; _op1: tregister; _op2: tasmcond);
|
||||
constructor op_reg_const(op:tasmop; _op1: tregister; _op2: aint);
|
||||
constructor op_reg_const_shifterop(op : tasmop;_op1: tregister; _op2: aint;_op3 : tshifterop);
|
||||
|
||||
@ -275,6 +277,21 @@ implementation
|
||||
end;
|
||||
|
||||
|
||||
procedure taicpu.loadconditioncode(opidx: longint; const c: tasmcond);
|
||||
begin
|
||||
allocate_oper(opidx+1);
|
||||
with oper[opidx]^ do
|
||||
begin
|
||||
if typ<>top_conditioncode then
|
||||
begin
|
||||
clearop(opidx);
|
||||
end;
|
||||
condition:=c;
|
||||
typ:=top_conditioncode;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
{*****************************************************************************
|
||||
taicpu Constructors
|
||||
*****************************************************************************}
|
||||
@ -347,6 +364,15 @@ implementation
|
||||
end;
|
||||
|
||||
|
||||
constructor taicpu.op_reg_cond(op: tasmop; _op1: tregister; _op2: tasmcond);
|
||||
begin
|
||||
inherited create(op);
|
||||
ops:=2;
|
||||
loadreg(0,_op1);
|
||||
loadconditioncode(1,_op2);
|
||||
end;
|
||||
|
||||
|
||||
constructor taicpu.op_reg_reg_reg(op : tasmop;_op1,_op2,_op3 : tregister);
|
||||
begin
|
||||
inherited create(op);
|
||||
|
@ -1341,12 +1341,8 @@ implementation
|
||||
|
||||
|
||||
procedure tcgaarch64.g_flags2reg(list: TAsmList; size: tcgsize; const f: tresflags; reg: tregister);
|
||||
var
|
||||
ai: taicpu;
|
||||
begin
|
||||
ai:=taicpu.op_reg(A_CSET,reg)
|
||||
ai.SetCondition(flags_to_cond(f));
|
||||
list.concat(ai);
|
||||
list.concat(taicpu.op_reg_cond(A_CSET,reg,flags_to_cond(f)));
|
||||
end;
|
||||
|
||||
|
||||
|
@ -221,11 +221,11 @@ interface
|
||||
{$ifdef arm}
|
||||
{ ARM only }
|
||||
,top_regset
|
||||
,top_conditioncode
|
||||
,top_modeflags
|
||||
,top_specialreg
|
||||
{$endif arm}
|
||||
{$if defined(arm) or defined(aarch64)}
|
||||
,top_conditioncode
|
||||
,top_shifterop
|
||||
{$endif defined(arm) or defined(aarch64)}
|
||||
{$ifdef m68k}
|
||||
@ -268,12 +268,12 @@ interface
|
||||
top_local : (localoper:plocaloper);
|
||||
{$ifdef arm}
|
||||
top_regset : (regset:^tcpuregisterset; regtyp: tregistertype; subreg: tsubregister; usermode: boolean);
|
||||
top_conditioncode : (cc : TAsmCond);
|
||||
top_modeflags : (modeflags : tcpumodeflags);
|
||||
top_specialreg : (specialreg:tregister; specialflags:tspecialregflags);
|
||||
{$endif arm}
|
||||
{$if defined(arm) or defined(aarch64)}
|
||||
top_shifterop : (shifterop : pshifterop);
|
||||
top_conditioncode : (cc : TAsmCond);
|
||||
{$endif defined(arm) or defined(aarch64)}
|
||||
{$ifdef m68k}
|
||||
top_regset : (dataregset,addrregset,fpuregset:^tcpuregisterset);
|
||||
|
Loading…
Reference in New Issue
Block a user