From 520ebe6c2f67753509dce0525a3e6ed7dac69833 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Fri, 13 Mar 2009 19:39:55 +0000 Subject: [PATCH] add 8 and 16 bit TLS moves. add a fixme note on how to remove code duplication. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66932 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86InstrInfo.td | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lib/Target/X86/X86InstrInfo.td b/lib/Target/X86/X86InstrInfo.td index 19703e9ce97..855d3b56112 100644 --- a/lib/Target/X86/X86InstrInfo.td +++ b/lib/Target/X86/X86InstrInfo.td @@ -2920,6 +2920,10 @@ def MOV32_mr : I<0x89, MRMDestMem, (outs), (ins i32mem:$dst, GR32_:$src), // Thread Local Storage Instructions // +// FIXME: there is duplication with the non-TLS case. +// There is a suggestion on how to fix this at +// http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20090309/075212.html + let Uses = [EBX] in def TLS_addr32 : I<0, Pseudo, (outs GR32:$dst), (ins i32imm:$sym), "leal\t${sym:mem}(,%ebx,1), $dst", @@ -2937,6 +2941,22 @@ def TLS_gs_ri : I<0x8B, Pseudo, (outs GR32:$dst), (ins i32imm:$src), (load (add X86TLStp, (X86Wrapper tglobaltlsaddr:$src))))]>, SegGS; +let AddedComplexity = 15 in +def TLS16_gs_ri : I<0x8B, Pseudo, (outs GR16:$dst), (ins i32imm:$src), + "movw\t%gs:${src:mem}, $dst", + [(set GR16:$dst, + (load (add X86TLStp, + (X86Wrapper tglobaltlsaddr:$src))))]>, + SegGS; + +let AddedComplexity = 15 in +def TLS8_gs_ri : I<0x8B, Pseudo, (outs GR8:$dst), (ins i32imm:$src), + "movb\t%gs:${src:mem}, $dst", + [(set GR8:$dst, + (load (add X86TLStp, + (X86Wrapper tglobaltlsaddr:$src))))]>, + SegGS; + let AddedComplexity = 15 in def TLS_ext16_gs_ri : I<0x8B, Pseudo, (outs GR32:$dst), (ins i32imm:$src), "movzwl\t%gs:${src:mem}, $dst", -- 2.34.1