| Index: test/cctest/compiler/test-run-machops.cc
|
| diff --git a/test/cctest/compiler/test-run-machops.cc b/test/cctest/compiler/test-run-machops.cc
|
| index a7b1768d2a541ceac63234314dfee5b087cee5f6..7c505a79ac5edec5d211dc97a35436d33290e1ac 100644
|
| --- a/test/cctest/compiler/test-run-machops.cc
|
| +++ b/test/cctest/compiler/test-run-machops.cc
|
| @@ -4647,6 +4647,46 @@ TEST(RunFloat32Constant) {
|
| }
|
|
|
|
|
| +TEST(RunFloat64ExtractWord32) {
|
| + uint64_t input = 0;
|
| + for (int location = 0; location < 2; ++location) {
|
| + RawMachineAssemblerTester<int32_t> m;
|
| + m.Return(m.Float64ExtractWord32(location,
|
| + m.LoadFromPointer(&input, kMachFloat64)));
|
| + FOR_FLOAT64_INPUTS(i) {
|
| + input = bit_cast<uint64_t>(*i);
|
| + int32_t expected =
|
| + bit_cast<int32_t>(static_cast<uint32_t>(input >> (location * 32)));
|
| + CHECK_EQ(expected, m.Call());
|
| + }
|
| + }
|
| +}
|
| +
|
| +
|
| +TEST(RunFloat64InsertWord32) {
|
| + uint64_t input = 0;
|
| + uint64_t result = 0;
|
| + for (int location = 0; location < 2; ++location) {
|
| + RawMachineAssemblerTester<int32_t> m(kMachInt32);
|
| + m.StoreToPointer(
|
| + &result, kMachFloat64,
|
| + m.Float64InsertWord32(location, m.LoadFromPointer(&input, kMachFloat64),
|
| + m.Parameter(0)));
|
| + m.Return(m.Int32Constant(0));
|
| + FOR_FLOAT64_INPUTS(i) {
|
| + FOR_INT32_INPUTS(j) {
|
| + input = bit_cast<uint64_t>(*i);
|
| + uint64_t expected =
|
| + (input & ~(V8_UINT64_C(0xFFFFFFFF) << (location * 32))) |
|
| + (static_cast<uint64_t>(bit_cast<uint32_t>(*j)) << (location * 32));
|
| + CHECK_EQ(0, m.Call(*j));
|
| + CHECK_EQ(expected, result);
|
| + }
|
| + }
|
| + }
|
| +}
|
| +
|
| +
|
| static double two_30 = 1 << 30; // 2^30 is a smi boundary.
|
| static double two_52 = two_30 * (1 << 22); // 2^52 is a precision boundary.
|
| static double kValues[] = {0.1,
|
|
|