m68k: use CPU capabilities at places instead of hardwiring cpu_coldfire

This commit is contained in:
Karoly Balogh 2022-08-26 01:19:12 +02:00
parent e5957b1ef0
commit 7d23c2e9d0

View File

@ -1347,7 +1347,7 @@ unit cgcpu;
{ on ColdFire all arithmetic operations are only possible on 32bit } { on ColdFire all arithmetic operations are only possible on 32bit }
if needs_unaligned(ref.alignment,size) or if needs_unaligned(ref.alignment,size) or
((current_settings.cputype in cpu_coldfire) and (opsize <> S_L) ((CPUM68K_HAS_BYTEWORDMATH in cpu_capabilities[current_settings.cputype]) and (opsize <> S_L)
and not (op in [OP_NONE,OP_MOVE])) then and not (op in [OP_NONE,OP_MOVE])) then
begin begin
inherited; inherited;
@ -1414,7 +1414,7 @@ unit cgcpu;
opsize : topsize; opsize : topsize;
begin begin
opcode := topcg2tasmop[op]; opcode := topcg2tasmop[op];
if current_settings.cputype in cpu_coldfire then if CPUM68K_HAS_BYTEWORDMATH in cpu_capabilities[current_settings.cputype] then
opsize := S_L opsize := S_L
else else
opsize := TCGSize2OpSize[size]; opsize := TCGSize2OpSize[size];
@ -1524,7 +1524,7 @@ unit cgcpu;
{ on ColdFire all arithmetic operations are only possible on 32bit { on ColdFire all arithmetic operations are only possible on 32bit
and addressing modes are limited } and addressing modes are limited }
if needs_unaligned(ref.alignment,size) or if needs_unaligned(ref.alignment,size) or
((current_settings.cputype in cpu_coldfire) and (opsize <> S_L)) then ((CPUM68K_HAS_BYTEWORDMATH in cpu_capabilities[current_settings.cputype]) and (opsize <> S_L)) then
begin begin
//list.concat(tai_comment.create(strpnew('a_op_reg_ref: inherited #1'))); //list.concat(tai_comment.create(strpnew('a_op_reg_ref: inherited #1')));
inherited; inherited;
@ -1567,7 +1567,7 @@ unit cgcpu;
{ on ColdFire all arithmetic operations are only possible on 32bit { on ColdFire all arithmetic operations are only possible on 32bit
and addressing modes are limited } and addressing modes are limited }
if needs_unaligned(ref.alignment,size) or if needs_unaligned(ref.alignment,size) or
((current_settings.cputype in cpu_coldfire) and (opsize <> S_L)) then ((CPUM68K_HAS_BYTEWORDMATH in cpu_capabilities[current_settings.cputype]) and (opsize <> S_L)) then
begin begin
//list.concat(tai_comment.create(strpnew('a_op_ref_reg: inherited #1'))); //list.concat(tai_comment.create(strpnew('a_op_ref_reg: inherited #1')));
inherited; inherited;
@ -2246,8 +2246,7 @@ unit cgcpu;
end; end;
OS_8: { 8 -> 16 bit zero extend } OS_8: { 8 -> 16 bit zero extend }
begin begin
if (current_settings.cputype in cpu_coldfire) then if (CPUM68K_HAS_BYTEWORDMATH in cpu_capabilities[current_settings.cputype]) then
{ ColdFire has no ANDI.W }
list.concat(taicpu.op_const_reg(A_AND,S_L,$FF,reg)) list.concat(taicpu.op_const_reg(A_AND,S_L,$FF,reg))
else else
list.concat(taicpu.op_const_reg(A_AND,S_W,$FF,reg)); list.concat(taicpu.op_const_reg(A_AND,S_W,$FF,reg));