mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-10 04:33:40 +00:00
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
This commit is contained in:
parent
740ab03f12
commit
51a0437b16
@ -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
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
@ -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
|
||||
//
|
||||
|
8
test/CodeGen/X86/movgs.ll
Normal file
8
test/CodeGen/X86/movgs.ll
Normal file
@ -0,0 +1,8 @@
|
||||
; RUN: llvm-as < %s | llc -march=x86 | grep gs
|
||||
|
||||
define i32 @foo() nounwind readonly {
|
||||
entry:
|
||||
%tmp = load i32* addrspace(256)* getelementptr (i32* addrspace(256)* inttoptr (i32 72 to i32* addrspace(256)*), i32 31) ; <i32*> [#uses=1]
|
||||
%tmp1 = load i32* %tmp ; <i32> [#uses=1]
|
||||
ret i32 %tmp1
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user