- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
RISC-V 规范 v2.2(JAL 指令,第 15 页)谈到了“标准调用约定”:
The standard software calling convention uses x1 as the return address register and x5 as an alternate link register.
The alternate link register supports calling millicode routines (e.g., those to save and restore registers in compressed code) while preserving the regular return address register.
x5
用于代替
x1
对于围绕“正常调用”的某些(微码/微码)指令,以避免寄存器改组或溢出?你有一个典型的使用例子吗?
最佳答案
通常,毫代码指令不应与普通指令相交,并且需要另一种调用约定来调用毫代码过程( from Waterman's PhD Thesis, page 66 ):
... routines must have an alternate calling convention since the link register must be preserved during their execution. Fortunately, unlike ARM and MIPS, RISC-V’s jump-and-link instruction can write the return address to any integer register, rather than clobbering the ABI-designated link register. Other than that distinction, these millicode routines behave like ordinary procedures
Is the idea that x5 is used instead of x1 for certain (microcode/millicode) instructions that surround "normal calls" to avoid register shuffling or a spill?
Would you have a typical usage example?
prologue_2
,
epilogue_2
来自
Waterman's PhD, page 67 的微码例程
00: c919 c.beqz a0, 16
02: 016002ef jal t0, prologue_2
06: 842a c.mv s0, a0
08: 157d c.addi a0, -1
0a: ff7ff0ef jal ra, factorial
0e: 02850533 mul a0, a0, s0
12: 0100006f jal x0, epilogue_2
16: 4505 c.li a0, 1
18: 8082 c.jr ra
prologue_2
:
00: 1141 c.addi sp, -16
02: e406 c.sdsp ra, 8(sp)
04: e022 c.sdsp s0, 0(sp)
06: 8282 c.jr t0
epilogue_2
:
00: 60a2 c.ldsp ra, 8(sp)
02: 6402 c.ldsp s0, 0(sp)
04: 0141 c.addi sp, 16
06: 8082 c.jr ra
关于riscv - 日航 : what is the "alternate link register" x5 for?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44556354/
RISC-V 规范 v2.2(JAL 指令,第 15 页)谈到了“标准调用约定”: The standard software calling convention uses x1 as the re
我是一名优秀的程序员,十分优秀!