mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-08 21:32:39 +00:00
I cannot find a libgcc function for this builtin. Therefor expanding it to a noop (which is how it use to be treated). If someone who knows the x86 backend better than me could tell me how to get a lock prefix on an instruction, that would be nice to complete x86 support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47213 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
051bb7b075
commit
d497d9fab6
@ -1135,11 +1135,21 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
|
||||
|
||||
case ISD::MEMBARRIER: {
|
||||
assert(Node->getNumOperands() == 6 && "Invalid MemBarrier node!");
|
||||
SDOperand Ops[6];
|
||||
Ops[0] = LegalizeOp(Node->getOperand(0)); // Legalize the chain.
|
||||
for (int x = 1; x < 6; ++x)
|
||||
Ops[x] = PromoteOp(Node->getOperand(x));
|
||||
Result = DAG.UpdateNodeOperands(Result, &Ops[0], 6);
|
||||
switch (TLI.getOperationAction(ISD::MEMBARRIER, MVT::Other)) {
|
||||
default: assert(0 && "This action is not supported yet!");
|
||||
case TargetLowering::Legal: {
|
||||
SDOperand Ops[6];
|
||||
Ops[0] = LegalizeOp(Node->getOperand(0)); // Legalize the chain.
|
||||
for (int x = 1; x < 6; ++x)
|
||||
Ops[x] = PromoteOp(Node->getOperand(x));
|
||||
Result = DAG.UpdateNodeOperands(Result, &Ops[0], 6);
|
||||
break;
|
||||
}
|
||||
case TargetLowering::Expand:
|
||||
//There is no libgcc call for this op
|
||||
Result = Node->getOperand(0); // Noop
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -210,6 +210,7 @@ ARMTargetLowering::ARMTargetLowering(TargetMachine &TM)
|
||||
setOperationAction(ISD::STACKSAVE, MVT::Other, Expand);
|
||||
setOperationAction(ISD::STACKRESTORE, MVT::Other, Expand);
|
||||
setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i32 , Expand);
|
||||
setOperationAction(ISD::MEMBARRIER , MVT::Other, Expand);
|
||||
|
||||
if (!Subtarget->hasV6Ops()) {
|
||||
setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i16, Expand);
|
||||
|
@ -2459,6 +2459,7 @@ void CWriter::lowerIntrinsics(Function &F) {
|
||||
if (Function *F = CI->getCalledFunction())
|
||||
switch (F->getIntrinsicID()) {
|
||||
case Intrinsic::not_intrinsic:
|
||||
case Intrinsic::memory_barrier:
|
||||
case Intrinsic::vastart:
|
||||
case Intrinsic::vacopy:
|
||||
case Intrinsic::vaend:
|
||||
@ -2544,6 +2545,9 @@ void CWriter::visitCallInst(CallInst &I) {
|
||||
WroteCallee = true;
|
||||
break;
|
||||
}
|
||||
case Intrinsic::memory_barrier:
|
||||
Out << "0; __sync_syncronize()";
|
||||
return;
|
||||
case Intrinsic::vastart:
|
||||
Out << "0; ";
|
||||
|
||||
|
@ -181,7 +181,8 @@ SPUTargetLowering::SPUTargetLowering(SPUTargetMachine &TM)
|
||||
setOperationAction(ISD::MEMMOVE, MVT::Other, Expand);
|
||||
setOperationAction(ISD::MEMSET, MVT::Other, Expand);
|
||||
setOperationAction(ISD::MEMCPY, MVT::Other, Expand);
|
||||
|
||||
setOperationAction(ISD::MEMBARRIER, MVT::Other, Expand);
|
||||
|
||||
// PowerPC has no SREM/UREM instructions
|
||||
setOperationAction(ISD::SREM, MVT::i32, Expand);
|
||||
setOperationAction(ISD::UREM, MVT::i32, Expand);
|
||||
|
@ -69,7 +69,8 @@ IA64TargetLowering::IA64TargetLowering(TargetMachine &TM)
|
||||
setOperationAction(ISD::MEMMOVE , MVT::Other, Expand);
|
||||
setOperationAction(ISD::MEMSET , MVT::Other, Expand);
|
||||
setOperationAction(ISD::MEMCPY , MVT::Other, Expand);
|
||||
|
||||
setOperationAction(ISD::MEMBARRIER , MVT::Other, Expand);
|
||||
|
||||
setOperationAction(ISD::SINT_TO_FP , MVT::i1 , Promote);
|
||||
setOperationAction(ISD::UINT_TO_FP , MVT::i1 , Promote);
|
||||
|
||||
|
@ -84,6 +84,7 @@ MipsTargetLowering(MipsTargetMachine &TM): TargetLowering(TM)
|
||||
setOperationAction(ISD::MEMMOVE, MVT::Other, Expand);
|
||||
setOperationAction(ISD::MEMSET, MVT::Other, Expand);
|
||||
setOperationAction(ISD::MEMCPY, MVT::Other, Expand);
|
||||
setOperationAction(ISD::MEMBARRIER, MVT::Other, Expand);
|
||||
|
||||
setOperationAction(ISD::CTPOP, MVT::i32, Expand);
|
||||
setOperationAction(ISD::CTTZ , MVT::i32, Expand);
|
||||
|
@ -81,7 +81,8 @@ PPCTargetLowering::PPCTargetLowering(PPCTargetMachine &TM)
|
||||
setOperationAction(ISD::MEMMOVE, MVT::Other, Expand);
|
||||
setOperationAction(ISD::MEMSET, MVT::Other, Expand);
|
||||
setOperationAction(ISD::MEMCPY, MVT::Other, Expand);
|
||||
|
||||
setOperationAction(ISD::MEMBARRIER, MVT::Other, Expand);
|
||||
|
||||
// PowerPC has no SREM/UREM instructions
|
||||
setOperationAction(ISD::SREM, MVT::i32, Expand);
|
||||
setOperationAction(ISD::UREM, MVT::i32, Expand);
|
||||
|
@ -195,7 +195,8 @@ SparcTargetLowering::SparcTargetLowering(TargetMachine &TM)
|
||||
setOperationAction(ISD::MEMMOVE, MVT::Other, Expand);
|
||||
setOperationAction(ISD::MEMSET, MVT::Other, Expand);
|
||||
setOperationAction(ISD::MEMCPY, MVT::Other, Expand);
|
||||
|
||||
setOperationAction(ISD::MEMBARRIER, MVT::Other, Expand);
|
||||
|
||||
setOperationAction(ISD::FSIN , MVT::f64, Expand);
|
||||
setOperationAction(ISD::FCOS , MVT::f64, Expand);
|
||||
setOperationAction(ISD::FREM , MVT::f64, Expand);
|
||||
|
@ -281,6 +281,10 @@ X86TargetLowering::X86TargetLowering(TargetMachine &TM)
|
||||
setOperationAction(ISD::MEMSET , MVT::Other, Custom);
|
||||
setOperationAction(ISD::MEMCPY , MVT::Other, Custom);
|
||||
|
||||
if (!Subtarget->hasSSE2())
|
||||
setOperationAction(ISD::MEMBARRIER , MVT::Other, Expand);
|
||||
|
||||
|
||||
// Use the default ISD::LOCATION, ISD::DECLARE expansion.
|
||||
setOperationAction(ISD::LOCATION, MVT::Other, Expand);
|
||||
// FIXME - use subtarget debug flags
|
||||
|
Loading…
x
Reference in New Issue
Block a user