OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_CCTEST_COMPILER_VALUE_HELPER_H_ | 5 #ifndef V8_CCTEST_COMPILER_VALUE_HELPER_H_ |
6 #define V8_CCTEST_COMPILER_VALUE_HELPER_H_ | 6 #define V8_CCTEST_COMPILER_VALUE_HELPER_H_ |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/compiler/common-operator.h" | 10 #include "src/compiler/common-operator.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 1.4495e+24f, 5.94015e+25f, 4.43608e+30f, | 95 1.4495e+24f, 5.94015e+25f, 4.43608e+30f, |
96 2.44502e+33f, 2.61152e+33f, 1.38178e+37f, | 96 2.44502e+33f, 2.61152e+33f, 1.38178e+37f, |
97 1.71306e+37f, 3.31899e+38f, 3.40282e+38f, | 97 1.71306e+37f, 3.31899e+38f, 3.40282e+38f, |
98 std::numeric_limits<float>::infinity()}; | 98 std::numeric_limits<float>::infinity()}; |
99 return std::vector<float>(&kValues[0], &kValues[arraysize(kValues)]); | 99 return std::vector<float>(&kValues[0], &kValues[arraysize(kValues)]); |
100 } | 100 } |
101 | 101 |
102 static std::vector<double> float64_vector() { | 102 static std::vector<double> float64_vector() { |
103 static const double nan = std::numeric_limits<double>::quiet_NaN(); | 103 static const double nan = std::numeric_limits<double>::quiet_NaN(); |
104 static const double values[] = { | 104 static const double values[] = { |
105 0.125, 0.25, 0.375, 0.5, | 105 0.125, 0.25, 0.375, 0.5, 1.25, -1.75, 2, 5.125, 6.25, 0.0, -0.0, |
106 1.25, -1.75, 2, 5.125, | 106 982983.25, 888, 2147483647.0, -999.75, 3.1e7, -2e66, 3e-88, |
107 6.25, 0.0, -0.0, 982983.25, | 107 -2147483648.0, V8_INFINITY, -V8_INFINITY, -nan, nan, 2147483647.375, |
108 888, 2147483647.0, -999.75, 3.1e7, | 108 2147483647.75, 2147483648.0, 2147483648.25, 2147483649.25, |
109 -2e66, 3e-88, -2147483648.0, V8_INFINITY, | 109 -2147483647.0, -2147483647.125, -2147483647.875, -2147483648.25, |
110 -V8_INFINITY, nan, 2147483647.375, 2147483647.75, | 110 -2147483649.5}; |
111 2147483648.0, 2147483648.25, 2147483649.25, -2147483647.0, | |
112 -2147483647.125, -2147483647.875, -2147483648.25, -2147483649.5}; | |
113 return std::vector<double>(&values[0], &values[arraysize(values)]); | 111 return std::vector<double>(&values[0], &values[arraysize(values)]); |
114 } | 112 } |
115 | 113 |
116 static const std::vector<int32_t> int32_vector() { | 114 static const std::vector<int32_t> int32_vector() { |
117 std::vector<uint32_t> values = uint32_vector(); | 115 std::vector<uint32_t> values = uint32_vector(); |
118 return std::vector<int32_t>(values.begin(), values.end()); | 116 return std::vector<int32_t>(values.begin(), values.end()); |
119 } | 117 } |
120 | 118 |
121 static const std::vector<uint32_t> uint32_vector() { | 119 static const std::vector<uint32_t> uint32_vector() { |
122 static const uint32_t kValues[] = { | 120 static const uint32_t kValues[] = { |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 | 161 |
164 #define FOR_INT32_SHIFTS(var) for (int32_t var = 0; var < 32; var++) | 162 #define FOR_INT32_SHIFTS(var) for (int32_t var = 0; var < 32; var++) |
165 | 163 |
166 #define FOR_UINT32_SHIFTS(var) for (uint32_t var = 0; var < 32; var++) | 164 #define FOR_UINT32_SHIFTS(var) for (uint32_t var = 0; var < 32; var++) |
167 | 165 |
168 } // namespace compiler | 166 } // namespace compiler |
169 } // namespace internal | 167 } // namespace internal |
170 } // namespace v8 | 168 } // namespace v8 |
171 | 169 |
172 #endif // V8_CCTEST_COMPILER_VALUE_HELPER_H_ | 170 #endif // V8_CCTEST_COMPILER_VALUE_HELPER_H_ |
OLD | NEW |