From 1c0d02231f21302d6ec51c87f3a2cc961242fb5f Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Wed, 18 Jun 2014 17:45:58 +0000 Subject: [PATCH] Work around ridiculous warning. Apparently C++ doesn't really have hex floating point constants. llvm-svn: 211192 --- lib/Target/R600/AMDGPUISelLowering.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/Target/R600/AMDGPUISelLowering.cpp b/lib/Target/R600/AMDGPUISelLowering.cpp index ac5d7908781..e9720ef8af1 100644 --- a/lib/Target/R600/AMDGPUISelLowering.cpp +++ b/lib/Target/R600/AMDGPUISelLowering.cpp @@ -1664,14 +1664,17 @@ SDValue AMDGPUTargetLowering::LowerFRINT(SDValue Op, SelectionDAG &DAG) const { assert(Op.getValueType() == MVT::f64); - SDValue C1 = DAG.getConstantFP(0x1.0p+52, MVT::f64); + APFloat C1Val(APFloat::IEEEdouble, "0x1.0p+52"); + SDValue C1 = DAG.getConstantFP(C1Val, MVT::f64); SDValue CopySign = DAG.getNode(ISD::FCOPYSIGN, SL, MVT::f64, C1, Src); SDValue Tmp1 = DAG.getNode(ISD::FADD, SL, MVT::f64, Src, CopySign); SDValue Tmp2 = DAG.getNode(ISD::FSUB, SL, MVT::f64, Tmp1, CopySign); SDValue Fabs = DAG.getNode(ISD::FABS, SL, MVT::f64, Src); - SDValue C2 = DAG.getConstantFP(0x1.fffffffffffffp+51, MVT::f64); + + APFloat C2Val(APFloat::IEEEdouble, "0x1.fffffffffffffp+51"); + SDValue C2 = DAG.getConstantFP(C2Val, MVT::f64); EVT SetCCVT = getSetCCResultType(*DAG.getContext(), MVT::f64); SDValue Cond = DAG.getSetCC(SL, SetCCVT, Fabs, C2, ISD::SETOGT);