소스 검색

Changed get_volatile_registers_mm to not return XMM16 to XMM31 when not under AVX512

J. Gareth "Curious Kit" Moreton 4 년 전
부모
커밋
15b2f9a7b1
1개의 변경된 파일7개의 추가작업 그리고 3개의 파일을 삭제
  1. 7 3
      compiler/x86_64/cpupara.pas

+ 7 - 3
compiler/x86_64/cpupara.pas

@@ -57,7 +57,7 @@ unit cpupara;
        systems,
        systems,
        globals,defutil,
        globals,defutil,
        symtable,symutil,
        symtable,symutil,
-       cpupi,
+       cpupi,cpuinfo,
        cgx86,cgobj,cgcpu;
        cgx86,cgobj,cgcpu;
 
 
     const
     const
@@ -1359,9 +1359,13 @@ unit cpupara;
     function tcpuparamanager.get_volatile_registers_mm(calloption : tproccalloption):tcpuregisterset;
     function tcpuparamanager.get_volatile_registers_mm(calloption : tproccalloption):tcpuregisterset;
       begin
       begin
         if x86_64_use_ms_abi(calloption) then
         if x86_64_use_ms_abi(calloption) then
-          result:=[RS_XMM0..RS_XMM5,RS_XMM16..RS_XMM31]
+          result:=[RS_XMM0..RS_XMM5]
         else
         else
-          result:=[RS_XMM0..RS_XMM15,RS_XMM16..RS_XMM31];
+          result:=[RS_XMM0..RS_XMM15];
+
+        { Don't list registers that aren't available }
+        if FPUX86_HAS_32MMREGS in fpu_capabilities[current_settings.fputype] then
+          result:=result+[RS_XMM16..RS_XMM31];
       end;
       end;