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 | 5eca265519e2c1545d9542b16bd484988dbc19d3 (patch) | |
| tree | ab38f0c20dce0d1b43bdd0ec87f071aa9aab25a8 /llvm/lib/Target | |
| parent | 8a51d8c8f77d39a283cd090191dc9827e5546851 (diff) | |
| download | bcm5719-llvm-5eca265519e2c1545d9542b16bd484988dbc19d3.tar.gz bcm5719-llvm-5eca265519e2c1545d9542b16bd484988dbc19d3.zip | |
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.
llvm-svn: 62980
Diffstat (limited to 'llvm/lib/Target')
| -rw-r--r-- | llvm/lib/Target/X86/X86Instr64bit.td | 5 | ||||
| -rw-r--r-- | llvm/lib/Target/X86/X86InstrInfo.td | 15 |
2 files changed, 20 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86Instr64bit.td b/llvm/lib/Target/X86/X86Instr64bit.td index 123062c6d05..774da61ba94 100644 --- a/llvm/lib/Target/X86/X86Instr64bit.td +++ b/llvm/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/llvm/lib/Target/X86/X86InstrInfo.td b/llvm/lib/Target/X86/X86InstrInfo.td index fbe03299e07..9649c234de4 100644 --- a/llvm/lib/Target/X86/X86InstrInfo.td +++ b/llvm/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 // |

