[LLVMdev] New TargetSpec 'llvmnote'
Chris Lattner
clattner at apple.com
Wed Feb 23 22:40:04 PST 2011
On Feb 23, 2011, at 3:24 PM, Stephen Wilson wrote:
>>
>> On the other hand, if "Byte Order" makes sense to include, should
>> other parts of targetdata be included? Pointer size seems the next
>> most desirable -- endianness and pointer size would be sufficient for
>> many elf tools, for example. However, the other parts of
>> targetdata could conceivably be useful too.
>
> Possibly useful again from an LLDB perspective. I could imagine
> debugging x86_64 operating system code and needing a way to communicate
> transitions from 64-bit mode and 32-bit compatibility mode seamlessly.
> However, I must stress this is *possibly* useful -- I do not have a firm
> conclusion to offer here. Perhaps this is something that we could
> support on an as needed basis.
I think that this can be reliably determined from the arch (through a predicate). x86-64 will always be 64-bit, x86 will always be 32-bit. Doing a "32-bit ABI in 64-bit mode" needs to be a new arch anyway, so that sort of thing isn't an issue IMO. To Dan's point, this argues for forcing a 1-1 mapping between arch and endianness, which would allow making endianness be a predicate instead of being an encoded part of the data structure.
The *only* downside I see to that is that we couldn't form a TargetSpec that *just* contains an endianness, at least without introducing a "unknown-64bit" and "unknown-32bit" archspec, which seems silly.
-Chris
More information about the llvm-dev
mailing list