<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/70275>70275</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
`-march=rv64gc -munaligned-access` should define `__riscv_misaligned_fast`
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
sh1boot
</td>
</tr>
</table>
<pre>
`-munaligned-access` enables optimisations involving un-aligned loads and stores on RISC-V, but it does not signal this via the preprocessor, which I think it's supposed to?: https://github.com/riscv-non-isa/riscv-c-api-doc/blob/master/riscv-c-api.md
The following comes up empty:
clang-18 --target=riscv64 -march=rv64gc -munaligned-access -dM -E -xc /dev/null | grep riscv_unaligned
Diff in godbolt doesn't reveal anything: https://godbolt.org/z/sb6rnvP4n
But recent GCC does define `__riscv_misaligned_fast` or `__riscv_misaligned_slow` depending on its configuration: https://godbolt.org/z/YEc4nb3Kf
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMU82OtDYQfBpzaXkEhmGYA4f9ZpZoFUWKkihSTiNjN-DE2MhtmGyePvKw2myUn28vIExVd3W5SxKZ0SG27PiFHa-ZXOPkQ0tT0Xsfs97r15bVOZ9XJ21Cai6VQiJW54BO9hYJ_BLNbEhG4x2BcZu3m3EjrI6_kcB6qQmk00DRh8Rx8MPLjxf-MxMX6NcIJoL2SOB8hKRJWoiTIdiMhDghLAGX4FNrHxLnPhk1wUsCud_ARCZOBLQuiyfUED0rO1Y-wRTjQqx8YqJjohtNnNb-oPzMRBcMqY0777gh-f6tuFwM114x0fXW90x0s6SI4e-Iw6xZfmX50_78aUIYvLX-ngZXfkaCdQGcl_iaun-AAgAoK93IiwY4jzKMGFl5fRSvK-CzDGpKB1tdjQr-6T1w_R3wZ-C_K2Ci07gx0bnVWmCnC4wBF3gUu70TP_a_mmEA42D0uvd2d90xcYoQcENpQbrXZOr4L_btlIMPIxPdH0x01NfBbd9X7mOHL2uqpdBF-OZy2a9V42AcAqvz220XlzZmV3cbJMW0UD78B4CsvyeAxgWdThZ7ByYSKO8GM67hsXufEfzLs6pcX3477FIz3Zb6XJ5lhm1RnxvRiPpYZVOrStXgoMqmaqpyQC2GQZeiEY0q07HMTCtyURa5qPOiyI_V4VyfqrpvhNCYF6IvWJXjLI09WLvNSUFmiFZsT7k4HTMre7T0iJ0QDu_w-MmESCkMbeLwfh2JVbk1FOmvKtFEi3sov7YoyTKa_Gr1p_zP1mDb_wlMkvD24kvwv6KKTHQP4cRE9xjszwAAAP__c2BrQg">