Fix unwanted float-to-double-promotions

Unwanted promotions resulted into check_eq errors from this CR:
 https://codereview.chromium.org/1384873002/
 http://build.chromium.org/p/client.v8/builders/V8%20Arm/builds/3141/steps/Check/logs/4

Found via -Wdouble-promotion.

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

Cr-Commit-Position: refs/heads/master@{#31125}
This commit is contained in:
karl 2015-10-06 07:50:29 -07:00 committed by Commit bot
parent 565f0d730b
commit fde36818c6
4 changed files with 31 additions and 31 deletions

View File

@ -4866,7 +4866,7 @@ TEST(RunChangeFloat32ToFloat64) {
FOR_FLOAT32_INPUTS(i) {
expected = *i;
CHECK_EQ(0, m.Call());
CHECK_EQ(expected, actual);
CHECK_EQ(static_cast<double>(expected), actual);
}
}

View File

@ -337,8 +337,8 @@ TEST(4) {
t.y = 9.0;
Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0);
USE(dummy);
CHECK_EQ(4.5, t.y);
CHECK_EQ(9.0, t.x);
CHECK_EQ(4.5f, t.y);
CHECK_EQ(9.0f, t.x);
CHECK_EQ(-123.456, t.n);
CHECK_EQ(2718.2818, t.m);
CHECK_EQ(2, t.i);
@ -704,14 +704,14 @@ TEST(8) {
CHECK_EQ(5.5, d.g);
CHECK_EQ(6.6, d.h);
CHECK_EQ(7.0, f.a);
CHECK_EQ(8.0, f.b);
CHECK_EQ(1.0, f.c);
CHECK_EQ(2.0, f.d);
CHECK_EQ(3.0, f.e);
CHECK_EQ(4.0, f.f);
CHECK_EQ(5.0, f.g);
CHECK_EQ(6.0, f.h);
CHECK_EQ(7.0f, f.a);
CHECK_EQ(8.0f, f.b);
CHECK_EQ(1.0f, f.c);
CHECK_EQ(2.0f, f.d);
CHECK_EQ(3.0f, f.e);
CHECK_EQ(4.0f, f.f);
CHECK_EQ(5.0f, f.g);
CHECK_EQ(6.0f, f.h);
}
@ -814,14 +814,14 @@ TEST(9) {
CHECK_EQ(5.5, d.g);
CHECK_EQ(6.6, d.h);
CHECK_EQ(7.0, f.a);
CHECK_EQ(8.0, f.b);
CHECK_EQ(1.0, f.c);
CHECK_EQ(2.0, f.d);
CHECK_EQ(3.0, f.e);
CHECK_EQ(4.0, f.f);
CHECK_EQ(5.0, f.g);
CHECK_EQ(6.0, f.h);
CHECK_EQ(7.0f, f.a);
CHECK_EQ(8.0f, f.b);
CHECK_EQ(1.0f, f.c);
CHECK_EQ(2.0f, f.d);
CHECK_EQ(3.0f, f.e);
CHECK_EQ(4.0f, f.f);
CHECK_EQ(5.0f, f.g);
CHECK_EQ(6.0f, f.h);
}
@ -920,14 +920,14 @@ TEST(10) {
CHECK_EQ(5.5, d.g);
CHECK_EQ(6.6, d.h);
CHECK_EQ(7.0, f.a);
CHECK_EQ(8.0, f.b);
CHECK_EQ(1.0, f.c);
CHECK_EQ(2.0, f.d);
CHECK_EQ(3.0, f.e);
CHECK_EQ(4.0, f.f);
CHECK_EQ(5.0, f.g);
CHECK_EQ(6.0, f.h);
CHECK_EQ(7.0f, f.a);
CHECK_EQ(8.0f, f.b);
CHECK_EQ(1.0f, f.c);
CHECK_EQ(2.0f, f.d);
CHECK_EQ(3.0f, f.e);
CHECK_EQ(4.0f, f.f);
CHECK_EQ(5.0f, f.g);
CHECK_EQ(6.0f, f.h);
}

View File

@ -260,7 +260,7 @@ TEST(SimdObjects) {
// Check special lane values.
value->set_lane(1, -0.0);
CHECK_EQ(-0.0, value->get_lane(1));
CHECK_EQ(-0.0f, value->get_lane(1));
CHECK(std::signbit(value->get_lane(1))); // Sign bit should be preserved.
value->set_lane(2, quiet_NaN);
CHECK(std::isnan(value->get_lane(2)));

View File

@ -1276,7 +1276,7 @@ TEST(SerializeToplevelExternalString) {
Handle<Object> copy_result =
Execution::Call(isolate, copy_fun, global, 0, NULL).ToHandleChecked();
CHECK_EQ(15.0f, copy_result->Number());
CHECK_EQ(15.0, copy_result->Number());
delete cache;
}
@ -1334,7 +1334,7 @@ TEST(SerializeToplevelLargeExternalString) {
Handle<Object> copy_result =
Execution::Call(isolate, copy_fun, global, 0, NULL).ToHandleChecked();
CHECK_EQ(42.0f, copy_result->Number());
CHECK_EQ(42.0, copy_result->Number());
delete cache;
string.Dispose();
@ -1385,7 +1385,7 @@ TEST(SerializeToplevelExternalScriptName) {
Handle<Object> copy_result =
Execution::Call(isolate, copy_fun, global, 0, NULL).ToHandleChecked();
CHECK_EQ(10.0f, copy_result->Number());
CHECK_EQ(10.0, copy_result->Number());
delete cache;
}