diff --git a/compiler/m68k/ag68kgas.pas b/compiler/m68k/ag68kgas.pas index 6d03d232a7..a1f4ac46ba 100644 --- a/compiler/m68k/ag68kgas.pas +++ b/compiler/m68k/ag68kgas.pas @@ -270,32 +270,28 @@ interface op : tasmop; begin op:=taicpu(hp).opcode; - { old versions of GAS don't like PEA.L and LEA.L } - if (op in [ + case op of A_LEA,A_PEA,A_ABCD,A_BCHG,A_BCLR,A_BSET,A_BTST, A_EXG,A_NBCD,A_SBCD,A_SWAP,A_TAS,A_SCC,A_SCS, A_SEQ,A_SGE,A_SGT,A_SHI,A_SLE,A_SLS,A_SLT,A_SMI, - A_SNE,A_SPL,A_ST,A_SVC,A_SVS,A_SF]) then - result:=gas_op2str[op] - else - { Scc/FScc is always BYTE, DBRA/DBcc is always WORD, doesn't need opsize (KB) } - if op in [A_SXX, A_FSXX, A_DBXX, A_DBRA] then - result:=gas_op2str[op]+cond2str[taicpu(hp).condition] - else - { fix me: a fugly hack to utilize GNU AS pseudo instructions for more optimal branching } - if op in [A_JSR] then - result:='jbsr' - else - if op in [A_JMP] then - result:='jra' - else - if op in [A_BXX] then - result:='j'+cond2str[taicpu(hp).condition]+gas_opsize2str[taicpu(hp).opsize] - else - if op in [A_FBXX] then - result:='fj'+{gas_op2str[op]+}cond2str[taicpu(hp).condition]+gas_opsize2str[taicpu(hp).opsize] - else - result:=gas_op2str[op]+gas_opsize2str[taicpu(hp).opsize]; + A_SNE,A_SPL,A_ST,A_SVC,A_SVS,A_SF: + { old versions of GAS don't like PEA.L and LEA.L } + result:=gas_op2str[op]; + A_SXX, A_FSXX, A_DBXX, A_DBRA: + { Scc/FScc is always BYTE, DBRA/DBcc is always WORD, doesn't need opsize (KB) } + result:=gas_op2str[op]+cond2str[taicpu(hp).condition]; + { fix me: a fugly hack to utilize GNU AS pseudo instructions for more optimal branching } + A_JSR: + result:='jbsr'; + A_JMP: + result:='jra'; + A_BXX: + result:='j'+cond2str[taicpu(hp).condition]+gas_opsize2str[taicpu(hp).opsize]; + A_FBXX: + result:='fj'+{gas_op2str[op]+}cond2str[taicpu(hp).condition]+gas_opsize2str[taicpu(hp).opsize]; + else + result:=gas_op2str[op]+gas_opsize2str[taicpu(hp).opsize]; + end; end; diff --git a/compiler/m68k/cpubase.pas b/compiler/m68k/cpubase.pas index 6bac6dea7d..96021d53e0 100644 --- a/compiler/m68k/cpubase.pas +++ b/compiler/m68k/cpubase.pas @@ -399,9 +399,16 @@ implementation function is_calljmp(o:tasmop):boolean; begin - is_calljmp := - o in [A_BXX,A_FBXX,A_DBXX,A_BCC..A_BVS,A_DBCC..A_DBVS,A_FBEQ..A_FSNGLE, - A_JSR,A_BSR,A_JMP]; + case o of + A_BXX,A_FBXX,A_DBXX, + A_BCC..A_BVS, + A_DBCC..A_DBVS, + A_FBEQ..A_FSNGLE, + A_JSR,A_BSR,A_JMP: + is_calljmp:=true; + else + is_calljmp:=false; + end; end; diff --git a/compiler/m68k/ra68kmot.pas b/compiler/m68k/ra68kmot.pas index 7443319852..5eee77d1a3 100644 --- a/compiler/m68k/ra68kmot.pas +++ b/compiler/m68k/ra68kmot.pas @@ -178,12 +178,16 @@ const actopcode:=tasmop(PtrUInt(iasmops.Find(hs))); { Also filter the helper opcodes, they can't be valid while reading an assembly source } - if not (actopcode in - [A_NONE, A_LABEL, A_DBXX, A_SXX, A_BXX, A_FBXX]) then - begin - actasmtoken:=AS_OPCODE; - result:=TRUE; - exit; + case actopcode of + A_NONE, A_LABEL, A_DBXX, A_SXX, A_BXX, A_FBXX: + begin + end; + else + begin + actasmtoken:=AS_OPCODE; + result:=TRUE; + exit; + end; end; end;