diff options
| author | Andrew Kaylor <andrew.kaylor@intel.com> | 2015-10-16 20:39:20 +0000 |
|---|---|---|
| committer | Andrew Kaylor <andrew.kaylor@intel.com> | 2015-10-16 20:39:20 +0000 |
| commit | 09b39acc033b6ee67fcb35e485fe0fcab856144d (patch) | |
| tree | c8834799ad23f5ba29cbda13e43cc76acccc4f94 /llvm/lib/Target | |
| parent | a7c5f0409c63ea76dcd3432ec5faadb1eba13c6b (diff) | |
| download | bcm5719-llvm-09b39acc033b6ee67fcb35e485fe0fcab856144d.tar.gz bcm5719-llvm-09b39acc033b6ee67fcb35e485fe0fcab856144d.zip | |
Fix assertion failure with fp128 to unsigned i64 conversion
Patch by Mitch Bodart
Differential Revision: http://reviews.llvm.org/D13780
llvm-svn: 250550
Diffstat (limited to 'llvm/lib/Target')
| -rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 618290a257a..e48d98a3f41 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -12779,7 +12779,7 @@ SDValue X86TargetLowering::LowerUINT_TO_FP(SDValue Op, } // If the given FP_TO_SINT (IsSigned) or FP_TO_UINT (!IsSigned) operation -// is legal, or has an f16 source (which needs to be promoted to f32), +// is legal, or has an fp128 or f16 source (which needs to be promoted to f32), // just return an <SDValue(), SDValue()> pair. // Otherwise it is assumed to be a conversion from one of f32, f64 or f80 // to i16, i32 or i64, and we lower it to a legal sequence. @@ -12796,15 +12796,11 @@ X86TargetLowering::FP_TO_INTHelper(SDValue Op, SelectionDAG &DAG, EVT TheVT = Op.getOperand(0).getValueType(); auto PtrVT = getPointerTy(DAG.getDataLayout()); - if (TheVT == MVT::f16) - // We need to promote the f16 to f32 before using the lowering - // in this routine. + if (TheVT != MVT::f32 && TheVT != MVT::f64 && TheVT != MVT::f80) { + // f16 must be promoted before using the lowering in this routine. + // fp128 does not use this lowering. return std::make_pair(SDValue(), SDValue()); - - assert((TheVT == MVT::f32 || - TheVT == MVT::f64 || - TheVT == MVT::f80) && - "Unexpected FP operand type in FP_TO_INTHelper"); + } // If using FIST to compute an unsigned i64, we'll need some fixup // to handle values above the maximum signed i64. A FIST is always |

