[03/10] x86: correct SSE dependencies

Message ID 141a0a8e-eb9f-f68f-0eb1-92d62e828f9e@suse.com
State Accepted
Headers
Series x86: re-work ISA extension dependency handling |

Checks

Context Check Description
snail/binutils-gdb-check success Github commit url

Commit Message

Jan Beulich Dec. 19, 2022, 10:45 a.m. UTC
  SSE itself takes FXSR as a prereq. Like AES, PCLMUL, and SHA both GFNI
and KL take SSE2 as a prereq, for operating on packed integers. And
while correcting KL also record it as a prereq to WIDEKL.
  

Patch

--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -1007,7 +1007,7 @@  static const arch_entry cpu_arch[] =
   SUBARCH (387, 387, ANY_387, false),
   SUBARCH (687, 687, ANY_687, false),
   SUBARCH (cmov, CMOV, CMOV, false),
-  SUBARCH (fxsr, FXSR, FXSR, false),
+  SUBARCH (fxsr, FXSR, ANY_FXSR, false),
   SUBARCH (mmx, MMX, ANY_MMX, false),
   SUBARCH (sse, SSE, ANY_SSE, false),
   SUBARCH (sse2, SSE2, ANY_SSE2, false),
@@ -1090,7 +1090,7 @@  static const arch_entry cpu_arch[] =
   SUBARCH (ptwrite, PTWRITE, PTWRITE, false),
   SUBARCH (ibt, IBT, IBT, false),
   SUBARCH (shstk, SHSTK, SHSTK, false),
-  SUBARCH (gfni, GFNI, GFNI, false),
+  SUBARCH (gfni, GFNI, ANY_GFNI, false),
   SUBARCH (vaes, VAES, VAES, false),
   SUBARCH (vpclmulqdq, VPCLMULQDQ, VPCLMULQDQ, false),
   SUBARCH (wbnoinvd, WBNOINVD, WBNOINVD, false),
@@ -1113,8 +1113,8 @@  static const arch_entry cpu_arch[] =
   SUBARCH (mcommit, MCOMMIT, MCOMMIT, false),
   SUBARCH (sev_es, SEV_ES, SEV_ES, false),
   SUBARCH (tsxldtrk, TSXLDTRK, TSXLDTRK, false),
-  SUBARCH (kl, KL, KL, false),
-  SUBARCH (widekl, WIDEKL, WIDEKL, false),
+  SUBARCH (kl, KL, ANY_KL, false),
+  SUBARCH (widekl, WIDEKL, ANY_WIDEKL, false),
   SUBARCH (uintr, UINTR, UINTR, false),
   SUBARCH (hreset, HRESET, HRESET, false),
   SUBARCH (avx512_fp16, AVX512_FP16, ANY_AVX512_FP16, false),
--- a/opcodes/i386-gen.c
+++ b/opcodes/i386-gen.c
@@ -119,6 +119,8 @@  static const dependency isa_dependencies
     "387" },
   { "FISTTP",
     "687" },
+  { "SSE",
+    "FXSR" },
   { "SSE2",
     "SSE" },
   { "SSE3",
@@ -213,12 +215,18 @@  static const dependency isa_dependencies
     "XSAVE" },
   { "OSPKE",
     "XSAVE" },
+  { "GFNI",
+    "SSE2" },
   { "AMX_INT8",
     "AMX_TILE" },
   { "AMX_BF16",
     "AMX_TILE" },
   { "AMX_FP16",
     "AMX_TILE" },
+  { "KL",
+    "SSE2" },
+  { "WIDEKL",
+    "KL" },
 };
 
 /* This array is populated as process_i386_initializers() walks cpu_flags[].  */