diff options
author | Nate Begeman <natebegeman@mac.com> | 2009-01-26 01:24:32 +0000 |
---|---|---|
committer | Nate Begeman <natebegeman@mac.com> | 2009-01-26 01:24:32 +0000 |
commit | 51a0437b166b612a89ad8f772c1f5538e8d52422 (patch) | |
tree | 38e1ac3c0b1df5ec8c8f3dc274c61304f7971812 /lib | |
parent | 740ab03f12b82eb2ad8ccddc385593f3367fc574 (diff) |
Map address space 256 to gs; similar mappings could be supported for the
other x86 segments. address space 0 is stack/default, 1-255 are reserved for
client use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62980 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/X86/X86Instr64bit.td | 5 | ||||
-rw-r--r-- | lib/Target/X86/X86InstrInfo.td | 15 |
2 files changed, 20 insertions, 0 deletions
diff --git a/lib/Target/X86/X86Instr64bit.td b/lib/Target/X86/X86Instr64bit.td index 123062c6d0..774da61ba9 100644 --- a/lib/Target/X86/X86Instr64bit.td +++ b/lib/Target/X86/X86Instr64bit.td @@ -1242,6 +1242,11 @@ def TLS_addr64 : I<0, Pseudo, (outs GR64:$dst), (ins i64imm:$sym), ".byte\t0x66; leaq\t${sym:mem}(%rip), $dst; .word\t0x6666; rex64", [(set GR64:$dst, (X86tlsaddr tglobaltlsaddr:$sym))]>; +let AddedComplexity = 5 in +def MOV64GSrm : RI<0x8B, MRMSrcMem, (outs GR64:$dst), (ins i64mem:$src), + "movq\t%gs:$src, $dst", + [(set GR64:$dst, (gsload addr:$src))]>, SegGS; + //===----------------------------------------------------------------------===// // Atomic Instructions //===----------------------------------------------------------------------===// diff --git a/lib/Target/X86/X86InstrInfo.td b/lib/Target/X86/X86InstrInfo.td index fbe03299e0..9649c234de 100644 --- a/lib/Target/X86/X86InstrInfo.td +++ b/lib/Target/X86/X86InstrInfo.td @@ -308,6 +308,16 @@ def nvloadi32 : PatFrag<(ops node:$ptr), (i32 (unindexedload node:$ptr)), [{ return false; }]>; +def gsload : PatFrag<(ops node:$ptr), (load node:$ptr), [{ + LoadSDNode *LD = cast<LoadSDNode>(N); + const Value *Src = LD->getSrcValue(); + if (!Src) + return false; + if (const PointerType *PT = dyn_cast<PointerType>(Src->getType())) + return PT->getAddressSpace() == 256; + return false; +}]>; + def loadi8 : PatFrag<(ops node:$ptr), (i8 (load node:$ptr))>; def loadi64 : PatFrag<(ops node:$ptr), (i64 (load node:$ptr))>; @@ -2852,6 +2862,11 @@ def TLS_tp : I<0x8B, Pseudo, (outs GR32:$dst), (ins), "movl\t%gs:0, $dst", [(set GR32:$dst, X86TLStp)]>, SegGS; +let AddedComplexity = 5 in +def GS_MOV32rm : I<0x8B, MRMSrcMem, (outs GR32:$dst), (ins i32mem:$src), + "movl\t%gs:$src, $dst", + [(set GR32:$dst, (gsload addr:$src))]>, SegGS; + //===----------------------------------------------------------------------===// // DWARF Pseudo Instructions // |