From 11c17a87de784e7cd6dd4e412336a6d2094244d4 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 aaf63449ea..807e44bc3d 100644 --- a/compiler/i386/i386atts.inc +++ b/compiler/i386/i386atts.inc @@ -1241,8 +1241,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 ce0d6d5eb1..5c095990dc 100644 --- a/compiler/i8086/i8086atts.inc +++ b/compiler/i8086/i8086atts.inc @@ -1255,8 +1255,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 55c60deb76..62afd67a6f 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 373ee85d55..7c3d8b5e4d 100644 --- a/compiler/x86/x86ins.dat +++ b/compiler/x86/x86ins.dat @@ -7629,7 +7629,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 @@ -7642,7 +7642,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 7b1b5a801d..453b7aa6e6 100644 --- a/compiler/x86_64/x8664ats.inc +++ b/compiler/x86_64/x8664ats.inc @@ -1237,8 +1237,8 @@ attsufNONE, attsufNONE, attsufNONE, attsufNONE, -attsufINT, -attsufINT, +attsufMMS, +attsufMMS, attsufNONE, attsufNONE, attsufNONE,