Commit 5859e4d4 authored by palfia@homejinni.com's avatar palfia@homejinni.com

MIPS: Fix test-assembler-mips/MIPS10 test.

cvt_l_d() and cvt_d_l() instructions are replaced to cvt_w_d() and ctv_d_w() because kernel FPU emulator generates illegal instruction for double <-> long conversions.

BUG=
R=jkummerow@chromium.org, plind44@gmail.com

Review URL: https://codereview.chromium.org/133363005

Patch from Balazs Kilvady <kilvadyb@homejinni.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19073 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 4058d907
...@@ -765,10 +765,8 @@ TEST(MIPS10) { ...@@ -765,10 +765,8 @@ TEST(MIPS10) {
double b; double b;
int32_t dbl_mant; int32_t dbl_mant;
int32_t dbl_exp; int32_t dbl_exp;
int32_t long_hi; int32_t word;
int32_t long_lo; int32_t b_word;
int32_t b_long_hi;
int32_t b_long_lo;
} T; } T;
T t; T t;
...@@ -786,18 +784,14 @@ TEST(MIPS10) { ...@@ -786,18 +784,14 @@ TEST(MIPS10) {
__ sw(t1, MemOperand(a0, OFFSET_OF(T, dbl_exp))); __ sw(t1, MemOperand(a0, OFFSET_OF(T, dbl_exp)));
// Convert double in f0 to long, save hi/lo parts. // Convert double in f0 to long, save hi/lo parts.
__ cvt_l_d(f0, f0); __ cvt_w_d(f0, f0);
__ mfc1(t0, f0); // f0 has LS 32 bits of long. __ mfc1(t0, f0); // f0 has a 32-bits word.
__ mfc1(t1, f1); // f1 has MS 32 bits of long. __ sw(t0, MemOperand(a0, OFFSET_OF(T, word)));
__ sw(t0, MemOperand(a0, OFFSET_OF(T, long_lo)));
__ sw(t1, MemOperand(a0, OFFSET_OF(T, long_hi)));
// Convert the b long integers to double b. // Convert the b long integers to double b.
__ lw(t0, MemOperand(a0, OFFSET_OF(T, b_long_lo))); __ lw(t0, MemOperand(a0, OFFSET_OF(T, b_word)));
__ lw(t1, MemOperand(a0, OFFSET_OF(T, b_long_hi))); __ mtc1(t0, f8); // f8 has a 32-bits word.
__ mtc1(t0, f8); // f8 has LS 32-bits. __ cvt_d_w(f10, f8);
__ mtc1(t1, f9); // f9 has MS 32-bits.
__ cvt_d_l(f10, f8);
__ sdc1(f10, MemOperand(a0, OFFSET_OF(T, b))); __ sdc1(f10, MemOperand(a0, OFFSET_OF(T, b)));
__ jr(ra); __ jr(ra);
...@@ -811,18 +805,16 @@ TEST(MIPS10) { ...@@ -811,18 +805,16 @@ TEST(MIPS10) {
Handle<Code>())->ToObjectChecked(); Handle<Code>())->ToObjectChecked();
CHECK(code->IsCode()); CHECK(code->IsCode());
F3 f = FUNCTION_CAST<F3>(Code::cast(code)->entry()); F3 f = FUNCTION_CAST<F3>(Code::cast(code)->entry());
t.a = 2.147483647e9; // 0x7fffffff -> 0x41DFFFFFFFC00000 as double. t.a = 2.147483646e+09; // 0x7FFFFFFE -> 0xFF80000041DFFFFF as double.
t.b_long_hi = 0x000000ff; // 0xFF00FF00FF -> 0x426FE01FE01FE000 as double. t.b_word = 0x0ff00ff0; // 0x0FF00FF0 -> 0x as double.
t.b_long_lo = 0x00ff00ff;
Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0);
USE(dummy); USE(dummy);
CHECK_EQ(0x41DFFFFF, t.dbl_exp); CHECK_EQ(0x41DFFFFF, t.dbl_exp);
CHECK_EQ(0xFFC00000, t.dbl_mant); CHECK_EQ(0xFF800000, t.dbl_mant);
CHECK_EQ(0, t.long_hi); CHECK_EQ(0X7FFFFFFE, t.word);
CHECK_EQ(0x7fffffff, t.long_lo); // 0x0FF00FF0 -> 2.6739096+e08
// 0xFF00FF00FF -> 1.095233372415e12. CHECK_EQ(2.6739096e08, t.b);
CHECK_EQ(1.095233372415e12, t.b);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment