riscv - ABI Register Names for RISC-V Calling Convention -


i'm confused risc-v abi register names. example, table 18.2 in "risc-v instruction set manual, volume i: user-level isa, version 2.0" @ page 85 specifies stack pointer sp register x14. however, instruction

addi sp,zero,0 

is compiled 0x00000113 riscv64-unknown-elf-as (-m32 not make difference). in binary:

000000000000 00000 000 00010 0010011 ^imm         ^rs1  ^f3 ^rd   ^opcode 

so here sp seems x2. googled bit , found risc-v linux user's manual. document states sp x30.

so it? there different abis? can set abi command line option riscv64-unknown-elf-*? there comprehensive table somewhere?

the stack pointer x2.

until official spec updated on riscv.org webpage, here current abi (as linked riscv blog).

it modified better accommodate new risc-v compressed spec, puts 8 most-used registers next each other in x8-x15.

note: not trust non riscv.org webpage. quan nguyen makes clear in introduction "risc-v linux user's manual" documenting porting process , accuracy not guaranteed.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -