diff --git a/compiler/i386/i386atts.inc b/compiler/i386/i386atts.inc index a5a6b1d6a0..67072ba4e7 100644 --- a/compiler/i386/i386atts.inc +++ b/compiler/i386/i386atts.inc @@ -411,7 +411,7 @@ attsufNONE, attsufNONE, attsufNONE, attsufNONE, -attsufMM, +attsufINT, attsufINT, attsufNONE, attsufINT, @@ -528,7 +528,7 @@ attsufNONE, attsufNONE, attsufINT, attsufNONE, -attsufMM, +attsufINT, attsufNONE, attsufNONE, attsufNONE, @@ -708,8 +708,8 @@ attsufNONE, attsufNONE, attsufNONE, attsufNONE, -attsufMM, -attsufMM, +attsufINT, +attsufINT, attsufNONE, attsufNONE, attsufMM, diff --git a/compiler/i386/i386nop.inc b/compiler/i386/i386nop.inc index 68e22081bd..c65555b17d 100644 --- a/compiler/i386/i386nop.inc +++ b/compiler/i386/i386nop.inc @@ -1,2 +1,2 @@ { don't edit, this file is generated from x86ins.dat } -1953; +1951; diff --git a/compiler/i386/i386tab.inc b/compiler/i386/i386tab.inc index 5102c5656d..60ea3e119f 100644 --- a/compiler/i386/i386tab.inc +++ b/compiler/i386/i386tab.inc @@ -8981,13 +8981,6 @@ code : #220#242#248#1#42#61#80; flags : if_avx or if_sandybridge or if_sd ), - ( - opcode : A_VCVTSI2SD; - ops : 3; - optypes : (ot_xmmreg,ot_xmmreg,ot_rm_gpr or ot_bits64,ot_none); - code : #220#242#243#248#1#42#61#80; - flags : if_avx or if_sandybridge - ), ( opcode : A_VCVTSI2SS; ops : 3; @@ -8995,13 +8988,6 @@ code : #219#242#248#1#42#61#80; flags : if_avx or if_sandybridge or if_sd ), - ( - opcode : A_VCVTSI2SS; - ops : 3; - optypes : (ot_xmmreg,ot_xmmreg,ot_rm_gpr or ot_bits64,ot_none); - code : #219#242#243#248#1#42#61#80; - flags : if_avx or if_sandybridge - ), ( opcode : A_VCVTSS2SD; ops : 3; diff --git a/compiler/i8086/i8086atts.inc b/compiler/i8086/i8086atts.inc index 7288517939..7a6980fd85 100644 --- a/compiler/i8086/i8086atts.inc +++ b/compiler/i8086/i8086atts.inc @@ -411,7 +411,7 @@ attsufNONE, attsufNONE, attsufNONE, attsufNONE, -attsufMM, +attsufINT, attsufINT, attsufNONE, attsufINT, @@ -528,7 +528,7 @@ attsufNONE, attsufNONE, attsufINT, attsufNONE, -attsufMM, +attsufINT, attsufNONE, attsufNONE, attsufNONE, @@ -708,8 +708,8 @@ attsufNONE, attsufNONE, attsufNONE, attsufNONE, -attsufMM, -attsufMM, +attsufINT, +attsufINT, attsufNONE, attsufNONE, attsufMM, diff --git a/compiler/i8086/i8086nop.inc b/compiler/i8086/i8086nop.inc index 0e8b0b924b..6d83251bac 100644 --- a/compiler/i8086/i8086nop.inc +++ b/compiler/i8086/i8086nop.inc @@ -1,2 +1,2 @@ { don't edit, this file is generated from x86ins.dat } -1985; +1983; diff --git a/compiler/i8086/i8086tab.inc b/compiler/i8086/i8086tab.inc index 084d27d1f9..ad048fb690 100644 --- a/compiler/i8086/i8086tab.inc +++ b/compiler/i8086/i8086tab.inc @@ -9009,13 +9009,6 @@ code : #220#242#248#1#42#61#80; flags : if_avx or if_sandybridge or if_sd ), - ( - opcode : A_VCVTSI2SD; - ops : 3; - optypes : (ot_xmmreg,ot_xmmreg,ot_rm_gpr or ot_bits64,ot_none); - code : #220#242#243#248#1#42#61#80; - flags : if_avx or if_sandybridge - ), ( opcode : A_VCVTSI2SS; ops : 3; @@ -9023,13 +9016,6 @@ code : #219#242#248#1#42#61#80; flags : if_avx or if_sandybridge or if_sd ), - ( - opcode : A_VCVTSI2SS; - ops : 3; - optypes : (ot_xmmreg,ot_xmmreg,ot_rm_gpr or ot_bits64,ot_none); - code : #219#242#243#248#1#42#61#80; - flags : if_avx or if_sandybridge - ), ( opcode : A_VCVTSS2SD; ops : 3; diff --git a/compiler/x86/agx86att.pas b/compiler/x86/agx86att.pas index 738c654d2b..0c9fe507d2 100644 --- a/compiler/x86/agx86att.pas +++ b/compiler/x86/agx86att.pas @@ -347,39 +347,7 @@ interface (getregtype(taicpu(hp).oper[0]^.reg)=R_FPUREGISTER) ) then begin - if (gas_needsuffix[op] = AttSufMM)then - begin - for i:=0 to taicpu(hp).ops-1 do - begin - - if (taicpu(hp).oper[i]^.typ = top_ref) then - begin - case taicpu(hp).oper[i]^.ot and OT_SIZE_MASK of - OT_BITS32: begin - owner.writer.AsmWrite(gas_opsize2str[S_L]); - break; - end; - OT_BITS64: begin - owner.writer.AsmWrite(gas_opsize2str[S_Q]); - break; - end; - OT_BITS128: begin - owner.writer.AsmWrite(gas_opsize2str[S_XMM]); - break; - end; - OT_BITS256: begin - owner.writer.AsmWrite(gas_opsize2str[S_YMM]); - break; - end; - 0: begin - owner.writer.AsmWrite(gas_opsize2str[taicpu(hp).opsize]); - break; - end; - end; - end; - end; - end - else owner.writer.AsmWrite(gas_opsize2str[taicpu(hp).opsize]); + owner.writer.AsmWrite(gas_opsize2str[taicpu(hp).opsize]); end; { process operands } diff --git a/compiler/x86/itcpugas.pas b/compiler/x86/itcpugas.pas index d1a9388fcb..7cc708e9f1 100644 --- a/compiler/x86/itcpugas.pas +++ b/compiler/x86/itcpugas.pas @@ -63,7 +63,7 @@ interface '','BW','BL','WL','BQ','WQ',{'LQ',}'B','W','L','S','Q','T','X','Y' ); att_sizesuffix : array[0..13] of topsize = ( - S_NO,S_BW,S_BL,S_WL,S_BQ,S_WQ,{S_LQ,}S_B,S_W,S_L,S_NO,S_Q,S_NO,S_XMM,S_YMM + S_NO,S_BW,S_BL,S_WL,S_BQ,S_WQ,{S_LQ,}S_B,S_W,S_L,S_NO,S_Q,S_NO,S_NO,S_NO ); att_sizefpusuffix : array[0..13] of topsize = ( S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,{S_NO,}S_NO,S_NO,S_FL,S_FS,S_NO,S_FX,S_NO,S_NO @@ -71,6 +71,9 @@ interface att_sizefpuintsuffix : array[0..13] of topsize = ( S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,{S_NO,}S_NO,S_NO,S_IL,S_IS,S_IQ,S_NO,S_NO,S_NO ); + att_sizemmsuffix : array[0..13] of topsize = ( + S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,{S_NO,}S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_XMM,S_YMM + ); {$else x86_64} gas_opsize2str : array[topsize] of string[2] = ('', 'b','w','l','q','bw','bl','wl', @@ -87,7 +90,7 @@ interface '','BW','BL','WL','B','W','L','S','Q','T','X','Y' ); att_sizesuffix : array[0..11] of topsize = ( - S_NO,S_BW,S_BL,S_WL,S_B,S_W,S_L,S_NO,S_NO,S_NO,S_XMM,S_YMM + S_NO,S_BW,S_BL,S_WL,S_B,S_W,S_L,S_NO,S_NO,S_NO,S_NO,S_NO ); att_sizefpusuffix : array[0..11] of topsize = ( S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_FL,S_FS,S_NO,S_FX,S_NO,S_NO @@ -95,6 +98,10 @@ interface att_sizefpuintsuffix : array[0..11] of topsize = ( S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_IL,S_IS,S_IQ,S_NO,S_NO,S_NO ); + att_sizemmsuffix : array[0..11] of topsize = ( + S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_XMM,S_YMM + ); + {$endif x86_64} diff --git a/compiler/x86/rax86att.pas b/compiler/x86/rax86att.pas index e824320ab8..80464b38c9 100644 --- a/compiler/x86/rax86att.pas +++ b/compiler/x86/rax86att.pas @@ -918,6 +918,8 @@ Implementation actopsize:=att_sizefpusuffix[sufidx] else if gas_needsuffix[actopcode]=attsufFPUint then actopsize:=att_sizefpuintsuffix[sufidx] + else if gas_needsuffix[actopcode]=attsufMM then + actopsize:=att_sizemmsuffix[sufidx] else actopsize:=att_sizesuffix[sufidx]; { only accept suffix from the same category that the opcode belongs to } @@ -942,11 +944,9 @@ Implementation if Cond=Upper(cond2str[cnd]) then begin actopcode:=CondASmOp[j]; - if gas_needsuffix[actopcode]=attsufFPU then - actopsize:=att_sizefpusuffix[sufidx] - else if gas_needsuffix[actopcode]=attsufFPUint then - actopsize:=att_sizefpuintsuffix[sufidx] - else + { conditional instructions (cmovcc, setcc) use only INT suffixes; + other stuff like fcmovcc is represented as group of individual instructions } + if gas_needsuffix[actopcode]=attsufINT then actopsize:=att_sizesuffix[sufidx]; { only accept suffix from the same category that the opcode belongs to } if (actopsize<>S_NO) or (suflen=0) then diff --git a/compiler/x86/x86ins.dat b/compiler/x86/x86ins.dat index 7e8bc6611f..a469892657 100644 --- a/compiler/x86/x86ins.dat +++ b/compiler/x86/x86ins.dat @@ -2224,7 +2224,7 @@ xmmreg,mmxrm \331\2\x0F\x2A\110 KATMAI,SSE,MMX mmxreg,mem64 \331\2\x0F\x2D\110 KATMAI,SSE,MMX mmxreg,xmmreg \331\2\x0F\x2D\110 KATMAI,SSE,MMX -[CVTSI2SS,cvtsi2ssM] +[CVTSI2SS,cvtsi2ssX] (Ch_Wop2, Ch_Rop1, Ch_None) xmmreg,rm32 \333\321\2\x0F\x2A\110 KATMAI,SSE xmmreg,rm64 \333\321\2\x0F\x2A\110 KATMAI,SSE,X86_64 @@ -2761,7 +2761,7 @@ reg64,mem64 \334\320\2\x0F\x2D\110 WILLAMETTE,SSE2,X86_64 xmmreg,xmmreg \334\2\x0F\x5A\110 WILLAMETTE,SSE2 ;,SQ xmmreg,mem64 \334\2\x0F\x5A\110 WILLAMETTE,SSE2 ;,SQ -[CVTSI2SD,cvtsi2sdM] +[CVTSI2SD,cvtsi2sdX] (Ch_Wop2, Ch_Rop1, Ch_None) xmmreg,rm32 \334\2\x0F\x2A\110 WILLAMETTE,SSE2 xmmreg,rm64 \326\334\321\2\x0F\x2A\110 WILLAMETTE,SSE2,X86_64 @@ -3652,15 +3652,15 @@ reg64,xmmreg \334\362\363\370\1\x2D\110 AVX,SA xmmreg,xmmreg,mem64 \334\362\370\1\x5A\75\120 AVX,SANDYBRIDGE xmmreg,xmmreg,xmmreg \334\362\370\1\x5A\75\120 AVX,SANDYBRIDGE -[VCVTSI2SD,vcvtsi2sdM] +[VCVTSI2SD,vcvtsi2sdX] (Ch_Wop3, Ch_Rop2, Ch_Rop1) xmmreg,xmmreg,rm32 \334\362\370\1\x2A\75\120 AVX,SANDYBRIDGE,SD -xmmreg,xmmreg,rm64 \334\362\363\370\1\x2A\75\120 AVX,SANDYBRIDGE +xmmreg,xmmreg,rm64 \334\362\363\370\1\x2A\75\120 AVX,SANDYBRIDGE,X86_64 -[VCVTSI2SS,vcvtsi2ssM] +[VCVTSI2SS,vcvtsi2ssX] (Ch_Wop3, Ch_Rop2, Ch_Rop1) xmmreg,xmmreg,rm32 \333\362\370\1\x2A\75\120 AVX,SANDYBRIDGE,SD -xmmreg,xmmreg,rm64 \333\362\363\370\1\x2A\75\120 AVX,SANDYBRIDGE +xmmreg,xmmreg,rm64 \333\362\363\370\1\x2A\75\120 AVX,SANDYBRIDGE,X86_64 [VCVTSS2SD] (Ch_Wop3, Ch_Rop2, Ch_Rop1) diff --git a/compiler/x86_64/x8664ats.inc b/compiler/x86_64/x8664ats.inc index 893fc9b763..15b2660c7b 100644 --- a/compiler/x86_64/x8664ats.inc +++ b/compiler/x86_64/x8664ats.inc @@ -396,7 +396,7 @@ attsufNONE, attsufNONE, attsufNONE, attsufNONE, -attsufMM, +attsufINT, attsufINT, attsufNONE, attsufINT, @@ -513,7 +513,7 @@ attsufNONE, attsufNONE, attsufINT, attsufNONE, -attsufMM, +attsufINT, attsufNONE, attsufNONE, attsufNONE, @@ -702,8 +702,8 @@ attsufNONE, attsufNONE, attsufNONE, attsufNONE, -attsufMM, -attsufMM, +attsufINT, +attsufINT, attsufNONE, attsufNONE, attsufMM, diff --git a/compiler/x86_64/x8664tab.inc b/compiler/x86_64/x8664tab.inc index 50a75a51cc..8c4d1c8aa4 100644 --- a/compiler/x86_64/x8664tab.inc +++ b/compiler/x86_64/x8664tab.inc @@ -9091,7 +9091,7 @@ ops : 3; optypes : (ot_xmmreg,ot_xmmreg,ot_rm_gpr or ot_bits64,ot_none); code : #220#242#243#248#1#42#61#80; - flags : if_avx or if_sandybridge + flags : if_avx or if_sandybridge or if_x86_64 ), ( opcode : A_VCVTSI2SS; @@ -9105,7 +9105,7 @@ ops : 3; optypes : (ot_xmmreg,ot_xmmreg,ot_rm_gpr or ot_bits64,ot_none); code : #219#242#243#248#1#42#61#80; - flags : if_avx or if_sandybridge + flags : if_avx or if_sandybridge or if_x86_64 ), ( opcode : A_VCVTSS2SD;