[LLVMdev] Address space extension
David Chisnall
David.Chisnall at cl.cam.ac.uk
Fri Aug 9 02:38:35 PDT 2013
On 9 Aug 2013, at 09:48, Charles Davis <cdavis5x at gmail.com> wrote:
> This won't have the effect you're hoping for. LEA stands for "Load Effective Address"; it only operates on the offset part of a logical (far) address. It's no different from before, when RDI was MOV'd into RAX.
>
> In fact, there is no instruction you can use to turn a seg:offset logical address into a linear address. That's why most systems that use the FS and GS registers for thread-specific data have a field for the linear address of the TSD structure.
Yes, you're right - I've obviously spent too much time with an architecture with a sane segmentation system. In this case, since an address space cast from 256 to 0 is impossible for x86, the correct thing to do would be to raise an error, rather than silently generate the wrong code.
David
More information about the llvm-dev
mailing list