[Libre-soc-dev] TOC immediate loading aka. basically x86 CISC register-memory operations

Jacob Lifshay programmerjake at gmail.com
Sat Jul 23 00:34:08 BST 2022


if you have:
cmpi r3, {TOC + 8}
imho that's basically the same as x86_64's CISC-style register-memory
cmp rax, [rip+0x1234]

imho a better approach is to instead just use the pc-relative loads added
as part of v3.1 -- pld with R=1:
pld r4, 0x1234(0), 1 # r4 = load_64(pc + 0x1234)
cmp r3, r4

no TOC needed.


More information about the Libre-soc-dev mailing list