[clang] [llvm] [AIX] support builtin_cpu_is() for aix (PR #80069)
Amy Kwan via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 14 12:13:02 PST 2024
================
@@ -126,4 +126,53 @@ PPC_LNX_CPU("power10",47)
#undef PPC_LNX_DEFINE_OFFSETS
#undef PPC_LNX_FEATURE
#undef PPC_LNX_CPU
+
+// Definition of the following values are found in the AIX header file: <systemcfg.h>.
+#ifndef AIX_POWERPC_SYS_CONF
+#define AIX_POWERPC_SYS_CONF
+ #define AIX_SYSCON_IMPL_IDX 1
+ #define AIX_PPC7_VALUE 0x00008000
+ #define AIX_PPC8_VALUE 0x00010000
+ #define AIX_PPC9_VALUE 0x00020000
+ #define AIX_PPC10_VALUE 0x00040000
+
+ #define AIX_BUILTIN_PPC_TRUE 1
+ #define AIX_BUILTIN_PPC_FALSE 0
+ #define SYS_CONF 2
+
+ #define COMP_EQ 0
+
+#endif
+
+// When the value of SUPPORT_MAGIC is SYS_CONF, the return value depends on the
+// _system_configuration[INDEX] COMPARE_OP VALUE.
----------------
amy-kwan wrote:
This comment may not make sense here. However, if we do put a comment here, this comment should be clarified, since the comment should describe the intent behind the code.
- We should change the `COMPARE_OP` to be more explicit to show the possible comparison operations.
- We should not be using `_system_configuration[INDEX]`, since this doesn't seem to be described in this change.
- Where is SUPPORT_MAGIC defined?
https://github.com/llvm/llvm-project/pull/80069
More information about the cfe-commits
mailing list