about summary refs log tree commit diff
path: root/sysdeps/x86/isa-ifunc-macros.h
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/x86/isa-ifunc-macros.h')
-rw-r--r--sysdeps/x86/isa-ifunc-macros.h28
1 files changed, 22 insertions, 6 deletions
diff --git a/sysdeps/x86/isa-ifunc-macros.h b/sysdeps/x86/isa-ifunc-macros.h
index ba6826d518..d69905689b 100644
--- a/sysdeps/x86/isa-ifunc-macros.h
+++ b/sysdeps/x86/isa-ifunc-macros.h
@@ -56,15 +56,31 @@
 # define X86_IFUNC_IMPL_ADD_V1(...)
 #endif
 
-#define X86_ISA_CPU_FEATURE_CONST_CHECK_ENABLED(name)                  \
-  ((name##_X86_ISA_LEVEL) <= MINIMUM_X86_ISA_LEVEL)
+/* Both X86_ISA_CPU_FEATURE_USABLE_P and X86_ISA_CPU_FEATURES_ARCH_P
+   macros are wrappers for the the respective
+   CPU_FEATURE{S}_{USABLE|ARCH}_P runtime checks.  They differ in two
+   ways.
+
+    1.  The USABLE_P version is evaluated to true when the feature
+        is enabled.
+
+    2.  The ARCH_P version has a third argument `not`.  The `not`
+        argument can either be '!' or empty.  If the feature is
+        enabled above an ISA level, the third argument should be empty
+        and the expression is evaluated to true when the feature is
+        enabled.  If the feature is disabled above an ISA level, the
+        third argument should be `!` and the expression is evaluated
+        to true when the feature is disabled.
+ */
 
 #define X86_ISA_CPU_FEATURE_USABLE_P(ptr, name)                        \
-  (X86_ISA_CPU_FEATURE_CONST_CHECK_ENABLED (name)                      \
+  (((name##_X86_ISA_LEVEL) <= MINIMUM_X86_ISA_LEVEL)                   \
    || CPU_FEATURE_USABLE_P (ptr, name))
 
-#define X86_ISA_CPU_FEATURES_ARCH_P(ptr, name)                         \
-  (X86_ISA_CPU_FEATURE_CONST_CHECK_ENABLED (name)                      \
-   || CPU_FEATURES_ARCH_P (ptr, name))
+
+#define X86_ISA_CPU_FEATURES_ARCH_P(ptr, name, not)                    \
+  (((name##_X86_ISA_LEVEL) <= MINIMUM_X86_ISA_LEVEL)                   \
+   || not CPU_FEATURES_ARCH_P (ptr, name))
+
 
 #endif