]> gcc.gnu.org Git - gcc.git/commitdiff
x86: Properly check FEATURE_AESKLE
authorH.J. Lu <hjl.tools@gmail.com>
Mon, 21 Mar 2022 13:50:14 +0000 (06:50 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Mon, 21 Mar 2022 21:50:02 +0000 (14:50 -0700)
1. Pass 0x19 to __cpuid for bit_AESKLE.
2. Enable FEATURE_AESKLE only if bit_AESKLE is set.

PR target/104998
* common/config/i386/cpuinfo.h (get_available_features): Pass
0x19 to __cpuid for bit_AESKLE.  Enable FEATURE_AESKLE only if
bit_AESKLE is set.

gcc/common/config/i386/cpuinfo.h

index 61b1a0f291c3a096756e6910633ccfc98bebb55c..239759dc76610e0af3b1b036a4fe4439de708359 100644 (file)
@@ -779,11 +779,11 @@ get_available_features (struct __processor_model *cpu_model,
   /* Get Advanced Features at level 0x19 (eax = 0x19).  */
   if (max_cpuid_level >= 0x19)
     {
-      set_feature (FEATURE_AESKLE);
-      __cpuid (19, eax, ebx, ecx, edx);
+      __cpuid (0x19, eax, ebx, ecx, edx);
       /* Check if OS support keylocker.  */
       if (ebx & bit_AESKLE)
        {
+         set_feature (FEATURE_AESKLE);
          if (ebx & bit_WIDEKL)
            set_feature (FEATURE_WIDEKL);
          if (has_kl)
This page took 0.067013 seconds and 5 git commands to generate.