Chromium Code Reviews| Index: test/cctest/test-assembler-arm.cc |
| diff --git a/test/cctest/test-assembler-arm.cc b/test/cctest/test-assembler-arm.cc |
| index ac6dc9c5d02bf063dc6beb3fd471c2ffac1391b4..713768b84b7ec12329030fa04b4ac2aa829e37cb 100644 |
| --- a/test/cctest/test-assembler-arm.cc |
| +++ b/test/cctest/test-assembler-arm.cc |
| @@ -2919,42 +2919,48 @@ TEST(vswp) { |
| Assembler assm(isolate, NULL, 0); |
| typedef struct { |
| - double result0; |
| - double result1; |
| - double result2; |
| - double result3; |
| - double result4; |
| - double result5; |
| - double result6; |
| - double result7; |
| + uint64_t result0; |
| + uint64_t result1; |
| + uint64_t result2; |
| + uint64_t result3; |
| + uint64_t result4; |
| + uint64_t result5; |
| + uint64_t result6; |
| + uint64_t result7; |
| } T; |
| T t; |
| - __ vmov(d0, 1.0); |
| - __ vmov(d1, -1.0); |
| + __ stm(db_w, sp, r4.bit() | r5.bit() | r6.bit() | lr.bit()); |
| + |
| + __ mov(r4, Operand(0)); |
| + __ mov(r5, Operand(0x3FF00000)); |
| + __ mov(r6, Operand(0xBFF00000)); |
|
jbramley
2016/11/30 10:41:08
`double_to_rawbits` could make this cleaner:
uint
bbudge
2016/11/30 11:34:14
I used bit_cast<uint64_t> since double_to_rawbits
|
| + __ vmov(d0, r4, r5); // d0 = 1.0 |
| + __ vmov(d1, r4, r6); // d1 = -1.0 |
| __ vswp(d0, d1); |
| __ vstr(d0, r0, offsetof(T, result0)); |
| __ vstr(d1, r0, offsetof(T, result1)); |
| if (CpuFeatures::IsSupported(VFP32DREGS)) { |
| - __ vmov(d30, 1.0); |
| - __ vmov(d31, -1.0); |
| + __ vmov(d30, r4, r5); // d30 = 1.0 |
| + __ vmov(d31, r4, r6); // d31 = -1.0 |
| __ vswp(d30, d31); |
| __ vstr(d30, r0, offsetof(T, result2)); |
| __ vstr(d31, r0, offsetof(T, result3)); |
| } |
| // q-register swap. |
| - __ vmov(d8, 1.0); |
| - __ vmov(d9, 2.0); |
| - __ vmov(d10, 3.0); |
| - __ vmov(d11, 4.0); |
| + __ vmov(d8, r4, r5); |
| + __ vmov(d9, r4, r5); // q4 = [1.0, 1.0] |
| + __ vmov(d10, r4, r6); |
| + __ vmov(d11, r4, r6); // q5 = [-1.0, -1.0] |
| __ vswp(q4, q5); |
| __ vstr(d8, r0, offsetof(T, result4)); |
| __ vstr(d9, r0, offsetof(T, result5)); |
| __ vstr(d10, r0, offsetof(T, result6)); |
| __ vstr(d11, r0, offsetof(T, result7)); |
| + __ ldm(ia_w, sp, r4.bit() | r5.bit() | r6.bit() | pc.bit()); |
| __ bx(lr); |
| CodeDesc desc; |
| @@ -2968,16 +2974,16 @@ TEST(vswp) { |
| F3 f = FUNCTION_CAST<F3>(code->entry()); |
| Object* dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0); |
| USE(dummy); |
| - CHECK_EQ(-1.0, t.result0); |
| - CHECK_EQ(1.0, t.result1); |
| + CHECK_EQ(0xBFF0000000000000u, t.result0); |
|
jbramley
2016/11/30 10:41:08
Nearby tests use lower-case hexadecimal. This shou
bbudge
2016/11/30 11:34:14
Or we can use the 'one' and 'minus_one' constants
|
| + CHECK_EQ(0x3FF0000000000000u, t.result1); |
| if (CpuFeatures::IsSupported(VFP32DREGS)) { |
| - CHECK_EQ(-1.0, t.result2); |
| - CHECK_EQ(1.0, t.result3); |
| + CHECK_EQ(0xBFF0000000000000u, t.result2); |
| + CHECK_EQ(0x3FF0000000000000u, t.result3); |
| } |
| - CHECK_EQ(3.0, t.result4); |
| - CHECK_EQ(4.0, t.result5); |
| - CHECK_EQ(1.0, t.result6); |
| - CHECK_EQ(2.0, t.result7); |
| + CHECK_EQ(0xBFF0000000000000u, t.result4); |
| + CHECK_EQ(0xBFF0000000000000u, t.result5); |
| + CHECK_EQ(0x3FF0000000000000u, t.result6); |
| + CHECK_EQ(0x3FF0000000000000u, t.result7); |
| } |
| TEST(regress4292_b) { |