mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 15:49:26 +02:00
m68k/cgcpu.pas, tcg68k.a_op_const_reg:
* use andi/ori for constant values * use a scratch register if target is an address register (there seems to exist an omnious anda/ora instruction though, but GNU as doesn't seem to handle it... maybe I haven't set the CPU type correctly, so I'll need to investigate this so we can hopefully remove the need for a scratch register for certain CPU types ;) ) git-svn-id: trunk@22732 -
This commit is contained in:
parent
9402a068a5
commit
f501a8fecc
@ -697,7 +697,21 @@ unit cgcpu;
|
||||
OP_AND,
|
||||
OP_OR:
|
||||
begin
|
||||
list.concat(taicpu.op_const_reg(topcg2tasmop[op],S_L,longint(a), reg));
|
||||
{ TODO: on Coldfire ORI/ANDI to CCR is not supported }
|
||||
if op=OP_AND then
|
||||
opcode:=A_ANDI
|
||||
else
|
||||
opcode:=A_ORI;
|
||||
if isaddressregister(reg) then
|
||||
begin
|
||||
{ use scratch register (there is a anda/ora though...) }
|
||||
scratch_reg:=getintregister(list,OS_INT);
|
||||
list.concat(taicpu.op_reg_reg(A_MOVE,S_L,reg,scratch_reg));
|
||||
list.concat(taicpu.op_const_reg(opcode,S_L,longint(a),scratch_reg));
|
||||
list.concat(taicpu.op_reg_reg(A_MOVE,S_L,scratch_reg,reg));
|
||||
end
|
||||
else
|
||||
list.concat(taicpu.op_const_reg(topcg2tasmop[op],S_L,longint(a), reg));
|
||||
end;
|
||||
OP_DIV :
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user