summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore
diff options
context:
space:
mode:
Diffstat (limited to 'Source/JavaScriptCore')
-rw-r--r--Source/JavaScriptCore/llint/LowLevelInterpreter.cpp11
-rw-r--r--Source/JavaScriptCore/offlineasm/cloop.rb2
2 files changed, 12 insertions, 1 deletions
diff --git a/Source/JavaScriptCore/llint/LowLevelInterpreter.cpp b/Source/JavaScriptCore/llint/LowLevelInterpreter.cpp
index a9cb393b0..b2ce2483e 100644
--- a/Source/JavaScriptCore/llint/LowLevelInterpreter.cpp
+++ b/Source/JavaScriptCore/llint/LowLevelInterpreter.cpp
@@ -116,6 +116,17 @@ static double Ints2Double(uint32_t lo, uint32_t hi)
u.ival64 = (static_cast<uint64_t>(hi) << 32) | lo;
return u.dval;
}
+
+static void Double2Ints(double val, uint32_t& lo, uint32_t& hi)
+{
+ union {
+ double dval;
+ uint64_t ival64;
+ } u;
+ u.dval = val;
+ hi = static_cast<uint32_t>(u.ival64 >> 32);
+ lo = static_cast<uint32_t>(u.ival64);
+}
#endif // USE(JSVALUE32_64)
} // namespace LLint
diff --git a/Source/JavaScriptCore/offlineasm/cloop.rb b/Source/JavaScriptCore/offlineasm/cloop.rb
index cbe7e2ca1..8d0838ebd 100644
--- a/Source/JavaScriptCore/offlineasm/cloop.rb
+++ b/Source/JavaScriptCore/offlineasm/cloop.rb
@@ -1025,7 +1025,7 @@ class Instruction
# 32-bit instruction: f2dii dblOp int32LoOp int32HiOp (based on ARMv7)
# Encode a 64-bit double into 2 32-bit ints (low and high).
when "fd2ii"
- $asm.putc "Double2Ints(#{operands[0].clValue(:double)}, #{operands[1].clValue}, #{operands[2].clValue});"
+ $asm.putc "Double2Ints(#{operands[0].clValue(:double)}, #{operands[1].clValue(:uint32)}, #{operands[2].clValue(:uint32)});"
# 64-bit instruction: fq2d int64Op dblOp (based on X64)
# Copy a bit-encoded double in a 64-bit int register to a double register.