This patch adds an option to get the TLS pointer via a call to aarch64_read_tp() (similar to aeabi_read_tp on AArch32).
Necessary on Nintendo Horizon OS, which puts the TLS pointer at a calculated offset from TPIDR_EL0.
Paths
| Differential D61226
[AArch64] Add an option to get the TLS pointer from software Needs ReviewPublic Authored by Thog on Apr 27 2019, 8:44 AM.
Details
Summary This patch adds an option to get the TLS pointer via a call to aarch64_read_tp() (similar to aeabi_read_tp on AArch32). Necessary on Nintendo Horizon OS, which puts the TLS pointer at a calculated offset from TPIDR_EL0.
Diff Detail Event TimelineHerald added subscribers: llvm-commits, dexonsmith, kristof.beyls, javed.absar. · View Herald Transcript Comment Actions How did you come up with the name __aarch64_read_tp? I guess it's okay.
I don't really understand how this is different from normal ELF TLS; does the offset vary at runtime somehow?
Comment Actions
That is how devkitPro's fork of GCC calls it.
With HardTp model, TPIDR_EL0 points to the TLS region.
Revision Contents
Diff 196972 lib/Target/AArch64/AArch64.td
lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp
lib/Target/AArch64/AArch64InstrInfo.td
lib/Target/AArch64/AArch64Subtarget.h
test/CodeGen/AArch64/readtp.ll
|
Is this addReg necessary? The definition of X0 is an implicit definition, so it should be copied by transferImpOps, unless I'm missing something.
RegState::Dead doesn't make any sense.