[LLVMdev] Proposal for -filetype=obj full big endian support

Carter, Jack jcarter at mips.com
Fri Dec 23 11:07:15 PST 2011


Well, not so flawlessly.

Yes, I get hello world working, but the current place to fix up the instructions (EncodeInstruction) is too early and misses the final expression fixups. I also continue to struggle in the lib/Target/<local target>/MCTargetDesc area to get clean, easy and elegant access to the environment such as chip/instruction variants let alone endianess.

Finally, I still shouldn't be worrying about endianess at that level. The text and data should be marked for element sizes and the endian bit twiddling should happen at a higher lever just before final output. The person like me working on a specific target shouldn't have to do this. There is quite a bit of work to accomplish this at the MCAssembler level, but was not finished for at least direct object output.

I also fear that we are only concerned about what happens from the perspective of a little endian compilation platform. Will the current scheme work if llvm is run on a big endian system? 

If you can show me to a clean way to access endianess from the MCCodeEmmiter class under MCTargetDesc I would be most thankful :-)

Cheers,

Jack



More information about the llvm-dev mailing list