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 #include "src/base/adapters.h" | 5 #include "src/base/adapters.h" |
6 #include "src/compiler/instruction-selector-impl.h" | 6 #include "src/compiler/instruction-selector-impl.h" |
7 #include "src/compiler/node-matchers.h" | 7 #include "src/compiler/node-matchers.h" |
8 #include "src/compiler/node-properties.h" | 8 #include "src/compiler/node-properties.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 opcode = load_rep.IsSigned() ? kX87Movsxwl : kX87Movzxwl; | 196 opcode = load_rep.IsSigned() ? kX87Movsxwl : kX87Movzxwl; |
197 break; | 197 break; |
198 case MachineRepresentation::kTaggedSigned: // Fall through. | 198 case MachineRepresentation::kTaggedSigned: // Fall through. |
199 case MachineRepresentation::kTaggedPointer: // Fall through. | 199 case MachineRepresentation::kTaggedPointer: // Fall through. |
200 case MachineRepresentation::kTagged: // Fall through. | 200 case MachineRepresentation::kTagged: // Fall through. |
201 case MachineRepresentation::kWord32: | 201 case MachineRepresentation::kWord32: |
202 opcode = kX87Movl; | 202 opcode = kX87Movl; |
203 break; | 203 break; |
204 case MachineRepresentation::kWord64: // Fall through. | 204 case MachineRepresentation::kWord64: // Fall through. |
205 case MachineRepresentation::kSimd128: // Fall through. | 205 case MachineRepresentation::kSimd128: // Fall through. |
206 case MachineRepresentation::kSimd1x4: // Fall through. | |
207 case MachineRepresentation::kSimd1x8: // Fall through. | |
208 case MachineRepresentation::kSimd1x16: // Fall through. | |
209 case MachineRepresentation::kNone: | 206 case MachineRepresentation::kNone: |
210 UNREACHABLE(); | 207 UNREACHABLE(); |
211 return; | 208 return; |
212 } | 209 } |
213 | 210 |
214 X87OperandGenerator g(this); | 211 X87OperandGenerator g(this); |
215 InstructionOperand outputs[1]; | 212 InstructionOperand outputs[1]; |
216 outputs[0] = g.DefineAsRegister(node); | 213 outputs[0] = g.DefineAsRegister(node); |
217 InstructionOperand inputs[3]; | 214 InstructionOperand inputs[3]; |
218 size_t input_count = 0; | 215 size_t input_count = 0; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 opcode = kX87Movw; | 286 opcode = kX87Movw; |
290 break; | 287 break; |
291 case MachineRepresentation::kTaggedSigned: // Fall through. | 288 case MachineRepresentation::kTaggedSigned: // Fall through. |
292 case MachineRepresentation::kTaggedPointer: // Fall through. | 289 case MachineRepresentation::kTaggedPointer: // Fall through. |
293 case MachineRepresentation::kTagged: // Fall through. | 290 case MachineRepresentation::kTagged: // Fall through. |
294 case MachineRepresentation::kWord32: | 291 case MachineRepresentation::kWord32: |
295 opcode = kX87Movl; | 292 opcode = kX87Movl; |
296 break; | 293 break; |
297 case MachineRepresentation::kWord64: // Fall through. | 294 case MachineRepresentation::kWord64: // Fall through. |
298 case MachineRepresentation::kSimd128: // Fall through. | 295 case MachineRepresentation::kSimd128: // Fall through. |
299 case MachineRepresentation::kSimd1x4: // Fall through. | |
300 case MachineRepresentation::kSimd1x8: // Fall through. | |
301 case MachineRepresentation::kSimd1x16: // Fall through. | |
302 case MachineRepresentation::kNone: | 296 case MachineRepresentation::kNone: |
303 UNREACHABLE(); | 297 UNREACHABLE(); |
304 return; | 298 return; |
305 } | 299 } |
306 | 300 |
307 InstructionOperand val; | 301 InstructionOperand val; |
308 if (g.CanBeImmediate(value)) { | 302 if (g.CanBeImmediate(value)) { |
309 val = g.UseImmediate(value); | 303 val = g.UseImmediate(value); |
310 } else if (rep == MachineRepresentation::kWord8 || | 304 } else if (rep == MachineRepresentation::kWord8 || |
311 rep == MachineRepresentation::kBit) { | 305 rep == MachineRepresentation::kBit) { |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 break; | 353 break; |
360 case MachineRepresentation::kFloat64: | 354 case MachineRepresentation::kFloat64: |
361 opcode = kCheckedLoadFloat64; | 355 opcode = kCheckedLoadFloat64; |
362 break; | 356 break; |
363 case MachineRepresentation::kBit: // Fall through. | 357 case MachineRepresentation::kBit: // Fall through. |
364 case MachineRepresentation::kTaggedSigned: // Fall through. | 358 case MachineRepresentation::kTaggedSigned: // Fall through. |
365 case MachineRepresentation::kTaggedPointer: // Fall through. | 359 case MachineRepresentation::kTaggedPointer: // Fall through. |
366 case MachineRepresentation::kTagged: // Fall through. | 360 case MachineRepresentation::kTagged: // Fall through. |
367 case MachineRepresentation::kWord64: // Fall through. | 361 case MachineRepresentation::kWord64: // Fall through. |
368 case MachineRepresentation::kSimd128: // Fall through. | 362 case MachineRepresentation::kSimd128: // Fall through. |
369 case MachineRepresentation::kSimd1x4: // Fall through. | |
370 case MachineRepresentation::kSimd1x8: // Fall through. | |
371 case MachineRepresentation::kSimd1x16: // Fall through. | |
372 case MachineRepresentation::kNone: | 363 case MachineRepresentation::kNone: |
373 UNREACHABLE(); | 364 UNREACHABLE(); |
374 return; | 365 return; |
375 } | 366 } |
376 InstructionOperand offset_operand = g.UseRegister(offset); | 367 InstructionOperand offset_operand = g.UseRegister(offset); |
377 InstructionOperand length_operand = | 368 InstructionOperand length_operand = |
378 g.CanBeImmediate(length) ? g.UseImmediate(length) : g.UseRegister(length); | 369 g.CanBeImmediate(length) ? g.UseImmediate(length) : g.UseRegister(length); |
379 if (g.CanBeImmediate(buffer)) { | 370 if (g.CanBeImmediate(buffer)) { |
380 Emit(opcode | AddressingModeField::encode(kMode_MRI), | 371 Emit(opcode | AddressingModeField::encode(kMode_MRI), |
381 g.DefineAsRegister(node), offset_operand, length_operand, | 372 g.DefineAsRegister(node), offset_operand, length_operand, |
(...skipping 29 matching lines...) Expand all Loading... |
411 break; | 402 break; |
412 case MachineRepresentation::kFloat64: | 403 case MachineRepresentation::kFloat64: |
413 opcode = kCheckedStoreFloat64; | 404 opcode = kCheckedStoreFloat64; |
414 break; | 405 break; |
415 case MachineRepresentation::kBit: // Fall through. | 406 case MachineRepresentation::kBit: // Fall through. |
416 case MachineRepresentation::kTaggedSigned: // Fall through. | 407 case MachineRepresentation::kTaggedSigned: // Fall through. |
417 case MachineRepresentation::kTaggedPointer: // Fall through. | 408 case MachineRepresentation::kTaggedPointer: // Fall through. |
418 case MachineRepresentation::kTagged: // Fall through. | 409 case MachineRepresentation::kTagged: // Fall through. |
419 case MachineRepresentation::kWord64: // Fall through. | 410 case MachineRepresentation::kWord64: // Fall through. |
420 case MachineRepresentation::kSimd128: // Fall through. | 411 case MachineRepresentation::kSimd128: // Fall through. |
421 case MachineRepresentation::kSimd1x4: // Fall through. | |
422 case MachineRepresentation::kSimd1x8: // Fall through. | |
423 case MachineRepresentation::kSimd1x16: // Fall through. | |
424 case MachineRepresentation::kNone: | 412 case MachineRepresentation::kNone: |
425 UNREACHABLE(); | 413 UNREACHABLE(); |
426 return; | 414 return; |
427 } | 415 } |
428 InstructionOperand value_operand = | 416 InstructionOperand value_operand = |
429 g.CanBeImmediate(value) ? g.UseImmediate(value) | 417 g.CanBeImmediate(value) ? g.UseImmediate(value) |
430 : ((rep == MachineRepresentation::kWord8 || | 418 : ((rep == MachineRepresentation::kWord8 || |
431 rep == MachineRepresentation::kBit) | 419 rep == MachineRepresentation::kBit) |
432 ? g.UseByteRegister(value) | 420 ? g.UseByteRegister(value) |
433 : g.UseRegister(value)); | 421 : g.UseRegister(value)); |
(...skipping 1438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1872 // static | 1860 // static |
1873 MachineOperatorBuilder::AlignmentRequirements | 1861 MachineOperatorBuilder::AlignmentRequirements |
1874 InstructionSelector::AlignmentRequirements() { | 1862 InstructionSelector::AlignmentRequirements() { |
1875 return MachineOperatorBuilder::AlignmentRequirements:: | 1863 return MachineOperatorBuilder::AlignmentRequirements:: |
1876 FullUnalignedAccessSupport(); | 1864 FullUnalignedAccessSupport(); |
1877 } | 1865 } |
1878 | 1866 |
1879 } // namespace compiler | 1867 } // namespace compiler |
1880 } // namespace internal | 1868 } // namespace internal |
1881 } // namespace v8 | 1869 } // namespace v8 |
OLD | NEW |