<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/80042>80042</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[AIX] support builtin_cpu_support
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
diggerlin
</td>
</tr>
</table>
<pre>
Add the lowering of intrinsic `__builtin_cpu_is` and `__builtin_cpu_support` into AIX platform-specific code to determine the CPU.
runtime external variable `_system_configuration.version` of `/usr/include/sys/systemcfg.h` provide all the information we need the function __builtin_cpu_is() and
it has structure like
`
extern struct _system_conf {
int architecture; /* processor architecture */
int implementation; /* processor implementation */
int version; /* processor version */
.....
}
`
it has some define as
We use the value of the implementation for the aix builtin_cpu_is()
`#define POWER_7 0x8000 /* 7 class CPU /
#define POWER_8 0x10000 / 8 class CPU /
#define POWER_9 0x20000 / 9 class CPU */
`
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMVE2P4zYM_TXyhZhAlu3EOfiQaRpgT10UKHZvgSLRDltZMvSRyfz7Qo7nI80UWB-cQHx85HuiKUOgwSJ2rHlmzb6QKZ6d7zQNA3pDtjg5_drttIZ4RjDuBT3ZAVwPZKMnG0gBW_Pj8ZTIRLJHNaUjBbbmIK1-DIU0Tc7HHM8MDnbffsJkZOydH5_ChIp6UqCcRogONEb0I1mcy__2_a8V43vGd7e3TzbSiIDXiN5KAxfpSZ4MznXDa4g4HpWzPQ3Jy0jOri7oAzmb67s-w5g4pOCZOJBVJmlk4hBew-0dcVT9sDpn9OTdhTSCNGbuhWzueCaFFwSLeLOoT1bNhw-WiJaJ7c2VTxoowlkGCNEnFZNHMPQPLoA1v_1ZBC4g-KwM2OZ5AS0P2QjSqzNFnAlZ9bxEmDgwsctKFIbg_B0MmNhlwAMXjZPBEW2ctb6xPXDdw_6X7c3_6vmRYol9mbvKz_0R2-zffYJ7M92IoLHPcyPDZ7d_IKRwG6aLNAnzEMy3ed997_x8LOkKX93ix_2Iaqnz_Y8fv_953AC_tpzzN3EbUEaGkCcX3jX9N6kFfi35kgXtr6RsgV_Fe8r2LuXDPLbmhe4qva22ssCu3PD1umq3ZVOcu7bSalPrti9VI9aybqtGt8hFxUu5LitVUCe4qHlZ8bIVZdOs6rrZaNE2UlW1LvmJ1RxHSWZlzGVcOT8UFELCruW8FoWRJzRhXitCWHyBOciEyFvGdznn6ZSGwGpuKMTwwRIpmnkf7b79ZM0elpUBX6yRInnTnWOcAqtm2eIwUDyn00q5kYlD5lx-nibv_kYV85eeO8mf-NzpvwEAAP__Qt2P7A">