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/compiler/common-operator.h" | 8 #include "src/compiler/common-operator.h" |
9 #include "src/compiler/node.h" | 9 #include "src/compiler/node.h" |
10 #include "src/compiler/node-matchers.h" | 10 #include "src/compiler/node-matchers.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 | 52 |
53 void CheckTrue(Node* node) { | 53 void CheckTrue(Node* node) { |
54 CheckHeapConstant(isolate_->heap()->true_value(), node); | 54 CheckHeapConstant(isolate_->heap()->true_value(), node); |
55 } | 55 } |
56 | 56 |
57 void CheckFalse(Node* node) { | 57 void CheckFalse(Node* node) { |
58 CheckHeapConstant(isolate_->heap()->false_value(), node); | 58 CheckHeapConstant(isolate_->heap()->false_value(), node); |
59 } | 59 } |
60 | 60 |
61 static std::vector<float> float32_vector() { | 61 static std::vector<float> float32_vector() { |
62 static const float kValues[] = { | 62 static const float nan = std::numeric_limits<float>::quiet_NaN(); |
63 -std::numeric_limits<float>::infinity(), -2.70497e+38f, -1.4698e+37f, | 63 static const float kValues[] = {-std::numeric_limits<float>::infinity(), |
64 -1.22813e+35f, -1.20555e+35f, -1.34584e+34f, | 64 -2.70497e+38f, |
65 -1.0079e+32f, -6.49364e+26f, -3.06077e+25f, | 65 -1.4698e+37f, |
66 -1.46821e+25f, -1.17658e+23f, -1.9617e+22f, | 66 -1.22813e+35f, |
67 -2.7357e+20f, -1.48708e+13f, -1.89633e+12f, | 67 -1.20555e+35f, |
68 -4.66622e+11f, -2.22581e+11f, -1.45381e+10f, | 68 -1.34584e+34f, |
69 -1.3956e+09f, -1.32951e+09f, -1.30721e+09f, | 69 -1.0079e+32f, |
70 -1.19756e+09f, -9.26822e+08f, -6.35647e+08f, | 70 -6.49364e+26f, |
71 -4.00037e+08f, -1.81227e+08f, -5.09256e+07f, | 71 -3.06077e+25f, |
72 -964300.0f, -192446.0f, -28455.0f, | 72 -1.46821e+25f, |
73 -27194.0f, -26401.0f, -20575.0f, | 73 -1.17658e+23f, |
74 -17069.0f, -9167.0f, -960.178f, | 74 -1.9617e+22f, |
75 -113.0f, -62.0f, -15.0f, | 75 -2.7357e+20f, |
76 -7.0f, -0.0256635f, -4.60374e-07f, | 76 -1.48708e+13f, |
77 -3.63759e-10f, -4.30175e-14f, -5.27385e-15f, | 77 -1.89633e+12f, |
78 -1.48084e-15f, -1.05755e-19f, -3.2995e-21f, | 78 -4.66622e+11f, |
79 -1.67354e-23f, -1.11885e-23f, -1.78506e-30f, | 79 -2.22581e+11f, |
80 -5.07594e-31f, -3.65799e-31f, -1.43718e-34f, | 80 -1.45381e+10f, |
81 -1.27126e-38f, -0.0f, 0.0f, | 81 -1.3956e+09f, |
82 1.17549e-38f, 1.56657e-37f, 4.08512e-29f, | 82 -1.32951e+09f, |
83 3.31357e-28f, 6.25073e-22f, 4.1723e-13f, | 83 -1.30721e+09f, |
84 1.44343e-09f, 5.27004e-08f, 9.48298e-08f, | 84 -1.19756e+09f, |
85 5.57888e-07f, 4.89988e-05f, 0.244326f, | 85 -9.26822e+08f, |
86 12.4895f, 19.0f, 47.0f, | 86 -6.35647e+08f, |
87 106.0f, 538.324f, 564.536f, | 87 -4.00037e+08f, |
88 819.124f, 7048.0f, 12611.0f, | 88 -1.81227e+08f, |
89 19878.0f, 20309.0f, 797056.0f, | 89 -5.09256e+07f, |
90 1.77219e+09f, 1.51116e+11f, 4.18193e+13f, | 90 -964300.0f, |
91 3.59167e+16f, 3.38211e+19f, 2.67488e+20f, | 91 -192446.0f, |
92 1.78831e+21f, 9.20914e+21f, 8.35654e+23f, | 92 -28455.0f, |
93 1.4495e+24f, 5.94015e+25f, 4.43608e+30f, | 93 -27194.0f, |
94 2.44502e+33f, 2.61152e+33f, 1.38178e+37f, | 94 -26401.0f, |
95 1.71306e+37f, 3.31899e+38f, 3.40282e+38f, | 95 -20575.0f, |
96 std::numeric_limits<float>::infinity()}; | 96 -17069.0f, |
| 97 -9167.0f, |
| 98 -960.178f, |
| 99 -113.0f, |
| 100 -62.0f, |
| 101 -15.0f, |
| 102 -7.0f, |
| 103 -0.0256635f, |
| 104 -4.60374e-07f, |
| 105 -3.63759e-10f, |
| 106 -4.30175e-14f, |
| 107 -5.27385e-15f, |
| 108 -1.48084e-15f, |
| 109 -1.05755e-19f, |
| 110 -3.2995e-21f, |
| 111 -1.67354e-23f, |
| 112 -1.11885e-23f, |
| 113 -1.78506e-30f, |
| 114 -5.07594e-31f, |
| 115 -3.65799e-31f, |
| 116 -1.43718e-34f, |
| 117 -1.27126e-38f, |
| 118 -0.0f, |
| 119 0.0f, |
| 120 1.17549e-38f, |
| 121 1.56657e-37f, |
| 122 4.08512e-29f, |
| 123 3.31357e-28f, |
| 124 6.25073e-22f, |
| 125 4.1723e-13f, |
| 126 1.44343e-09f, |
| 127 5.27004e-08f, |
| 128 9.48298e-08f, |
| 129 5.57888e-07f, |
| 130 4.89988e-05f, |
| 131 0.244326f, |
| 132 12.4895f, |
| 133 19.0f, |
| 134 47.0f, |
| 135 106.0f, |
| 136 538.324f, |
| 137 564.536f, |
| 138 819.124f, |
| 139 7048.0f, |
| 140 12611.0f, |
| 141 19878.0f, |
| 142 20309.0f, |
| 143 797056.0f, |
| 144 1.77219e+09f, |
| 145 1.51116e+11f, |
| 146 4.18193e+13f, |
| 147 3.59167e+16f, |
| 148 3.38211e+19f, |
| 149 2.67488e+20f, |
| 150 1.78831e+21f, |
| 151 9.20914e+21f, |
| 152 8.35654e+23f, |
| 153 1.4495e+24f, |
| 154 5.94015e+25f, |
| 155 4.43608e+30f, |
| 156 2.44502e+33f, |
| 157 2.61152e+33f, |
| 158 1.38178e+37f, |
| 159 1.71306e+37f, |
| 160 3.31899e+38f, |
| 161 3.40282e+38f, |
| 162 std::numeric_limits<float>::infinity(), |
| 163 nan, |
| 164 -nan}; |
97 return std::vector<float>(&kValues[0], &kValues[arraysize(kValues)]); | 165 return std::vector<float>(&kValues[0], &kValues[arraysize(kValues)]); |
98 } | 166 } |
99 | 167 |
100 static std::vector<double> float64_vector() { | 168 static std::vector<double> float64_vector() { |
101 static const double nan = std::numeric_limits<double>::quiet_NaN(); | 169 static const double nan = std::numeric_limits<double>::quiet_NaN(); |
102 static const double values[] = {0.125, | 170 static const double values[] = {0.125, |
103 0.25, | 171 0.25, |
104 0.375, | 172 0.375, |
105 0.5, | 173 0.5, |
| 174 -0.5, |
106 1.25, | 175 1.25, |
107 -1.75, | 176 -1.75, |
108 2, | 177 2, |
109 5.125, | 178 5.125, |
110 6.25, | 179 6.25, |
111 0.0, | 180 0.0, |
112 -0.0, | 181 -0.0, |
113 982983.25, | 182 982983.25, |
114 888, | 183 888, |
115 2147483647.0, | 184 2147483647.0, |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 | 293 |
225 #define FOR_INT32_SHIFTS(var) for (int32_t var = 0; var < 32; var++) | 294 #define FOR_INT32_SHIFTS(var) for (int32_t var = 0; var < 32; var++) |
226 | 295 |
227 #define FOR_UINT32_SHIFTS(var) for (uint32_t var = 0; var < 32; var++) | 296 #define FOR_UINT32_SHIFTS(var) for (uint32_t var = 0; var < 32; var++) |
228 | 297 |
229 } // namespace compiler | 298 } // namespace compiler |
230 } // namespace internal | 299 } // namespace internal |
231 } // namespace v8 | 300 } // namespace v8 |
232 | 301 |
233 #endif // V8_CCTEST_COMPILER_VALUE_HELPER_H_ | 302 #endif // V8_CCTEST_COMPILER_VALUE_HELPER_H_ |
OLD | NEW |