This is an archive of the discontinued LLVM Phabricator instance.

Mark arm as the 32bit variant of aarch64 in Triple
ClosedPublic

Authored by tberghammer on Dec 15 2015, 7:53 AM.

Details

Summary

Mark arm as the 32bit variant of aarch64 in Triple

Change Triple::get32BitArchVariant to return arm/armeb as the 32bit
variant of aarch64/aarch64_be and do the same change for the opposite
direction in Triple::get64BitArchVariant.

Notes:
I hit the issue when investigating a bug in LLDB where we depending on the this behavior. If this is not a reasonable change from LLVM point of view then let me know and I can put a similar change into LLDB instead.
I don't know how can I add a reasonable test for this change into LLVM, but if somebody feels it is necessary for a change like this then please give me some direction.
I verified that check-llvm and check-clang targets aren't reporting any new failure on Linux x86_64 but I don't have an arm/aarch64 device where I can run the tests to verify everything works there as well.

Diff Detail

Repository
rL LLVM

Event Timeline

tberghammer retitled this revision from to Mark arm as the 32bit variant of aarch64 in Triple.
tberghammer updated this object.
tberghammer added reviewers: rengolin, jmolloy.
tberghammer added a subscriber: llvm-commits.
emaste added a subscriber: emaste.Dec 16 2015, 7:31 AM
jmolloy accepted this revision.Jan 6 2016, 5:28 AM
jmolloy edited edge metadata.

LGTM. Does this mean -m32/-m64 will work?! :o

James

This revision is now accepted and ready to land.Jan 6 2016, 5:28 AM

I am not sure what is the exact functionality of -m32/-m64 but after this change, commands like this are working as expected (for all combination of arm/aarch64):

$ ./bin/clang -target arm-unknown-unknown -m64 -v
clang version 3.8.0 (trunk 256842) (llvm/trunk 256840)
Target: aarch64-unknown-unknown
Thread model: posix
InstalledDir: /mnt/ssd/ll/git/build/host-release/./bin
rengolin edited edge metadata.Jan 6 2016, 8:52 AM

$ ./bin/clang -target arm-unknown-unknown -m64 -v
clang version 3.8.0 (trunk 256842) (llvm/trunk 256840)
Target: aarch64-unknown-unknown

Heh! Whaddya know! :D

Sounds awesome! Once this is in, I'll try -m32 on a multiarch AArch64.

This revision was automatically updated to reflect the committed changes.