diff options
author | Marcin Koscielnicki <koriakin@0x04.net> | 2016-04-25 09:24:34 +0000 |
---|---|---|
committer | Marcin Koscielnicki <koriakin@0x04.net> | 2016-04-25 09:24:34 +0000 |
commit | a44d44cb2ea8264c905d65e8bb1c94f3abbfac3d (patch) | |
tree | 0476276355d467365ec5d38c78a9456ace65d06f /llvm/lib | |
parent | bf4513b9aa2bb27b0464b8f9d047b6c8d26699cd (diff) | |
download | bcm5719-llvm-a44d44cb2ea8264c905d65e8bb1c94f3abbfac3d.tar.gz bcm5719-llvm-a44d44cb2ea8264c905d65e8bb1c94f3abbfac3d.zip |
[PowerPC] [PR27387] Disallow r0 for ADD8TLS.
ADD8TLS, a variant of add instruction used for initial-exec TLS,
currently accepts r0 as a source register. While add itself supports
r0 just fine, linker can relax it to a local-exec sequence, converting
it to addi - which doesn't support r0.
Differential Revision: http://reviews.llvm.org/D19193
llvm-svn: 267388
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCInstr64Bit.td | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCInstr64Bit.td b/llvm/lib/Target/PowerPC/PPCInstr64Bit.td index 58ad91d6d60..10020ba34bb 100644 --- a/llvm/lib/Target/PowerPC/PPCInstr64Bit.td +++ b/llvm/lib/Target/PowerPC/PPCInstr64Bit.td @@ -486,8 +486,10 @@ defm ADD8 : XOForm_1r<31, 266, 0, (outs g8rc:$rT), (ins g8rc:$rA, g8rc:$rB), "add", "$rT, $rA, $rB", IIC_IntSimple, [(set i64:$rT, (add i64:$rA, i64:$rB))]>; // ADD8 has a special form: reg = ADD8(reg, sym@tls) for use by the -// initial-exec thread-local storage model. -def ADD8TLS : XOForm_1<31, 266, 0, (outs g8rc:$rT), (ins g8rc:$rA, tlsreg:$rB), +// initial-exec thread-local storage model. We need to forbid r0 here - +// while it works for add just fine, the linker can relax this to local-exec +// addi, which won't work for r0. +def ADD8TLS : XOForm_1<31, 266, 0, (outs g8rc:$rT), (ins g8rc_nox0:$rA, tlsreg:$rB), "add $rT, $rA, $rB", IIC_IntSimple, [(set i64:$rT, (add i64:$rA, tglobaltlsaddr:$rB))]>; |