diff --git a/llvm/lib/Target/PowerPC/PPCInstrInfo.td b/llvm/lib/Target/PowerPC/PPCInstrInfo.td --- a/llvm/lib/Target/PowerPC/PPCInstrInfo.td +++ b/llvm/lib/Target/PowerPC/PPCInstrInfo.td @@ -410,6 +410,9 @@ // Get the Hi bits of a 64 bit immediate. def getFPAs64BitIntHi : SDNodeXFormgetValueAPF(); + bool LosesInfo; + APFloatOfN.convert(APFloat::IEEEdouble(), APFloat::rmNearestTiesToEven, + &LosesInfo); uint32_t Hi = (uint32_t)((APFloatOfN.bitcastToAPInt().getZExtValue() & 0xFFFFFFFF00000000LL) >> 32); return CurDAG->getTargetConstant(Hi, SDLoc(N), MVT::i32); @@ -418,6 +421,9 @@ // Get the Lo bits of a 64 bit immediate. def getFPAs64BitIntLo : SDNodeXFormgetValueAPF(); + bool LosesInfo; + APFloatOfN.convert(APFloat::IEEEdouble(), APFloat::rmNearestTiesToEven, + &LosesInfo); uint32_t Lo = (uint32_t)(APFloatOfN.bitcastToAPInt().getZExtValue() & 0xFFFFFFFF); return CurDAG->getTargetConstant(Lo, SDLoc(N), MVT::i32); diff --git a/llvm/test/CodeGen/PowerPC/constant-pool.ll b/llvm/test/CodeGen/PowerPC/constant-pool.ll --- a/llvm/test/CodeGen/PowerPC/constant-pool.ll +++ b/llvm/test/CodeGen/PowerPC/constant-pool.ll @@ -9,8 +9,8 @@ define float @FloatConstantPool() { ; CHECK-LABEL: FloatConstantPool: ; CHECK: # %bb.0: # %entry -; CHECK-NEXT: xxsplti32dx vs1, 0, 0 -; CHECK-NEXT: xxsplti32dx vs1, 1, 8388577 +; CHECK-NEXT: xxsplti32dx vs1, 0, 940572664 +; CHECK-NEXT: xxsplti32dx vs1, 1, 1073741824 ; CHECK-NEXT: # kill: def $f1 killed $f1 killed $vsl1 ; CHECK-NEXT: blr ; diff --git a/llvm/test/CodeGen/PowerPC/p10-splatImm-CPload-pcrel.ll b/llvm/test/CodeGen/PowerPC/p10-splatImm-CPload-pcrel.ll --- a/llvm/test/CodeGen/PowerPC/p10-splatImm-CPload-pcrel.ll +++ b/llvm/test/CodeGen/PowerPC/p10-splatImm-CPload-pcrel.ll @@ -160,22 +160,22 @@ define dso_local float @testFloatDenormScalar() local_unnamed_addr { ; CHECK-LE-LABEL: testFloatDenormScalar: ; CHECK-LE: # %bb.0: # %entry -; CHECK-LE-NEXT: xxsplti32dx vs1, 0, 0 -; CHECK-LE-NEXT: xxsplti32dx vs1, 1, 7136238 +; CHECK-LE-NEXT: xxsplti32dx vs1, 0, 940259579 +; CHECK-LE-NEXT: xxsplti32dx vs1, 1, -2147483648 ; CHECK-LE-NEXT: # kill: def $f1 killed $f1 killed $vsl1 ; CHECK-LE-NEXT: blr ; ; CHECK-NOPCREL-BE-LABEL: testFloatDenormScalar: ; CHECK-NOPCREL-BE: # %bb.0: # %entry -; CHECK-NOPCREL-BE-NEXT: xxsplti32dx vs1, 0, 0 -; CHECK-NOPCREL-BE-NEXT: xxsplti32dx vs1, 1, 7136238 +; CHECK-NOPCREL-BE-NEXT: xxsplti32dx vs1, 0, 940259579 +; CHECK-NOPCREL-BE-NEXT: xxsplti32dx vs1, 1, -2147483648 ; CHECK-NOPCREL-BE-NEXT: # kill: def $f1 killed $f1 killed $vsl1 ; CHECK-NOPCREL-BE-NEXT: blr ; ; CHECK-NOPCREL-LE-LABEL: testFloatDenormScalar: ; CHECK-NOPCREL-LE: # %bb.0: # %entry -; CHECK-NOPCREL-LE-NEXT: xxsplti32dx vs1, 0, 0 -; CHECK-NOPCREL-LE-NEXT: xxsplti32dx vs1, 1, 7136238 +; CHECK-NOPCREL-LE-NEXT: xxsplti32dx vs1, 0, 940259579 +; CHECK-NOPCREL-LE-NEXT: xxsplti32dx vs1, 1, -2147483648 ; CHECK-NOPCREL-LE-NEXT: # kill: def $f1 killed $f1 killed $vsl1 ; CHECK-NOPCREL-LE-NEXT: blr ; @@ -187,8 +187,8 @@ ; ; CHECK-BE-LABEL: testFloatDenormScalar: ; CHECK-BE: # %bb.0: # %entry -; CHECK-BE-NEXT: xxsplti32dx vs1, 0, 0 -; CHECK-BE-NEXT: xxsplti32dx vs1, 1, 7136238 +; CHECK-BE-NEXT: xxsplti32dx vs1, 0, 940259579 +; CHECK-BE-NEXT: xxsplti32dx vs1, 1, -2147483648 ; CHECK-BE-NEXT: # kill: def $f1 killed $f1 killed $vsl1 ; CHECK-BE-NEXT: blr entry: