mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 14:29:14 +02:00
* m68k/n68kadd.pas, t68kaddnode.second_cmpordinal:
for "CMP" it is important to note that the first operand (which can be basically a register, a constant or a reference) is substracted from the second operand (which needs to be a data register) and not the other way round git-svn-id: trunk@22798 -
This commit is contained in:
parent
a266d73409
commit
f0aad6dbc4
@ -307,7 +307,6 @@ implementation
|
|||||||
tmpreg : tregister;
|
tmpreg : tregister;
|
||||||
op : tasmop;
|
op : tasmop;
|
||||||
begin
|
begin
|
||||||
// writeln('second_cmpordinal');
|
|
||||||
pass_left_right;
|
pass_left_right;
|
||||||
{ set result location }
|
{ set result location }
|
||||||
location_reset(location,LOC_JUMP,OS_NO);
|
location_reset(location,LOC_JUMP,OS_NO);
|
||||||
@ -359,19 +358,20 @@ implementation
|
|||||||
location.loc := LOC_FLAGS;
|
location.loc := LOC_FLAGS;
|
||||||
location.resflags := getresflags(unsigned);
|
location.resflags := getresflags(unsigned);
|
||||||
op := A_CMP;
|
op := A_CMP;
|
||||||
|
{ Attention: The RIGHT(!) operand is substracted from and must be a
|
||||||
|
register! }
|
||||||
if (right.location.loc = LOC_CONSTANT) then
|
if (right.location.loc = LOC_CONSTANT) then
|
||||||
if useconst then
|
if useconst then
|
||||||
current_asmdata.CurrAsmList.concat(taicpu.op_reg_const(op,S_L,
|
current_asmdata.CurrAsmList.concat(taicpu.op_const_reg(op,S_L,
|
||||||
left.location.register,longint(right.location.value)))
|
longint(right.location.value),left.location.register))
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(op,S_L,
|
current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(op,S_L,
|
||||||
left.location.register,tmpreg));
|
tmpreg,left.location.register));
|
||||||
// cg.ungetcpuregister(current_asmdata.CurrAsmList,tmpreg);
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(op,S_L,
|
current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(op,S_L,
|
||||||
left.location.register,right.location.register));
|
right.location.register,left.location.register));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{*****************************************************************************
|
{*****************************************************************************
|
||||||
|
Loading…
Reference in New Issue
Block a user