瀏覽代碼

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 -
tg74 4 年之前
父節點
當前提交
11c17a87de
共有 6 個文件被更改,包括 26 次插入12 次删除
  1. 2 2
      compiler/i386/i386atts.inc
  2. 2 2
      compiler/i8086/i8086atts.inc
  3. 3 3
      compiler/ppcx64.lpi
  4. 15 1
      compiler/x86/rax86.pas
  5. 2 2
      compiler/x86/x86ins.dat
  6. 2 2
      compiler/x86_64/x8664ats.inc

+ 2 - 2
compiler/i386/i386atts.inc

@@ -1241,8 +1241,8 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
-attsufINT,
-attsufINT,
+attsufMMS,
+attsufMMS,
 attsufNONE,
 attsufNONE,
 attsufNONE,

+ 2 - 2
compiler/i8086/i8086atts.inc

@@ -1255,8 +1255,8 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
-attsufINT,
-attsufINT,
+attsufMMS,
+attsufMMS,
 attsufNONE,
 attsufNONE,
 attsufNONE,

+ 3 - 3
compiler/ppcx64.lpi

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <CONFIG>
   <ProjectOptions>
-    <Version Value="9"/>
+    <Version Value="11"/>
     <PathDelim Value="\"/>
     <General>
       <Flags>
@@ -22,14 +22,14 @@
     </PublishOptions>
     <RunParams>
       <local>
-        <CommandLineParams Value="-O- \home\torsten\tmp\vpinsrb.pp -Fu\home\torsten\avx512\rtl\units\x86_64-linux"/>
+        <CommandLineParams Value="-O- \tmp\vaddpd.pp -Fu\home\torsten\avx512\rtl\units\x86_64-linux"/>
         <LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
       </local>
       <FormatVersion Value="2"/>
       <Modes Count="1">
         <Mode0 Name="default">
           <local>
-            <CommandLineParams Value="-O- \home\torsten\tmp\vpinsrb.pp -Fu\home\torsten\avx512\rtl\units\x86_64-linux"/>
+            <CommandLineParams Value="-O- \tmp\vaddpd.pp -Fu\home\torsten\avx512\rtl\units\x86_64-linux"/>
             <LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
           </local>
         </Mode0>

+ 15 - 1
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

+ 2 - 2
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

+ 2 - 2
compiler/x86_64/x8664ats.inc

@@ -1237,8 +1237,8 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
-attsufINT,
-attsufINT,
+attsufMMS,
+attsufMMS,
 attsufNONE,
 attsufNONE,
 attsufNONE,