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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 3.59167e+16f, 3.38211e+19f, 2.67488e+20f, | 93 3.59167e+16f, 3.38211e+19f, 2.67488e+20f, |
94 1.78831e+21f, 9.20914e+21f, 8.35654e+23f, | 94 1.78831e+21f, 9.20914e+21f, 8.35654e+23f, |
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 = v8::base::OS::nan_value(); | 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, |
106 1.25, -1.75, 2, 5.125, | 106 1.25, -1.75, 2, 5.125, |
107 6.25, 0.0, -0.0, 982983.25, | 107 6.25, 0.0, -0.0, 982983.25, |
108 888, 2147483647.0, -999.75, 3.1e7, | 108 888, 2147483647.0, -999.75, 3.1e7, |
109 -2e66, 3e-88, -2147483648.0, V8_INFINITY, | 109 -2e66, 3e-88, -2147483648.0, V8_INFINITY, |
110 -V8_INFINITY, nan, 2147483647.375, 2147483647.75, | 110 -V8_INFINITY, nan, 2147483647.375, 2147483647.75, |
111 2147483648.0, 2147483648.25, 2147483649.25, -2147483647.0, | 111 2147483648.0, 2147483648.25, 2147483649.25, -2147483647.0, |
112 -2147483647.125, -2147483647.875, -2147483648.25, -2147483649.5}; | 112 -2147483647.125, -2147483647.875, -2147483648.25, -2147483649.5}; |
113 return std::vector<double>(&values[0], &values[arraysize(values)]); | 113 return std::vector<double>(&values[0], &values[arraysize(values)]); |
(...skipping 13 matching lines...) Expand all Loading... |
127 0x0000009e, 0x00000043, 0x0000af73, 0x0000116b, 0x00658ecc, 0x002b3b4c, | 127 0x0000009e, 0x00000043, 0x0000af73, 0x0000116b, 0x00658ecc, 0x002b3b4c, |
128 0x88776655, 0x70000000, 0x07200000, 0x7fffffff, 0x56123761, 0x7fffff00, | 128 0x88776655, 0x70000000, 0x07200000, 0x7fffffff, 0x56123761, 0x7fffff00, |
129 0x761c4761, 0x80000000, 0x88888888, 0xa0000000, 0xdddddddd, 0xe0000000, | 129 0x761c4761, 0x80000000, 0x88888888, 0xa0000000, 0xdddddddd, 0xe0000000, |
130 0xeeeeeeee, 0xfffffffd, 0xf0000000, 0x007fffff, 0x003fffff, 0x001fffff, | 130 0xeeeeeeee, 0xfffffffd, 0xf0000000, 0x007fffff, 0x003fffff, 0x001fffff, |
131 0x000fffff, 0x0007ffff, 0x0003ffff, 0x0001ffff, 0x0000ffff, 0x00007fff, | 131 0x000fffff, 0x0007ffff, 0x0003ffff, 0x0001ffff, 0x0000ffff, 0x00007fff, |
132 0x00003fff, 0x00001fff, 0x00000fff, 0x000007ff, 0x000003ff, 0x000001ff}; | 132 0x00003fff, 0x00001fff, 0x00000fff, 0x000007ff, 0x000003ff, 0x000001ff}; |
133 return std::vector<uint32_t>(&kValues[0], &kValues[arraysize(kValues)]); | 133 return std::vector<uint32_t>(&kValues[0], &kValues[arraysize(kValues)]); |
134 } | 134 } |
135 | 135 |
136 static const std::vector<double> nan_vector(size_t limit = 0) { | 136 static const std::vector<double> nan_vector(size_t limit = 0) { |
137 static const double nan = v8::base::OS::nan_value(); | 137 static const double nan = std::numeric_limits<double>::quiet_NaN(); |
138 static const double values[] = {-nan, -V8_INFINITY * -0.0, | 138 static const double values[] = {-nan, -V8_INFINITY * -0.0, |
139 -V8_INFINITY * 0.0, V8_INFINITY * -0.0, | 139 -V8_INFINITY * 0.0, V8_INFINITY * -0.0, |
140 V8_INFINITY * 0.0, nan}; | 140 V8_INFINITY * 0.0, nan}; |
141 return std::vector<double>(&values[0], &values[arraysize(values)]); | 141 return std::vector<double>(&values[0], &values[arraysize(values)]); |
142 } | 142 } |
143 | 143 |
144 static const std::vector<uint32_t> ror_vector() { | 144 static const std::vector<uint32_t> ror_vector() { |
145 static const uint32_t kValues[31] = { | 145 static const uint32_t kValues[31] = { |
146 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, | 146 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, |
147 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31}; | 147 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31}; |
(...skipping 15 matching lines...) Expand all Loading... |
163 | 163 |
164 #define FOR_INT32_SHIFTS(var) for (int32_t var = 0; var < 32; var++) | 164 #define FOR_INT32_SHIFTS(var) for (int32_t var = 0; var < 32; var++) |
165 | 165 |
166 #define FOR_UINT32_SHIFTS(var) for (uint32_t var = 0; var < 32; var++) | 166 #define FOR_UINT32_SHIFTS(var) for (uint32_t var = 0; var < 32; var++) |
167 | 167 |
168 } // namespace compiler | 168 } // namespace compiler |
169 } // namespace internal | 169 } // namespace internal |
170 } // namespace v8 | 170 } // namespace v8 |
171 | 171 |
172 #endif // V8_CCTEST_COMPILER_VALUE_HELPER_H_ | 172 #endif // V8_CCTEST_COMPILER_VALUE_HELPER_H_ |
OLD | NEW |