mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-22 13:29:44 +00:00
do not call expandop on the same value more than once. This fixes
X86/2004-02-22-Casts.llx git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21919 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3013138bd3
commit
66de05b606
@ -2131,10 +2131,6 @@ ExpandIntToFP(bool isSigned, MVT::ValueType DestTy, SDOperand Source) {
|
|||||||
assert(Source.getValueType() == MVT::i64 && "Only handle expand from i64!");
|
assert(Source.getValueType() == MVT::i64 && "Only handle expand from i64!");
|
||||||
|
|
||||||
if (!isSigned) {
|
if (!isSigned) {
|
||||||
// If this is unsigned, and not supported, first perform the conversion to
|
|
||||||
// signed, then adjust the result if the sign bit is set.
|
|
||||||
SDOperand SignedConv = ExpandIntToFP(true, DestTy, Source);
|
|
||||||
|
|
||||||
assert(Source.getValueType() == MVT::i64 &&
|
assert(Source.getValueType() == MVT::i64 &&
|
||||||
"This only works for 64-bit -> FP");
|
"This only works for 64-bit -> FP");
|
||||||
// The 64-bit value loaded will be incorrectly if the 'sign bit' of the
|
// The 64-bit value loaded will be incorrectly if the 'sign bit' of the
|
||||||
@ -2143,6 +2139,11 @@ ExpandIntToFP(bool isSigned, MVT::ValueType DestTy, SDOperand Source) {
|
|||||||
SDOperand Lo, Hi;
|
SDOperand Lo, Hi;
|
||||||
ExpandOp(Source, Lo, Hi);
|
ExpandOp(Source, Lo, Hi);
|
||||||
|
|
||||||
|
// If this is unsigned, and not supported, first perform the conversion to
|
||||||
|
// signed, then adjust the result if the sign bit is set.
|
||||||
|
SDOperand SignedConv = ExpandIntToFP(true, DestTy,
|
||||||
|
DAG.getNode(ISD::BUILD_PAIR, Source.getValueType(), Lo, Hi));
|
||||||
|
|
||||||
SDOperand SignSet = DAG.getSetCC(ISD::SETLT, TLI.getSetCCResultTy(), Hi,
|
SDOperand SignSet = DAG.getSetCC(ISD::SETLT, TLI.getSetCCResultTy(), Hi,
|
||||||
DAG.getConstant(0, Hi.getValueType()));
|
DAG.getConstant(0, Hi.getValueType()));
|
||||||
SDOperand Zero = getIntPtrConstant(0), Four = getIntPtrConstant(4);
|
SDOperand Zero = getIntPtrConstant(0), Four = getIntPtrConstant(4);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user