Displaying 3 results from an estimated 3 matches for "i32imm_pcrel".
2020 Jan 21
2
MASM & RIP-relative addressing
...c.com> wrote:
> All immediate jump instructions on x86 (call/jmp/jcc) have a relative
> offset operand. The destination is, in some sense, “rip-relative”, but we
> don’t represent it like that in LLVM. If you look at the TableGen
> descriptions, jumps use brtarget32, and calls use i32imm_pcrel. In both
> Microsoft and GNU assembly syntax, this is something like “call baz”.
>
>
>
> “call”/”jmp” also have a register/memory form, for indirect calls. In
> 64-bit, this allows rip-relative references, to call a function pointer
> stored in a global variable. In Microsof...
2020 Jan 21
2
MASM & RIP-relative addressing
Hi all,
Continuing work on llvm-ml (a MASM assembler)... and my latest obstacle is
in enabling MASM's convention that (unless specified) all memory location
references should be RIP-relative. Without it, we emit the wrong
instructions for "call", "jmp", etc., and anything we build fails at the
linking stage.
My best attempt at this so far is a small patch to
2020 Jan 21
2
MASM & RIP-relative addressing
...friedma at quicinc.com>> wrote:
All immediate jump instructions on x86 (call/jmp/jcc) have a relative offset operand. The destination is, in some sense, “rip-relative”, but we don’t represent it like that in LLVM. If you look at the TableGen descriptions, jumps use brtarget32, and calls use i32imm_pcrel. In both Microsoft and GNU assembly syntax, this is something like “call baz”.
“call”/”jmp” also have a register/memory form, for indirect calls. In 64-bit, this allows rip-relative references, to call a function pointer stored in a global variable. In Microsoft assembly syntax, this is “call Q...