Skip to content

Commit f0548bb

Browse files
authored
Fix unusedArgs on riscv64
Added support for RISC-V 64-bit calling conventions.
1 parent 4a88d9a commit f0548bb

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎unusedArgs/unusedArgs.C‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ const MachRegister arg_register[] = {aarch64::x0, aarch64::x1, aarch64::x2, aarc
3030
// https://refspecs.linuxfoundation.org/ELF/ppc64/PPC-elf64abi.html#REG
3131
const MachRegister arg_register[] = {ppc64::r3, ppc64::r4, ppc64::r5, ppc64::r6,
3232
ppc64::r7, ppc64::r8, ppc64::r9, ppc64::r10};
33+
#elif defined(__riscv) && (__riscv_xlen == 64)
34+
# include "registers/riscv64_regs.h"
35+
// RISC-V 64-bit calling conventions from
36+
// https://riscv.org/wp-content/uploads/2024/12/riscv-calling.pdf
37+
const MachRegister arg_register[] = {riscv64::a0, riscv64::a1, riscv64::a2, riscv64::a3,
38+
riscv64::a4, riscv64::a5, riscv64::a6, riscv64::a7};
3339
#elif
3440
# error "Unsupported architecture"
3541
#endif

0 commit comments

Comments
 (0)