mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-09 11:25:55 +00:00
Allow an integer to be converted into an MMX type when it's used in an inline
asm. <rdar://problem/10106006> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151303 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -352,10 +352,13 @@ static void getCopyToParts(SelectionDAG &DAG, DebugLoc DL,
|
|||||||
assert(NumParts == 1 && "Do not know what to promote to!");
|
assert(NumParts == 1 && "Do not know what to promote to!");
|
||||||
Val = DAG.getNode(ISD::FP_EXTEND, DL, PartVT, Val);
|
Val = DAG.getNode(ISD::FP_EXTEND, DL, PartVT, Val);
|
||||||
} else {
|
} else {
|
||||||
assert(PartVT.isInteger() && ValueVT.isInteger() &&
|
assert((PartVT.isInteger() || PartVT == MVT::x86mmx) &&
|
||||||
|
ValueVT.isInteger() &&
|
||||||
"Unknown mismatch!");
|
"Unknown mismatch!");
|
||||||
ValueVT = EVT::getIntegerVT(*DAG.getContext(), NumParts * PartBits);
|
ValueVT = EVT::getIntegerVT(*DAG.getContext(), NumParts * PartBits);
|
||||||
Val = DAG.getNode(ExtendKind, DL, ValueVT, Val);
|
Val = DAG.getNode(ExtendKind, DL, ValueVT, Val);
|
||||||
|
if (PartVT == MVT::x86mmx)
|
||||||
|
Val = DAG.getNode(ISD::BITCAST, DL, PartVT, Val);
|
||||||
}
|
}
|
||||||
} else if (PartBits == ValueVT.getSizeInBits()) {
|
} else if (PartBits == ValueVT.getSizeInBits()) {
|
||||||
// Different types of the same size.
|
// Different types of the same size.
|
||||||
@@ -363,10 +366,13 @@ static void getCopyToParts(SelectionDAG &DAG, DebugLoc DL,
|
|||||||
Val = DAG.getNode(ISD::BITCAST, DL, PartVT, Val);
|
Val = DAG.getNode(ISD::BITCAST, DL, PartVT, Val);
|
||||||
} else if (NumParts * PartBits < ValueVT.getSizeInBits()) {
|
} else if (NumParts * PartBits < ValueVT.getSizeInBits()) {
|
||||||
// If the parts cover less bits than value has, truncate the value.
|
// If the parts cover less bits than value has, truncate the value.
|
||||||
assert(PartVT.isInteger() && ValueVT.isInteger() &&
|
assert((PartVT.isInteger() || PartVT == MVT::x86mmx) &&
|
||||||
|
ValueVT.isInteger() &&
|
||||||
"Unknown mismatch!");
|
"Unknown mismatch!");
|
||||||
ValueVT = EVT::getIntegerVT(*DAG.getContext(), NumParts * PartBits);
|
ValueVT = EVT::getIntegerVT(*DAG.getContext(), NumParts * PartBits);
|
||||||
Val = DAG.getNode(ISD::TRUNCATE, DL, ValueVT, Val);
|
Val = DAG.getNode(ISD::TRUNCATE, DL, ValueVT, Val);
|
||||||
|
if (PartVT == MVT::x86mmx)
|
||||||
|
Val = DAG.getNode(ISD::BITCAST, DL, PartVT, Val);
|
||||||
}
|
}
|
||||||
|
|
||||||
// The value may have changed - recompute ValueVT.
|
// The value may have changed - recompute ValueVT.
|
||||||
|
12
test/CodeGen/X86/2012-02-23-mmx-inlineasm.ll
Normal file
12
test/CodeGen/X86/2012-02-23-mmx-inlineasm.ll
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
; RUN: llc -mcpu=i686 -mattr=+mmx < %s | FileCheck %s
|
||||||
|
; <rdar://problem/10106006>
|
||||||
|
|
||||||
|
define void @func() nounwind ssp {
|
||||||
|
; CHECK: psrlw %mm0, %mm1
|
||||||
|
entry:
|
||||||
|
call void asm sideeffect "psrlw $0, %mm1", "y,~{dirflag},~{fpsr},~{flags}"(i32 8) nounwind
|
||||||
|
unreachable
|
||||||
|
|
||||||
|
bb367: ; preds = %entry
|
||||||
|
ret void
|
||||||
|
}
|
Reference in New Issue
Block a user