[1/7] RISC-V: Use .insn directive form for orc.b
Checks
Context |
Check |
Description |
redhat-pt-bot/TryBot-apply_patch |
success
|
Patch applied to master at the time it was sent
|
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_glibc_build--master-arm |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_glibc_check--master-arm |
success
|
Testing passed
|
Commit Message
The orc.b instruction is part of the Zbb extension, which was ratified in 2021.
GAS releases older than that won't know of the instruction.
Newer GAS releases accepted orc.b only if Zbb is enabled in the -march string.
This patch changes the inline asm for orc.b to the '.insn' directive form,
which allows (future changes) to build orc.b-optimized routines by defining
the Zbb feature test macro (__riscv_zbb). Building optimized routines
this way is compatible with releases of GAS with and without Zbb support.
Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
---
sysdeps/riscv/string-fza.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
@@ -36,7 +36,8 @@ find_zero_all (op_t x)
asm ("th.tstnbz %0, %1" : "=r" (r) : "r" (x));
return r;
#else
- asm ("orc.b %0, %1" : "=r" (r) : "r" (x));
+ /* orc.b using the .insn directive (supported by older Binutils releases). */
+ asm (".insn i 0x13, 0x5, %0, %1, 0x287" : "=r" (r) : "r" (x));
return ~r;
#endif
}