Skip to content

Commit 6ee9281

Browse files
charlie-rivosAlexandre Ghiti
authored andcommitted
riscv: Add norvc after .option arch in runtime const
.option arch clobbers .option norvc. Prevent gas from emitting compressed instructions in the runtime const alternative blocks by setting .option norvc after .option arch. This issue starts appearing on gcc 15, which adds zca to the march. Reported by: Klara Modin <klarasmodin@gmail.com> Signed-off-by: Charlie Jenkins <charlie@rivosinc.com> Fixes: a44fb57 ("riscv: Add runtime constant support") Closes: https://lore.kernel.org/all/cc8f3525-20b7-445b-877b-2add28a160a2@gmail.com/ Tested-by: Klara Modin <klarasmodin@gmail.com> Link: https://lore.kernel.org/r/20250331-fix_runtime_const_norvc-v1-1-89bc62687ab8@rivosinc.com Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
1 parent 8a2f20a commit 6ee9281

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arch/riscv/include/asm/runtime-const.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
#define RISCV_RUNTIME_CONST_64_ZBA \
5757
".option push\n\t" \
5858
".option arch,+zba\n\t" \
59+
".option norvc\n\t" \
5960
"slli %[__tmp],%[__tmp],32\n\t" \
6061
"add.uw %[__ret],%[__ret],%[__tmp]\n\t" \
6162
"nop\n\t" \
@@ -65,6 +66,7 @@
6566
#define RISCV_RUNTIME_CONST_64_ZBKB \
6667
".option push\n\t" \
6768
".option arch,+zbkb\n\t" \
69+
".option norvc\n\t" \
6870
"pack %[__ret],%[__ret],%[__tmp]\n\t" \
6971
"nop\n\t" \
7072
"nop\n\t" \

0 commit comments

Comments
 (0)