| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 #include "src/compiler/int64-lowering.h" | 5 #include "src/compiler/int64-lowering.h" |
| 6 #include "src/compiler/common-operator.h" | 6 #include "src/compiler/common-operator.h" |
| 7 #include "src/compiler/linkage.h" | 7 #include "src/compiler/linkage.h" |
| 8 #include "src/compiler/machine-operator.h" | 8 #include "src/compiler/machine-operator.h" |
| 9 #include "src/compiler/node.h" | 9 #include "src/compiler/node.h" |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 using testing::AllOf; | 21 using testing::AllOf; |
| 22 using testing::Capture; | 22 using testing::Capture; |
| 23 using testing::CaptureEq; | 23 using testing::CaptureEq; |
| 24 | 24 |
| 25 namespace v8 { | 25 namespace v8 { |
| 26 namespace internal { | 26 namespace internal { |
| 27 namespace compiler { | 27 namespace compiler { |
| 28 | 28 |
| 29 class Int64LoweringTest : public GraphTest { | 29 class Int64LoweringTest : public GraphTest { |
| 30 public: | 30 public: |
| 31 Int64LoweringTest() : GraphTest(), machine_(zone()) { | 31 Int64LoweringTest() |
| 32 : GraphTest(), machine_(zone(), MachineRepresentation::kWord32) { |
| 32 value_[0] = 0x1234567890abcdef; | 33 value_[0] = 0x1234567890abcdef; |
| 33 value_[1] = 0x1edcba098765432f; | 34 value_[1] = 0x1edcba098765432f; |
| 34 value_[2] = 0x1133557799886644; | 35 value_[2] = 0x1133557799886644; |
| 35 } | 36 } |
| 36 | 37 |
| 37 MachineOperatorBuilder* machine() { return &machine_; } | 38 MachineOperatorBuilder* machine() { return &machine_; } |
| 38 | 39 |
| 39 void LowerGraph(Node* node, Signature<MachineRepresentation>* signature) { | 40 void LowerGraph(Node* node, Signature<MachineRepresentation>* signature) { |
| 40 Node* ret = graph()->NewNode(common()->Return(), node, graph()->start(), | 41 Node* ret = graph()->NewNode(common()->Return(), node, graph()->start(), |
| 41 graph()->start()); | 42 graph()->start()); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 IsInt32Constant(low_word_value(1))))), | 108 IsInt32Constant(low_word_value(1))))), |
| 108 start(), start())); | 109 start(), start())); |
| 109 } | 110 } |
| 110 | 111 |
| 111 private: | 112 private: |
| 112 MachineOperatorBuilder machine_; | 113 MachineOperatorBuilder machine_; |
| 113 int64_t value_[3]; | 114 int64_t value_[3]; |
| 114 }; | 115 }; |
| 115 | 116 |
| 116 TEST_F(Int64LoweringTest, Int64Constant) { | 117 TEST_F(Int64LoweringTest, Int64Constant) { |
| 117 if (4 != kPointerSize) return; | |
| 118 | |
| 119 LowerGraph(Int64Constant(value(0)), MachineRepresentation::kWord64); | 118 LowerGraph(Int64Constant(value(0)), MachineRepresentation::kWord64); |
| 120 EXPECT_THAT(graph()->end()->InputAt(1), | 119 EXPECT_THAT(graph()->end()->InputAt(1), |
| 121 IsReturn2(IsInt32Constant(low_word_value(0)), | 120 IsReturn2(IsInt32Constant(low_word_value(0)), |
| 122 IsInt32Constant(high_word_value(0)), start(), start())); | 121 IsInt32Constant(high_word_value(0)), start(), start())); |
| 123 } | 122 } |
| 124 | 123 |
| 125 TEST_F(Int64LoweringTest, Int64Load) { | 124 TEST_F(Int64LoweringTest, Int64Load) { |
| 126 if (4 != kPointerSize) return; | |
| 127 | |
| 128 int32_t base = 0x1234; | 125 int32_t base = 0x1234; |
| 129 int32_t index = 0x5678; | 126 int32_t index = 0x5678; |
| 130 | 127 |
| 131 LowerGraph(graph()->NewNode(machine()->Load(MachineType::Int64()), | 128 LowerGraph(graph()->NewNode(machine()->Load(MachineType::Int64()), |
| 132 Int32Constant(base), Int32Constant(index), | 129 Int32Constant(base), Int32Constant(index), |
| 133 start(), start()), | 130 start(), start()), |
| 134 MachineRepresentation::kWord64); | 131 MachineRepresentation::kWord64); |
| 135 | 132 |
| 136 Capture<Node*> high_word_load; | 133 Capture<Node*> high_word_load; |
| 137 Matcher<Node*> high_word_load_matcher = | 134 Matcher<Node*> high_word_load_matcher = |
| 138 IsLoad(MachineType::Int32(), IsInt32Constant(base), | 135 IsLoad(MachineType::Int32(), IsInt32Constant(base), |
| 139 IsInt32Add(IsInt32Constant(index), IsInt32Constant(0x4)), start(), | 136 IsInt32Add(IsInt32Constant(index), IsInt32Constant(0x4)), start(), |
| 140 start()); | 137 start()); |
| 141 | 138 |
| 142 EXPECT_THAT( | 139 EXPECT_THAT( |
| 143 graph()->end()->InputAt(1), | 140 graph()->end()->InputAt(1), |
| 144 IsReturn2(IsLoad(MachineType::Int32(), IsInt32Constant(base), | 141 IsReturn2(IsLoad(MachineType::Int32(), IsInt32Constant(base), |
| 145 IsInt32Constant(index), AllOf(CaptureEq(&high_word_load), | 142 IsInt32Constant(index), AllOf(CaptureEq(&high_word_load), |
| 146 high_word_load_matcher), | 143 high_word_load_matcher), |
| 147 start()), | 144 start()), |
| 148 AllOf(CaptureEq(&high_word_load), high_word_load_matcher), | 145 AllOf(CaptureEq(&high_word_load), high_word_load_matcher), |
| 149 start(), start())); | 146 start(), start())); |
| 150 } | 147 } |
| 151 | 148 |
| 152 TEST_F(Int64LoweringTest, Int64Store) { | 149 TEST_F(Int64LoweringTest, Int64Store) { |
| 153 if (4 != kPointerSize) return; | |
| 154 | |
| 155 // We have to build the TF graph explicitly here because Store does not return | 150 // We have to build the TF graph explicitly here because Store does not return |
| 156 // a value. | 151 // a value. |
| 157 | 152 |
| 158 int32_t base = 1111; | 153 int32_t base = 1111; |
| 159 int32_t index = 2222; | 154 int32_t index = 2222; |
| 160 int32_t return_value = 0x5555; | 155 int32_t return_value = 0x5555; |
| 161 | 156 |
| 162 Signature<MachineRepresentation>::Builder sig_builder(zone(), 1, 0); | 157 Signature<MachineRepresentation>::Builder sig_builder(zone(), 1, 0); |
| 163 sig_builder.AddReturn(MachineRepresentation::kWord32); | 158 sig_builder.AddReturn(MachineRepresentation::kWord32); |
| 164 | 159 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 188 rep, IsInt32Constant(base), IsInt32Constant(index), | 183 rep, IsInt32Constant(base), IsInt32Constant(index), |
| 189 IsInt32Constant(low_word_value(0)), | 184 IsInt32Constant(low_word_value(0)), |
| 190 IsStore(rep, IsInt32Constant(base), | 185 IsStore(rep, IsInt32Constant(base), |
| 191 IsInt32Add(IsInt32Constant(index), IsInt32Constant(4)), | 186 IsInt32Add(IsInt32Constant(index), IsInt32Constant(4)), |
| 192 IsInt32Constant(high_word_value(0)), start(), start()), | 187 IsInt32Constant(high_word_value(0)), start(), start()), |
| 193 start()), | 188 start()), |
| 194 start())); | 189 start())); |
| 195 } | 190 } |
| 196 | 191 |
| 197 TEST_F(Int64LoweringTest, Int64And) { | 192 TEST_F(Int64LoweringTest, Int64And) { |
| 198 if (4 != kPointerSize) return; | |
| 199 | |
| 200 LowerGraph(graph()->NewNode(machine()->Word64And(), Int64Constant(value(0)), | 193 LowerGraph(graph()->NewNode(machine()->Word64And(), Int64Constant(value(0)), |
| 201 Int64Constant(value(1))), | 194 Int64Constant(value(1))), |
| 202 MachineRepresentation::kWord64); | 195 MachineRepresentation::kWord64); |
| 203 EXPECT_THAT(graph()->end()->InputAt(1), | 196 EXPECT_THAT(graph()->end()->InputAt(1), |
| 204 IsReturn2(IsWord32And(IsInt32Constant(low_word_value(0)), | 197 IsReturn2(IsWord32And(IsInt32Constant(low_word_value(0)), |
| 205 IsInt32Constant(low_word_value(1))), | 198 IsInt32Constant(low_word_value(1))), |
| 206 IsWord32And(IsInt32Constant(high_word_value(0)), | 199 IsWord32And(IsInt32Constant(high_word_value(0)), |
| 207 IsInt32Constant(high_word_value(1))), | 200 IsInt32Constant(high_word_value(1))), |
| 208 start(), start())); | 201 start(), start())); |
| 209 } | 202 } |
| 210 | 203 |
| 211 TEST_F(Int64LoweringTest, TruncateInt64ToInt32) { | 204 TEST_F(Int64LoweringTest, TruncateInt64ToInt32) { |
| 212 if (4 != kPointerSize) return; | |
| 213 | |
| 214 LowerGraph(graph()->NewNode(machine()->TruncateInt64ToInt32(), | 205 LowerGraph(graph()->NewNode(machine()->TruncateInt64ToInt32(), |
| 215 Int64Constant(value(0))), | 206 Int64Constant(value(0))), |
| 216 MachineRepresentation::kWord32); | 207 MachineRepresentation::kWord32); |
| 217 EXPECT_THAT(graph()->end()->InputAt(1), | 208 EXPECT_THAT(graph()->end()->InputAt(1), |
| 218 IsReturn(IsInt32Constant(low_word_value(0)), start(), start())); | 209 IsReturn(IsInt32Constant(low_word_value(0)), start(), start())); |
| 219 } | 210 } |
| 220 | 211 |
| 221 TEST_F(Int64LoweringTest, Parameter) { | 212 TEST_F(Int64LoweringTest, Parameter) { |
| 222 if (4 != kPointerSize) return; | |
| 223 | |
| 224 LowerGraph(Parameter(0), MachineRepresentation::kWord64, | 213 LowerGraph(Parameter(0), MachineRepresentation::kWord64, |
| 225 MachineRepresentation::kWord64, 1); | 214 MachineRepresentation::kWord64, 1); |
| 226 | 215 |
| 227 EXPECT_THAT(graph()->end()->InputAt(1), | 216 EXPECT_THAT(graph()->end()->InputAt(1), |
| 228 IsReturn2(IsParameter(0), IsParameter(1), start(), start())); | 217 IsReturn2(IsParameter(0), IsParameter(1), start(), start())); |
| 229 } | 218 } |
| 230 | 219 |
| 231 TEST_F(Int64LoweringTest, Parameter2) { | 220 TEST_F(Int64LoweringTest, Parameter2) { |
| 232 if (4 != kPointerSize) return; | |
| 233 | |
| 234 Signature<MachineRepresentation>::Builder sig_builder(zone(), 1, 5); | 221 Signature<MachineRepresentation>::Builder sig_builder(zone(), 1, 5); |
| 235 sig_builder.AddReturn(MachineRepresentation::kWord32); | 222 sig_builder.AddReturn(MachineRepresentation::kWord32); |
| 236 | 223 |
| 237 sig_builder.AddParam(MachineRepresentation::kWord32); | 224 sig_builder.AddParam(MachineRepresentation::kWord32); |
| 238 sig_builder.AddParam(MachineRepresentation::kWord64); | 225 sig_builder.AddParam(MachineRepresentation::kWord64); |
| 239 sig_builder.AddParam(MachineRepresentation::kFloat64); | 226 sig_builder.AddParam(MachineRepresentation::kFloat64); |
| 240 sig_builder.AddParam(MachineRepresentation::kWord64); | 227 sig_builder.AddParam(MachineRepresentation::kWord64); |
| 241 sig_builder.AddParam(MachineRepresentation::kWord32); | 228 sig_builder.AddParam(MachineRepresentation::kWord32); |
| 242 | 229 |
| 243 int start_parameter = start()->op()->ValueOutputCount(); | 230 int start_parameter = start()->op()->ValueOutputCount(); |
| 244 LowerGraph(Parameter(4), sig_builder.Build()); | 231 LowerGraph(Parameter(4), sig_builder.Build()); |
| 245 | 232 |
| 246 EXPECT_THAT(graph()->end()->InputAt(1), | 233 EXPECT_THAT(graph()->end()->InputAt(1), |
| 247 IsReturn(IsParameter(6), start(), start())); | 234 IsReturn(IsParameter(6), start(), start())); |
| 248 // The parameter of the start node should increase by 2, because we lowered | 235 // The parameter of the start node should increase by 2, because we lowered |
| 249 // two parameter nodes. | 236 // two parameter nodes. |
| 250 EXPECT_THAT(start()->op()->ValueOutputCount(), start_parameter + 2); | 237 EXPECT_THAT(start()->op()->ValueOutputCount(), start_parameter + 2); |
| 251 } | 238 } |
| 252 | 239 |
| 253 TEST_F(Int64LoweringTest, CallI64Return) { | 240 TEST_F(Int64LoweringTest, CallI64Return) { |
| 254 if (4 != kPointerSize) return; | |
| 255 | |
| 256 int32_t function = 0x9999; | 241 int32_t function = 0x9999; |
| 257 | 242 |
| 258 Signature<MachineRepresentation>::Builder sig_builder(zone(), 1, 0); | 243 Signature<MachineRepresentation>::Builder sig_builder(zone(), 1, 0); |
| 259 sig_builder.AddReturn(MachineRepresentation::kWord64); | 244 sig_builder.AddReturn(MachineRepresentation::kWord64); |
| 260 | 245 |
| 261 compiler::CallDescriptor* desc = | 246 compiler::CallDescriptor* desc = |
| 262 wasm::ModuleEnv::GetWasmCallDescriptor(zone(), sig_builder.Build()); | 247 wasm::ModuleEnv::GetWasmCallDescriptor(zone(), sig_builder.Build()); |
| 263 | 248 |
| 264 LowerGraph(graph()->NewNode(common()->Call(desc), Int32Constant(function), | 249 LowerGraph(graph()->NewNode(common()->Call(desc), Int32Constant(function), |
| 265 start(), start()), | 250 start(), start()), |
| 266 MachineRepresentation::kWord64); | 251 MachineRepresentation::kWord64); |
| 267 | 252 |
| 268 Capture<Node*> call; | 253 Capture<Node*> call; |
| 269 Matcher<Node*> call_matcher = | 254 Matcher<Node*> call_matcher = |
| 270 IsCall(testing::_, IsInt32Constant(function), start(), start()); | 255 IsCall(testing::_, IsInt32Constant(function), start(), start()); |
| 271 | 256 |
| 272 EXPECT_THAT(graph()->end()->InputAt(1), | 257 EXPECT_THAT(graph()->end()->InputAt(1), |
| 273 IsReturn2(IsProjection(0, AllOf(CaptureEq(&call), call_matcher)), | 258 IsReturn2(IsProjection(0, AllOf(CaptureEq(&call), call_matcher)), |
| 274 IsProjection(1, AllOf(CaptureEq(&call), call_matcher)), | 259 IsProjection(1, AllOf(CaptureEq(&call), call_matcher)), |
| 275 start(), start())); | 260 start(), start())); |
| 276 | 261 |
| 277 CompareCallDescriptors( | 262 CompareCallDescriptors( |
| 278 OpParameter<const CallDescriptor*>( | 263 OpParameter<const CallDescriptor*>( |
| 279 graph()->end()->InputAt(1)->InputAt(0)->InputAt(0)), | 264 graph()->end()->InputAt(1)->InputAt(0)->InputAt(0)), |
| 280 wasm::ModuleEnv::GetI32WasmCallDescriptor(zone(), desc)); | 265 wasm::ModuleEnv::GetI32WasmCallDescriptor(zone(), desc)); |
| 281 } | 266 } |
| 282 | 267 |
| 283 TEST_F(Int64LoweringTest, CallI64Parameter) { | 268 TEST_F(Int64LoweringTest, CallI64Parameter) { |
| 284 if (4 != kPointerSize) return; | |
| 285 | |
| 286 int32_t function = 0x9999; | 269 int32_t function = 0x9999; |
| 287 | 270 |
| 288 Signature<MachineRepresentation>::Builder sig_builder(zone(), 1, 3); | 271 Signature<MachineRepresentation>::Builder sig_builder(zone(), 1, 3); |
| 289 sig_builder.AddReturn(MachineRepresentation::kWord32); | 272 sig_builder.AddReturn(MachineRepresentation::kWord32); |
| 290 sig_builder.AddParam(MachineRepresentation::kWord64); | 273 sig_builder.AddParam(MachineRepresentation::kWord64); |
| 291 sig_builder.AddParam(MachineRepresentation::kWord32); | 274 sig_builder.AddParam(MachineRepresentation::kWord32); |
| 292 sig_builder.AddParam(MachineRepresentation::kWord64); | 275 sig_builder.AddParam(MachineRepresentation::kWord64); |
| 293 | 276 |
| 294 compiler::CallDescriptor* desc = | 277 compiler::CallDescriptor* desc = |
| 295 wasm::ModuleEnv::GetWasmCallDescriptor(zone(), sig_builder.Build()); | 278 wasm::ModuleEnv::GetWasmCallDescriptor(zone(), sig_builder.Build()); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 321 // kExprI64Add: | 304 // kExprI64Add: |
| 322 // kExprI64Sub: | 305 // kExprI64Sub: |
| 323 // kExprI64Mul: | 306 // kExprI64Mul: |
| 324 // kExprI64DivS: | 307 // kExprI64DivS: |
| 325 // kExprI64DivU: | 308 // kExprI64DivU: |
| 326 // kExprI64RemS: | 309 // kExprI64RemS: |
| 327 // kExprI64RemU: | 310 // kExprI64RemU: |
| 328 // kExprI64And: | 311 // kExprI64And: |
| 329 // kExprI64Ior: | 312 // kExprI64Ior: |
| 330 TEST_F(Int64LoweringTest, Int64Ior) { | 313 TEST_F(Int64LoweringTest, Int64Ior) { |
| 331 if (4 != kPointerSize) return; | |
| 332 | |
| 333 LowerGraph(graph()->NewNode(machine()->Word64Or(), Int64Constant(value(0)), | 314 LowerGraph(graph()->NewNode(machine()->Word64Or(), Int64Constant(value(0)), |
| 334 Int64Constant(value(1))), | 315 Int64Constant(value(1))), |
| 335 MachineRepresentation::kWord64); | 316 MachineRepresentation::kWord64); |
| 336 EXPECT_THAT(graph()->end()->InputAt(1), | 317 EXPECT_THAT(graph()->end()->InputAt(1), |
| 337 IsReturn2(IsWord32Or(IsInt32Constant(low_word_value(0)), | 318 IsReturn2(IsWord32Or(IsInt32Constant(low_word_value(0)), |
| 338 IsInt32Constant(low_word_value(1))), | 319 IsInt32Constant(low_word_value(1))), |
| 339 IsWord32Or(IsInt32Constant(high_word_value(0)), | 320 IsWord32Or(IsInt32Constant(high_word_value(0)), |
| 340 IsInt32Constant(high_word_value(1))), | 321 IsInt32Constant(high_word_value(1))), |
| 341 start(), start())); | 322 start(), start())); |
| 342 } | 323 } |
| 343 | 324 |
| 344 // kExprI64Xor: | 325 // kExprI64Xor: |
| 345 TEST_F(Int64LoweringTest, Int64Xor) { | 326 TEST_F(Int64LoweringTest, Int64Xor) { |
| 346 if (4 != kPointerSize) return; | |
| 347 | |
| 348 LowerGraph(graph()->NewNode(machine()->Word64Xor(), Int64Constant(value(0)), | 327 LowerGraph(graph()->NewNode(machine()->Word64Xor(), Int64Constant(value(0)), |
| 349 Int64Constant(value(1))), | 328 Int64Constant(value(1))), |
| 350 MachineRepresentation::kWord64); | 329 MachineRepresentation::kWord64); |
| 351 EXPECT_THAT(graph()->end()->InputAt(1), | 330 EXPECT_THAT(graph()->end()->InputAt(1), |
| 352 IsReturn2(IsWord32Xor(IsInt32Constant(low_word_value(0)), | 331 IsReturn2(IsWord32Xor(IsInt32Constant(low_word_value(0)), |
| 353 IsInt32Constant(low_word_value(1))), | 332 IsInt32Constant(low_word_value(1))), |
| 354 IsWord32Xor(IsInt32Constant(high_word_value(0)), | 333 IsWord32Xor(IsInt32Constant(high_word_value(0)), |
| 355 IsInt32Constant(high_word_value(1))), | 334 IsInt32Constant(high_word_value(1))), |
| 356 start(), start())); | 335 start(), start())); |
| 357 } | 336 } |
| 358 // kExprI64Shl: | 337 // kExprI64Shl: |
| 359 TEST_F(Int64LoweringTest, Int64Shl) { | 338 TEST_F(Int64LoweringTest, Int64Shl) { |
| 360 if (4 != kPointerSize) return; | |
| 361 | |
| 362 LowerGraph(graph()->NewNode(machine()->Word64Shl(), Int64Constant(value(0)), | 339 LowerGraph(graph()->NewNode(machine()->Word64Shl(), Int64Constant(value(0)), |
| 363 Int64Constant(value(1))), | 340 Int64Constant(value(1))), |
| 364 MachineRepresentation::kWord64); | 341 MachineRepresentation::kWord64); |
| 365 | 342 |
| 366 Capture<Node*> shl; | 343 Capture<Node*> shl; |
| 367 Matcher<Node*> shl_matcher = IsWord32PairShl( | 344 Matcher<Node*> shl_matcher = IsWord32PairShl( |
| 368 IsInt32Constant(low_word_value(0)), IsInt32Constant(high_word_value(0)), | 345 IsInt32Constant(low_word_value(0)), IsInt32Constant(high_word_value(0)), |
| 369 IsInt32Constant(low_word_value(1))); | 346 IsInt32Constant(low_word_value(1))); |
| 370 | 347 |
| 371 EXPECT_THAT(graph()->end()->InputAt(1), | 348 EXPECT_THAT(graph()->end()->InputAt(1), |
| 372 IsReturn2(IsProjection(0, AllOf(CaptureEq(&shl), shl_matcher)), | 349 IsReturn2(IsProjection(0, AllOf(CaptureEq(&shl), shl_matcher)), |
| 373 IsProjection(1, AllOf(CaptureEq(&shl), shl_matcher)), | 350 IsProjection(1, AllOf(CaptureEq(&shl), shl_matcher)), |
| 374 start(), start())); | 351 start(), start())); |
| 375 } | 352 } |
| 376 // kExprI64ShrU: | 353 // kExprI64ShrU: |
| 377 // kExprI64ShrS: | 354 // kExprI64ShrS: |
| 378 // kExprI64Eq: | 355 // kExprI64Eq: |
| 379 TEST_F(Int64LoweringTest, Int64Eq) { | 356 TEST_F(Int64LoweringTest, Int64Eq) { |
| 380 if (4 != kPointerSize) return; | |
| 381 | |
| 382 LowerGraph(graph()->NewNode(machine()->Word64Equal(), Int64Constant(value(0)), | 357 LowerGraph(graph()->NewNode(machine()->Word64Equal(), Int64Constant(value(0)), |
| 383 Int64Constant(value(1))), | 358 Int64Constant(value(1))), |
| 384 MachineRepresentation::kWord32); | 359 MachineRepresentation::kWord32); |
| 385 EXPECT_THAT( | 360 EXPECT_THAT( |
| 386 graph()->end()->InputAt(1), | 361 graph()->end()->InputAt(1), |
| 387 IsReturn(IsWord32Equal( | 362 IsReturn(IsWord32Equal( |
| 388 IsWord32Or(IsWord32Xor(IsInt32Constant(low_word_value(0)), | 363 IsWord32Or(IsWord32Xor(IsInt32Constant(low_word_value(0)), |
| 389 IsInt32Constant(low_word_value(1))), | 364 IsInt32Constant(low_word_value(1))), |
| 390 IsWord32Xor(IsInt32Constant(high_word_value(0)), | 365 IsWord32Xor(IsInt32Constant(high_word_value(0)), |
| 391 IsInt32Constant(high_word_value(1)))), | 366 IsInt32Constant(high_word_value(1)))), |
| 392 IsInt32Constant(0)), | 367 IsInt32Constant(0)), |
| 393 start(), start())); | 368 start(), start())); |
| 394 } | 369 } |
| 395 | 370 |
| 396 // kExprI64Ne: | 371 // kExprI64Ne: |
| 397 // kExprI64LtS: | 372 // kExprI64LtS: |
| 398 TEST_F(Int64LoweringTest, Int64LtS) { | 373 TEST_F(Int64LoweringTest, Int64LtS) { |
| 399 if (4 != kPointerSize) return; | |
| 400 TestComparison(machine()->Int64LessThan(), IsInt32LessThan, IsUint32LessThan); | 374 TestComparison(machine()->Int64LessThan(), IsInt32LessThan, IsUint32LessThan); |
| 401 } | 375 } |
| 402 // kExprI64LeS: | 376 // kExprI64LeS: |
| 403 TEST_F(Int64LoweringTest, Int64LeS) { | 377 TEST_F(Int64LoweringTest, Int64LeS) { |
| 404 if (4 != kPointerSize) return; | |
| 405 TestComparison(machine()->Int64LessThanOrEqual(), IsInt32LessThan, | 378 TestComparison(machine()->Int64LessThanOrEqual(), IsInt32LessThan, |
| 406 IsUint32LessThanOrEqual); | 379 IsUint32LessThanOrEqual); |
| 407 } | 380 } |
| 408 // kExprI64LtU: | 381 // kExprI64LtU: |
| 409 TEST_F(Int64LoweringTest, Int64LtU) { | 382 TEST_F(Int64LoweringTest, Int64LtU) { |
| 410 if (4 != kPointerSize) return; | |
| 411 TestComparison(machine()->Uint64LessThan(), IsUint32LessThan, | 383 TestComparison(machine()->Uint64LessThan(), IsUint32LessThan, |
| 412 IsUint32LessThan); | 384 IsUint32LessThan); |
| 413 } | 385 } |
| 414 // kExprI64LeU: | 386 // kExprI64LeU: |
| 415 TEST_F(Int64LoweringTest, Int64LeU) { | 387 TEST_F(Int64LoweringTest, Int64LeU) { |
| 416 if (4 != kPointerSize) return; | |
| 417 TestComparison(machine()->Uint64LessThanOrEqual(), IsUint32LessThan, | 388 TestComparison(machine()->Uint64LessThanOrEqual(), IsUint32LessThan, |
| 418 IsUint32LessThanOrEqual); | 389 IsUint32LessThanOrEqual); |
| 419 } | 390 } |
| 420 | 391 |
| 421 // kExprI32ConvertI64: | 392 // kExprI32ConvertI64: |
| 422 // kExprI64SConvertI32: | 393 // kExprI64SConvertI32: |
| 423 // kExprI64UConvertI32: | 394 // kExprI64UConvertI32: |
| 424 | 395 |
| 425 // kExprF64ReinterpretI64: | 396 // kExprF64ReinterpretI64: |
| 426 // kExprI64ReinterpretF64: | 397 // kExprI64ReinterpretF64: |
| 427 | 398 |
| 428 // kExprI64Clz: | 399 // kExprI64Clz: |
| 429 // kExprI64Ctz: | 400 // kExprI64Ctz: |
| 430 // kExprI64Popcnt: | 401 // kExprI64Popcnt: |
| 431 | 402 |
| 432 // kExprF32SConvertI64: | 403 // kExprF32SConvertI64: |
| 433 // kExprF32UConvertI64: | 404 // kExprF32UConvertI64: |
| 434 // kExprF64SConvertI64: | 405 // kExprF64SConvertI64: |
| 435 // kExprF64UConvertI64: | 406 // kExprF64UConvertI64: |
| 436 // kExprI64SConvertF32: | 407 // kExprI64SConvertF32: |
| 437 // kExprI64SConvertF64: | 408 // kExprI64SConvertF64: |
| 438 // kExprI64UConvertF32: | 409 // kExprI64UConvertF32: |
| 439 // kExprI64UConvertF64: | 410 // kExprI64UConvertF64: |
| 440 | 411 |
| 441 } // namespace compiler | 412 } // namespace compiler |
| 442 } // namespace internal | 413 } // namespace internal |
| 443 } // namespace v8 | 414 } // namespace v8 |
| OLD | NEW |