biscuit
biscuit copied to clipboard
No way to do PC literal loadstores
A PC relative loadstore in RISCV is useful for large 64-bit values that would otherwise take quite a few instructions to encode.
Vixl allows something like the following to encode a literal:
Literal l_CTX {reinterpret_cast<uintptr_t>(CTX)};
ldr(x0, &l_CTX);
place(&l_CTX);
From this code it lets you store the 64-bit constant in the Literal
object, then place
will put the 64-bit constant in that location in memory, fixing up and loadstores that were bound to it in the process.
For RISCV you need two instructions to do a PC relative offset loadstore like this
.LCPI0_0:
.quad 4702394921427289928 # 0x4142434445464748
Constant(): # @Constant()
lui a0, %hi(.LCPI0_0)
ld a0, %lo(.LCPI0_0)(a0)
Not sure exactly how the semantics should be in biscuit to handle this case.