Reviewers: paul.l..., dusmil.imgtec, akos.palfi.imgtec,
djordje.pesic_imgtec.com,
Description:
MIPS: Replace numeric_limits<>::lowest() in cctest-assembler*.cc
On Mac for the requested minimal version (10.5) only old stl (from gcc
4.2.1)
can be used so unfortunately we can't use numeric_limits<>::lowest() which
were
added in 874c54e05e92e04590b1026b495108abfd6063b7
BUG=
TEST=cctest/test-assembler-mips64, cctest/test-assembler-mips
Please review this at https://codereview.chromium.org/1175463003/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+40, -40 lines):
M test/cctest/test-assembler-mips.cc
M test/cctest/test-assembler-mips64.cc
Index: test/cctest/test-assembler-mips.cc
diff --git a/test/cctest/test-assembler-mips.cc
b/test/cctest/test-assembler-mips.cc
index
e880df6ad9ef819ceebc6f5c585015727e942112..e159023347865ad98b6cd48029867285c44747b2
100644
--- a/test/cctest/test-assembler-mips.cc
+++ b/test/cctest/test-assembler-mips.cc
@@ -3454,8 +3454,8 @@ TEST(ABS) {
CHECK_EQ(test.b, std::numeric_limits<float>::max());
// Testing smallest negative number
- test.a = -std::numeric_limits<double>::lowest();
- test.b = -std::numeric_limits<float>::lowest();
+ test.a = -std::numeric_limits<double>::max(); // lowest()
+ test.b = -std::numeric_limits<float>::max(); // lowest()
(CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0));
CHECK_EQ(test.a, std::numeric_limits<double>::max());
CHECK_EQ(test.b, std::numeric_limits<float>::max());
@@ -3536,9 +3536,9 @@ TEST(ADD_FMT) {
CHECK_EQ(test.fc, 5.0);
test.a = std::numeric_limits<double>::max();
- test.b = std::numeric_limits<double>::lowest();
+ test.b = -std::numeric_limits<double>::max(); // lowest()
test.fa = std::numeric_limits<float>::max();
- test.fb = std::numeric_limits<float>::lowest();
+ test.fb = -std::numeric_limits<float>::max(); // lowest()
(CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0));
CHECK_EQ(test.c, 0.0);
CHECK_EQ(test.fc, 0.0);
@@ -3706,7 +3706,7 @@ TEST(C_COND_FMT) {
test.dOp1 = std::numeric_limits<double>::max();
test.dOp2 = std::numeric_limits<double>::min();
test.fOp1 = std::numeric_limits<float>::min();
- test.fOp2 = std::numeric_limits<float>::lowest();
+ test.fOp2 = -std::numeric_limits<float>::max(); // lowest()
(CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0));
CHECK_EQ(test.dF, 0U);
CHECK_EQ(test.dUn, 0U);
@@ -3725,8 +3725,8 @@ TEST(C_COND_FMT) {
CHECK_EQ(test.fOle, 0U);
CHECK_EQ(test.fUle, 0U);
- test.dOp1 = std::numeric_limits<double>::lowest();
- test.dOp2 = std::numeric_limits<double>::lowest();
+ test.dOp1 = -std::numeric_limits<double>::max(); // lowest()
+ test.dOp2 = -std::numeric_limits<double>::max(); // lowest()
test.fOp1 = std::numeric_limits<float>::max();
test.fOp2 = std::numeric_limits<float>::max();
(CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0));
@@ -3914,7 +3914,7 @@ TEST(CMP_COND_FMT) {
test.dOp1 = std::numeric_limits<double>::max();
test.dOp2 = std::numeric_limits<double>::min();
test.fOp1 = std::numeric_limits<float>::min();
- test.fOp2 = std::numeric_limits<float>::lowest();
+ test.fOp2 = -std::numeric_limits<float>::max(); // lowest()
(CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0));
CHECK_EQ(bit_cast<uint64_t>(test.dF), dFalse);
CHECK_EQ(bit_cast<uint64_t>(test.dUn), dFalse);
@@ -3936,8 +3936,8 @@ TEST(CMP_COND_FMT) {
CHECK_EQ(bit_cast<uint32_t>(test.fOle), fFalse);
CHECK_EQ(bit_cast<uint32_t>(test.fUle), fFalse);
- test.dOp1 = std::numeric_limits<double>::lowest();
- test.dOp2 = std::numeric_limits<double>::lowest();
+ test.dOp1 = -std::numeric_limits<double>::max(); // lowest()
+ test.dOp2 = -std::numeric_limits<double>::max(); // lowest()
test.fOp1 = std::numeric_limits<float>::max();
test.fOp2 = std::numeric_limits<float>::max();
(CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0));
@@ -4155,16 +4155,16 @@ TEST(CVT) {
CHECK_EQ(test.cvt_w_d_out, std::numeric_limits<int32_t>::max());
- test.cvt_d_s_in = std::numeric_limits<float>::lowest();
- test.cvt_d_w_in = std::numeric_limits<int32_t>::lowest();
- test.cvt_d_l_in = std::numeric_limits<int64_t>::lowest();
- test.cvt_l_s_in = std::numeric_limits<float>::lowest();
- test.cvt_l_d_in = std::numeric_limits<double>::lowest();
- test.cvt_s_d_in = std::numeric_limits<double>::lowest();
- test.cvt_s_w_in = std::numeric_limits<int32_t>::lowest();
- test.cvt_s_l_in = std::numeric_limits<int64_t>::lowest();
- test.cvt_w_s_in = std::numeric_limits<float>::lowest();
- test.cvt_w_d_in = std::numeric_limits<double>::lowest();
+ test.cvt_d_s_in = -std::numeric_limits<float>::max(); // lowest()
+ test.cvt_d_w_in = std::numeric_limits<int32_t>::min(); // lowest()
+ test.cvt_d_l_in = std::numeric_limits<int64_t>::min(); // lowest()
+ test.cvt_l_s_in = -std::numeric_limits<float>::max(); // lowest()
+ test.cvt_l_d_in = -std::numeric_limits<double>::max(); // lowest()
+ test.cvt_s_d_in = -std::numeric_limits<double>::max(); // lowest()
+ test.cvt_s_w_in = std::numeric_limits<int32_t>::min(); // lowest()
+ test.cvt_s_l_in = std::numeric_limits<int64_t>::min(); // lowest()
+ test.cvt_w_s_in = -std::numeric_limits<float>::max(); // lowest()
+ test.cvt_w_d_in = -std::numeric_limits<double>::max(); // lowest()
(CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0));
CHECK_EQ(test.cvt_d_s_out, static_cast<double>(test.cvt_d_s_in));
Index: test/cctest/test-assembler-mips64.cc
diff --git a/test/cctest/test-assembler-mips64.cc
b/test/cctest/test-assembler-mips64.cc
index
1c7c1aa5cfcd83291c25c04da3662d9e3a030cbe..a698e16565ae1f17192f23cd6ea2ef56f6a8b4ec
100644
--- a/test/cctest/test-assembler-mips64.cc
+++ b/test/cctest/test-assembler-mips64.cc
@@ -3593,8 +3593,8 @@ TEST(ABS) {
CHECK_EQ(test.b, std::numeric_limits<float>::max());
// Testing smallest negative number
- test.a = -std::numeric_limits<double>::lowest();
- test.b = -std::numeric_limits<float>::lowest();
+ test.a = -std::numeric_limits<double>::max(); // lowest()
+ test.b = -std::numeric_limits<float>::max(); // lowest()
(CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0));
CHECK_EQ(test.a, std::numeric_limits<double>::max());
CHECK_EQ(test.b, std::numeric_limits<float>::max());
@@ -3675,9 +3675,9 @@ TEST(ADD_FMT) {
CHECK_EQ(test.fc, 5.0);
test.a = std::numeric_limits<double>::max();
- test.b = std::numeric_limits<double>::lowest();
+ test.b = -std::numeric_limits<double>::max(); // lowest()
test.fa = std::numeric_limits<float>::max();
- test.fb = std::numeric_limits<float>::lowest();
+ test.fb = -std::numeric_limits<float>::max(); // lowest()
(CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0));
CHECK_EQ(test.c, 0.0);
CHECK_EQ(test.fc, 0.0);
@@ -3845,7 +3845,7 @@ TEST(C_COND_FMT) {
test.dOp1 = std::numeric_limits<double>::max();
test.dOp2 = std::numeric_limits<double>::min();
test.fOp1 = std::numeric_limits<float>::min();
- test.fOp2 = std::numeric_limits<float>::lowest();
+ test.fOp2 = -std::numeric_limits<float>::max(); // lowest()
(CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0));
CHECK_EQ(test.dF, 0U);
CHECK_EQ(test.dUn, 0U);
@@ -3864,8 +3864,8 @@ TEST(C_COND_FMT) {
CHECK_EQ(test.fOle, 0U);
CHECK_EQ(test.fUle, 0U);
- test.dOp1 = std::numeric_limits<double>::lowest();
- test.dOp2 = std::numeric_limits<double>::lowest();
+ test.dOp1 = -std::numeric_limits<double>::max(); // lowest()
+ test.dOp2 = -std::numeric_limits<double>::max(); // lowest()
test.fOp1 = std::numeric_limits<float>::max();
test.fOp2 = std::numeric_limits<float>::max();
(CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0));
@@ -4053,7 +4053,7 @@ TEST(CMP_COND_FMT) {
test.dOp1 = std::numeric_limits<double>::max();
test.dOp2 = std::numeric_limits<double>::min();
test.fOp1 = std::numeric_limits<float>::min();
- test.fOp2 = std::numeric_limits<float>::lowest();
+ test.fOp2 = -std::numeric_limits<float>::max(); // lowest()
(CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0));
CHECK_EQ(bit_cast<uint64_t>(test.dF), dFalse);
CHECK_EQ(bit_cast<uint64_t>(test.dUn), dFalse);
@@ -4075,8 +4075,8 @@ TEST(CMP_COND_FMT) {
CHECK_EQ(bit_cast<uint32_t>(test.fOle), fFalse);
CHECK_EQ(bit_cast<uint32_t>(test.fUle), fFalse);
- test.dOp1 = std::numeric_limits<double>::lowest();
- test.dOp2 = std::numeric_limits<double>::lowest();
+ test.dOp1 = -std::numeric_limits<double>::max(); // lowest()
+ test.dOp2 = -std::numeric_limits<double>::max(); // lowest()
test.fOp1 = std::numeric_limits<float>::max();
test.fOp2 = std::numeric_limits<float>::max();
(CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0));
@@ -4270,16 +4270,16 @@ TEST(CVT) {
CHECK_EQ(test.cvt_w_d_out, std::numeric_limits<int32_t>::max());
- test.cvt_d_s_in = std::numeric_limits<float>::lowest();
- test.cvt_d_w_in = std::numeric_limits<int32_t>::lowest();
- test.cvt_d_l_in = std::numeric_limits<int64_t>::lowest();
- test.cvt_l_s_in = std::numeric_limits<float>::lowest();
- test.cvt_l_d_in = std::numeric_limits<double>::lowest();
- test.cvt_s_d_in = std::numeric_limits<double>::lowest();
- test.cvt_s_w_in = std::numeric_limits<int32_t>::lowest();
- test.cvt_s_l_in = std::numeric_limits<int64_t>::lowest();
- test.cvt_w_s_in = std::numeric_limits<float>::lowest();
- test.cvt_w_d_in = std::numeric_limits<double>::lowest();
+ test.cvt_d_s_in = -std::numeric_limits<float>::max(); // lowest()
+ test.cvt_d_w_in = std::numeric_limits<int32_t>::min(); // lowest()
+ test.cvt_d_l_in = std::numeric_limits<int64_t>::min(); // lowest()
+ test.cvt_l_s_in = -std::numeric_limits<float>::max(); // lowest()
+ test.cvt_l_d_in = -std::numeric_limits<double>::max(); // lowest()
+ test.cvt_s_d_in = -std::numeric_limits<double>::max(); // lowest()
+ test.cvt_s_w_in = std::numeric_limits<int32_t>::min(); // lowest()
+ test.cvt_s_l_in = std::numeric_limits<int64_t>::min(); // lowest()
+ test.cvt_w_s_in = -std::numeric_limits<float>::max(); // lowest()
+ test.cvt_w_d_in = -std::numeric_limits<double>::max(); // lowest()
(CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0));
CHECK_EQ(test.cvt_d_s_out, static_cast<double>(test.cvt_d_s_in));
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.