From 2ec8145ec543c0babf24ecd8de10d0114a91dca0 Mon Sep 17 00:00:00 2001 From: tg74 Date: Wed, 23 Dec 2020 03:56:23 +0000 Subject: [PATCH] external gas-assembler - handling special opcodes with multiple memref-size e.g. vfpclassps/pd - if operand-opsize < S_XMM =>> use memref-min-size git-svn-id: branches/tg74/avx512-0037785@47837 - --- compiler/i386/i386atts.inc | 4 ++-- compiler/i8086/i8086atts.inc | 4 ++-- compiler/ppcx64.lpi | 6 +++--- compiler/x86/rax86.pas | 16 +++++++++++++++- compiler/x86/x86ins.dat | 4 ++-- compiler/x86_64/x8664ats.inc | 4 ++-- 6 files changed, 26 insertions(+), 12 deletions(-) diff --git a/compiler/i386/i386atts.inc b/compiler/i386/i386atts.inc index f25a0a1855..c94394e2ec 100644 --- a/compiler/i386/i386atts.inc +++ b/compiler/i386/i386atts.inc @@ -1234,8 +1234,8 @@ attsufNONE, attsufNONE, attsufNONE, attsufNONE, -attsufINT, -attsufINT, +attsufMMS, +attsufMMS, attsufNONE, attsufNONE, attsufNONE, diff --git a/compiler/i8086/i8086atts.inc b/compiler/i8086/i8086atts.inc index 14d8ee5011..8fb88d59ce 100644 --- a/compiler/i8086/i8086atts.inc +++ b/compiler/i8086/i8086atts.inc @@ -1248,8 +1248,8 @@ attsufNONE, attsufNONE, attsufNONE, attsufNONE, -attsufINT, -attsufINT, +attsufMMS, +attsufMMS, attsufNONE, attsufNONE, attsufNONE, diff --git a/compiler/ppcx64.lpi b/compiler/ppcx64.lpi index 5819327b82..5da9c79f20 100644 --- a/compiler/ppcx64.lpi +++ b/compiler/ppcx64.lpi @@ -1,7 +1,7 @@ - + @@ -22,14 +22,14 @@ - + - + diff --git a/compiler/x86/rax86.pas b/compiler/x86/rax86.pas index 6c53779037..7845429bfe 100644 --- a/compiler/x86/rax86.pas +++ b/compiler/x86/rax86.pas @@ -1519,9 +1519,23 @@ procedure Tx86Instruction.SetInstructionOpsize; if (gas_needsuffix[opcode] = AttSufMMS) and (ops > 0) then begin // special handling = use source operand for calculate instructions-opsize - // e.g. vcvtsi2sd, vcvtsi2ss, vcvtusi2sd, vcvtusi2ss + // e.g. vcvtsi2sd, vcvtsi2ss, vcvtusi2sd, vcvtusi2ss, + // vfpclass.. opsize:=tx86operand(operands[1]).opsize; + + if (MemRefSize in [msiMultipleMinSize128, msiMultipleMinSize256, msiMultipleMinSize512]) and + (not(opsize in [S_XMM, S_YMM, S_ZMM])) then + begin + // special handling for external gas assembler, special opcodes (e.g. vfpclassps/pd) + case MemRefSize of + msiMultipleMinSize128: opsize := S_XMM; + msiMultipleMinSize256: opsize := S_YMM; + msiMultipleMinSize512: opsize := S_ZMM; + else; + end; + end; + result := true; end else if MemRefSize in MemRefMultiples - [msiVMemMultiple] then diff --git a/compiler/x86/x86ins.dat b/compiler/x86/x86ins.dat index 56c9989a1a..e3dbe66aa6 100644 --- a/compiler/x86/x86ins.dat +++ b/compiler/x86/x86ins.dat @@ -7643,7 +7643,7 @@ xmmreg_mz,xmmreg,xmmreg_sae,imm8 \350\361\372\1\x55\75\120\27 ; VFPCLASSPD kreg_m,mem256 and mem512 must come first - map MemRefSize 256,512bits correct ; map all other MemrefSize (without broasdcast MemRef) to kreg_m, xmmrm -[VFPCLASSPD,vfpclasspdX] +[VFPCLASSPD,vfpclasspdS] (Ch_All) kreg_m,mem256,imm8 \350\352\361\364\372\1\x66\110\26 AVX512,TFV kreg_m,mem512,imm8 \350\351\352\361\372\1\x66\110\26 AVX512,TFV @@ -7656,7 +7656,7 @@ kreg_m,bmem64,imm8 \350\351\352\361\372\1\x66\110\26 ; VFPCLASSPS kreg_m,mem256 and mem512 must come first - map MemRefSize 256,512bits correct ; map all other MemrefSize (without broasdcast MemRef) to kreg_m, xmmrm -[VFPCLASSPS,vfpclasspsX] +[VFPCLASSPS,vfpclasspsS] (Ch_All) kreg_m,mem256,imm8 \350\361\364\372\1\x66\110\26 AVX512,TFV kreg_m,mem512,imm8 \350\351\361\372\1\x66\110\26 AVX512,TFV diff --git a/compiler/x86_64/x8664ats.inc b/compiler/x86_64/x8664ats.inc index 5b2fade508..65ba2fe8a4 100644 --- a/compiler/x86_64/x8664ats.inc +++ b/compiler/x86_64/x8664ats.inc @@ -1230,8 +1230,8 @@ attsufNONE, attsufNONE, attsufNONE, attsufNONE, -attsufINT, -attsufINT, +attsufMMS, +attsufMMS, attsufNONE, attsufNONE, attsufNONE,