I am confused about the names of the RISC-V ABI Register. For example, in table 18.2 in the βRISC-V Installation Manual, Volume I: ISA User Level Version 2.0β on page 85, indicates that the stack pointer sp is x14 . However instruction
addi sp,zero,0
compiled at 0x00000113 by riscv64-unknown-elf-as ( -m32 doesn't matter). In binary format:
000000000000 00000 000 00010 0010011 ^imm ^rs1 ^f3 ^rd ^opcode
So here sp seems x2 . Then I searched Google a bit and found the RISC-V Linux User Guide . This document states that sp x30 .
So what is it? Are there different ABIs? Can I install ABI with command line option on riscv64-unknown-elf-* ? Is there an exhaustive table somewhere?
riscv
Clifford vienna
source share