From 6cae6ac23895abfdca7aac6e0a5d15d020961de6 Mon Sep 17 00:00:00 2001 From: Cameron Kaiser Date: Sat, 30 Apr 2022 17:41:09 -0700 Subject: [PATCH] fix floats in bailouts from POWER9 JIT project (branching adjust under separate investigation) --- js/src/jit/JitFrames.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/src/jit/JitFrames.cpp b/js/src/jit/JitFrames.cpp index 9e5d11792..eff3064f3 100644 --- a/js/src/jit/JitFrames.cpp +++ b/js/src/jit/JitFrames.cpp @@ -1949,9 +1949,15 @@ SnapshotIterator::allocationValue(const RValueAllocation& alloc, ReadMethod rm) } pun; MOZ_ASSERT(alloc.fpuReg().isSingle()); pun.d = fromRegister(alloc.fpuReg()); +#ifdef JS_CODEGEN_PPC_OSX + // The register is always written as a double, so we need to cast + // it down. + return Float32Value((float)pun.d); +#else // The register contains the encoding of a float32. We just read // the bits without making any conversion. return Float32Value(pun.f); +#endif } case RValueAllocation::ANY_FLOAT_STACK: