mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 00:29:33 +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;
|
||||
op : tasmop;
|
||||
begin
|
||||
// writeln('second_cmpordinal');
|
||||
pass_left_right;
|
||||
{ set result location }
|
||||
location_reset(location,LOC_JUMP,OS_NO);
|
||||
@ -359,19 +358,20 @@ implementation
|
||||
location.loc := LOC_FLAGS;
|
||||
location.resflags := getresflags(unsigned);
|
||||
op := A_CMP;
|
||||
{ Attention: The RIGHT(!) operand is substracted from and must be a
|
||||
register! }
|
||||
if (right.location.loc = LOC_CONSTANT) then
|
||||
if useconst then
|
||||
current_asmdata.CurrAsmList.concat(taicpu.op_reg_const(op,S_L,
|
||||
left.location.register,longint(right.location.value)))
|
||||
current_asmdata.CurrAsmList.concat(taicpu.op_const_reg(op,S_L,
|
||||
longint(right.location.value),left.location.register))
|
||||
else
|
||||
begin
|
||||
current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(op,S_L,
|
||||
left.location.register,tmpreg));
|
||||
// cg.ungetcpuregister(current_asmdata.CurrAsmList,tmpreg);
|
||||
tmpreg,left.location.register));
|
||||
end
|
||||
else
|
||||
current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(op,S_L,
|
||||
left.location.register,right.location.register));
|
||||
right.location.register,left.location.register));
|
||||
end;
|
||||
|
||||
{*****************************************************************************
|
||||
|
Loading…
Reference in New Issue
Block a user