Index: src/compiler/arm/code-generator-arm.cc |
diff --git a/src/compiler/arm/code-generator-arm.cc b/src/compiler/arm/code-generator-arm.cc |
index 5c94ccf7c3b2d07bb6ce1b379cf99d14135080db..ddba29d2d68dc3edf3a317600d92ff5fe607ea82 100644 |
--- a/src/compiler/arm/code-generator-arm.cc |
+++ b/src/compiler/arm/code-generator-arm.cc |
@@ -165,7 +165,9 @@ class OutOfLineLoadFloat32 final : public OutOfLineCode { |
: OutOfLineCode(gen), result_(result) {} |
void Generate() final { |
- __ vmov(result_, std::numeric_limits<float>::quiet_NaN()); |
+ // Compute sqrtf(-1.0f), which results in a quiet single-precision NaN. |
+ __ vmov(result_, -1.0f); |
+ __ vsqrt(result_, result_); |
} |
private: |
@@ -179,7 +181,9 @@ class OutOfLineLoadFloat64 final : public OutOfLineCode { |
: OutOfLineCode(gen), result_(result) {} |
void Generate() final { |
- __ vmov(result_, std::numeric_limits<double>::quiet_NaN(), kScratchReg); |
+ // Compute sqrt(-1.0), which results in a quiet double-precision NaN. |
+ __ vmov(result_, -1.0); |
+ __ vsqrt(result_, result_); |
} |
private: |