This is an archive of the discontinued LLVM Phabricator instance.

[X86] Add TLS_(base_)addrX32 for X32 mode
ClosedPublic

Authored by hvdijk on Nov 30 2020, 1:25 PM.

Details

Summary

LLVM has TLS_(base_)addr32 for 32-bit TLS addresses in 32-bit mode, and TLS_(base_)addr64 for 64-bit TLS addresses in 64-bit mode. x32 mode wants 32-bit TLS addresses in 64-bit mode, which were not yet handled. This adds TLS_(base_)addrX32 as copies of TLS_(base_)addr64, except that they use tls32(base)addr rather than tls64(base)addr, and then restricts TLS_(base_)addr64 to 64-bit LP64 mode, TLS_(base_)addrX32 to 64-bit ILP32 mode.

This diff by itself results in invalid code due to wrongly using the EBX register; the included test will fail. D16474 needs to be applied first, then this on top.

Diff Detail

Event Timeline

hvdijk created this revision.Nov 30 2020, 1:25 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 30 2020, 1:25 PM
hvdijk requested review of this revision.Nov 30 2020, 1:25 PM
RKSimon accepted this revision.Dec 2 2020, 8:20 AM

LGTM cheers

This revision is now accepted and ready to land.Dec 2 2020, 8:20 AM
This revision was landed with ongoing or failed builds.Dec 2 2020, 2:21 PM
This revision was automatically updated to reflect the committed changes.