Lines Matching refs:node
22 bool CanBeImmediate(Node* node) { in CanBeImmediate() argument
23 switch (node->opcode()) { in CanBeImmediate()
27 const int64_t value = OpParameter<int64_t>(node); in CanBeImmediate()
31 const double value = OpParameter<double>(node); in CanBeImmediate()
104 bool CanBeBetterLeftOperand(Node* node) const { in CanBeBetterLeftOperand()
105 return !selector()->IsLive(node); in CanBeBetterLeftOperand()
110 void InstructionSelector::VisitLoad(Node* node) { in VisitLoad() argument
111 LoadRepresentation load_rep = LoadRepresentationOf(node->op()); in VisitLoad()
142 outputs[0] = g.DefineAsRegister(node); in VisitLoad()
146 g.GetEffectiveAddressMemoryOperand(node, inputs, &input_count); in VisitLoad()
152 void InstructionSelector::VisitStore(Node* node) { in VisitStore() argument
154 Node* base = node->InputAt(0); in VisitStore()
155 Node* index = node->InputAt(1); in VisitStore()
156 Node* value = node->InputAt(2); in VisitStore()
158 StoreRepresentation store_rep = StoreRepresentationOf(node->op()); in VisitStore()
229 g.GetEffectiveAddressMemoryOperand(node, inputs, &input_count); in VisitStore()
241 void InstructionSelector::VisitCheckedLoad(Node* node) { in VisitCheckedLoad() argument
242 CheckedLoadRepresentation load_rep = CheckedLoadRepresentationOf(node->op()); in VisitCheckedLoad()
244 Node* const buffer = node->InputAt(0); in VisitCheckedLoad()
245 Node* const offset = node->InputAt(1); in VisitCheckedLoad()
246 Node* const length = node->InputAt(2); in VisitCheckedLoad()
273 if (offset->opcode() == IrOpcode::kInt32Add && CanCover(node, offset)) { in VisitCheckedLoad()
279 Emit(opcode, g.DefineAsRegister(node), g.UseRegister(buffer), in VisitCheckedLoad()
280 g.UseRegister(moffset.left().node()), in VisitCheckedLoad()
281 g.UseImmediate(moffset.right().node()), g.UseImmediate(length)); in VisitCheckedLoad()
287 Emit(opcode, g.DefineAsRegister(node), g.UseRegister(buffer), in VisitCheckedLoad()
292 void InstructionSelector::VisitCheckedStore(Node* node) { in VisitCheckedStore() argument
293 MachineRepresentation rep = CheckedStoreRepresentationOf(node->op()); in VisitCheckedStore()
295 Node* const buffer = node->InputAt(0); in VisitCheckedStore()
296 Node* const offset = node->InputAt(1); in VisitCheckedStore()
297 Node* const length = node->InputAt(2); in VisitCheckedStore()
298 Node* const value = node->InputAt(3); in VisitCheckedStore()
327 if (offset->opcode() == IrOpcode::kInt32Add && CanCover(node, offset)) { in VisitCheckedStore()
334 g.UseRegister(moffset.left().node()), in VisitCheckedStore()
335 g.UseImmediate(moffset.right().node()), g.UseImmediate(length), in VisitCheckedStore()
348 static void VisitBinop(InstructionSelector* selector, Node* node, in VisitBinop() argument
351 Int32BinopMatcher m(node); in VisitBinop()
352 Node* left = m.left().node(); in VisitBinop()
353 Node* right = m.right().node(); in VisitBinop()
375 if (node->op()->HasProperty(Operator::kCommutative) && in VisitBinop()
388 outputs[output_count++] = g.DefineSameAsFirst(node); in VisitBinop()
404 static void VisitBinop(InstructionSelector* selector, Node* node, in VisitBinop() argument
407 VisitBinop(selector, node, opcode, &cont); in VisitBinop()
411 void InstructionSelector::VisitWord32And(Node* node) { in VisitWord32And() argument
413 Uint32BinopMatcher m(node); in VisitWord32And()
415 Emit(kX64Movzxbl, g.DefineAsRegister(node), g.Use(m.left().node())); in VisitWord32And()
417 Emit(kX64Movzxwl, g.DefineAsRegister(node), g.Use(m.left().node())); in VisitWord32And()
419 VisitBinop(this, node, kX64And32); in VisitWord32And()
424 void InstructionSelector::VisitWord64And(Node* node) { in VisitWord64And() argument
425 VisitBinop(this, node, kX64And); in VisitWord64And()
429 void InstructionSelector::VisitWord32Or(Node* node) { in VisitWord32Or() argument
430 VisitBinop(this, node, kX64Or32); in VisitWord32Or()
434 void InstructionSelector::VisitWord64Or(Node* node) { in VisitWord64Or() argument
435 VisitBinop(this, node, kX64Or); in VisitWord64Or()
439 void InstructionSelector::VisitWord32Xor(Node* node) { in VisitWord32Xor() argument
441 Uint32BinopMatcher m(node); in VisitWord32Xor()
443 Emit(kX64Not32, g.DefineSameAsFirst(node), g.UseRegister(m.left().node())); in VisitWord32Xor()
445 VisitBinop(this, node, kX64Xor32); in VisitWord32Xor()
450 void InstructionSelector::VisitWord64Xor(Node* node) { in VisitWord64Xor() argument
452 Uint64BinopMatcher m(node); in VisitWord64Xor()
454 Emit(kX64Not, g.DefineSameAsFirst(node), g.UseRegister(m.left().node())); in VisitWord64Xor()
456 VisitBinop(this, node, kX64Xor); in VisitWord64Xor()
465 void VisitWord32Shift(InstructionSelector* selector, Node* node, in VisitWord32Shift() argument
468 Int32BinopMatcher m(node); in VisitWord32Shift()
469 Node* left = m.left().node(); in VisitWord32Shift()
470 Node* right = m.right().node(); in VisitWord32Shift()
473 selector->Emit(opcode, g.DefineSameAsFirst(node), g.UseRegister(left), in VisitWord32Shift()
476 selector->Emit(opcode, g.DefineSameAsFirst(node), g.UseRegister(left), in VisitWord32Shift()
484 void VisitWord64Shift(InstructionSelector* selector, Node* node, in VisitWord64Shift() argument
487 Int64BinopMatcher m(node); in VisitWord64Shift()
488 Node* left = m.left().node(); in VisitWord64Shift()
489 Node* right = m.right().node(); in VisitWord64Shift()
492 selector->Emit(opcode, g.DefineSameAsFirst(node), g.UseRegister(left), in VisitWord64Shift()
498 right = mright.left().node(); in VisitWord64Shift()
501 selector->Emit(opcode, g.DefineSameAsFirst(node), g.UseRegister(left), in VisitWord64Shift()
531 void InstructionSelector::VisitWord32Shl(Node* node) { in VisitWord32Shl() argument
532 Int32ScaleMatcher m(node, true); in VisitWord32Shl()
534 Node* index = node->InputAt(0); in VisitWord32Shl()
536 EmitLea(this, kX64Lea32, node, index, m.scale(), base, nullptr); in VisitWord32Shl()
539 VisitWord32Shift(this, node, kX64Shl32); in VisitWord32Shl()
543 void InstructionSelector::VisitWord64Shl(Node* node) { in VisitWord64Shl() argument
545 Int64BinopMatcher m(node); in VisitWord64Shl()
550 Emit(kX64Shl, g.DefineSameAsFirst(node), in VisitWord64Shl()
551 g.UseRegister(m.left().node()->InputAt(0)), in VisitWord64Shl()
552 g.UseImmediate(m.right().node())); in VisitWord64Shl()
555 VisitWord64Shift(this, node, kX64Shl); in VisitWord64Shl()
559 void InstructionSelector::VisitWord32Shr(Node* node) { in VisitWord32Shr() argument
560 VisitWord32Shift(this, node, kX64Shr32); in VisitWord32Shr()
564 void InstructionSelector::VisitWord64Shr(Node* node) { in VisitWord64Shr() argument
565 VisitWord64Shift(this, node, kX64Shr); in VisitWord64Shr()
569 void InstructionSelector::VisitWord32Sar(Node* node) { in VisitWord32Sar() argument
571 Int32BinopMatcher m(node); in VisitWord32Sar()
572 if (CanCover(m.node(), m.left().node()) && m.left().IsWord32Shl()) { in VisitWord32Sar()
573 Int32BinopMatcher mleft(m.left().node()); in VisitWord32Sar()
575 Emit(kX64Movsxwl, g.DefineAsRegister(node), g.Use(mleft.left().node())); in VisitWord32Sar()
578 Emit(kX64Movsxbl, g.DefineAsRegister(node), g.Use(mleft.left().node())); in VisitWord32Sar()
582 VisitWord32Shift(this, node, kX64Sar32); in VisitWord32Sar()
586 void InstructionSelector::VisitWord64Sar(Node* node) { in VisitWord64Sar() argument
587 VisitWord64Shift(this, node, kX64Sar); in VisitWord64Sar()
591 void InstructionSelector::VisitWord32Ror(Node* node) { in VisitWord32Ror() argument
592 VisitWord32Shift(this, node, kX64Ror32); in VisitWord32Ror()
596 void InstructionSelector::VisitWord64Ror(Node* node) { in VisitWord64Ror() argument
597 VisitWord64Shift(this, node, kX64Ror); in VisitWord64Ror()
601 void InstructionSelector::VisitWord64Clz(Node* node) { in VisitWord64Clz() argument
603 Emit(kX64Lzcnt, g.DefineAsRegister(node), g.Use(node->InputAt(0))); in VisitWord64Clz()
607 void InstructionSelector::VisitWord32Clz(Node* node) { in VisitWord32Clz() argument
609 Emit(kX64Lzcnt32, g.DefineAsRegister(node), g.Use(node->InputAt(0))); in VisitWord32Clz()
613 void InstructionSelector::VisitWord64Ctz(Node* node) { in VisitWord64Ctz() argument
615 Emit(kX64Tzcnt, g.DefineAsRegister(node), g.Use(node->InputAt(0))); in VisitWord64Ctz()
619 void InstructionSelector::VisitWord32Ctz(Node* node) { in VisitWord32Ctz() argument
621 Emit(kX64Tzcnt32, g.DefineAsRegister(node), g.Use(node->InputAt(0))); in VisitWord32Ctz()
625 void InstructionSelector::VisitWord32Popcnt(Node* node) { in VisitWord32Popcnt() argument
627 Emit(kX64Popcnt32, g.DefineAsRegister(node), g.Use(node->InputAt(0))); in VisitWord32Popcnt()
631 void InstructionSelector::VisitWord64Popcnt(Node* node) { in VisitWord64Popcnt() argument
633 Emit(kX64Popcnt, g.DefineAsRegister(node), g.Use(node->InputAt(0))); in VisitWord64Popcnt()
637 void InstructionSelector::VisitInt32Add(Node* node) { in VisitInt32Add() argument
641 BaseWithIndexAndDisplacement32Matcher m(node); in VisitInt32Add()
644 EmitLea(this, kX64Lea32, node, m.index(), m.scale(), m.base(), in VisitInt32Add()
650 VisitBinop(this, node, kX64Add32); in VisitInt32Add()
654 void InstructionSelector::VisitInt64Add(Node* node) { in VisitInt64Add() argument
655 VisitBinop(this, node, kX64Add); in VisitInt64Add()
659 void InstructionSelector::VisitInt64AddWithOverflow(Node* node) { in VisitInt64AddWithOverflow() argument
660 if (Node* ovf = NodeProperties::FindProjection(node, 1)) { in VisitInt64AddWithOverflow()
662 VisitBinop(this, node, kX64Add, &cont); in VisitInt64AddWithOverflow()
665 VisitBinop(this, node, kX64Add, &cont); in VisitInt64AddWithOverflow()
669 void InstructionSelector::VisitInt32Sub(Node* node) { in VisitInt32Sub() argument
671 Int32BinopMatcher m(node); in VisitInt32Sub()
673 Emit(kX64Neg32, g.DefineSameAsFirst(node), g.UseRegister(m.right().node())); in VisitInt32Sub()
675 if (m.right().HasValue() && g.CanBeImmediate(m.right().node())) { in VisitInt32Sub()
679 g.DefineAsRegister(node), g.UseRegister(m.left().node()), in VisitInt32Sub()
683 VisitBinop(this, node, kX64Sub32); in VisitInt32Sub()
688 void InstructionSelector::VisitInt64Sub(Node* node) { in VisitInt64Sub() argument
690 Int64BinopMatcher m(node); in VisitInt64Sub()
692 Emit(kX64Neg, g.DefineSameAsFirst(node), g.UseRegister(m.right().node())); in VisitInt64Sub()
694 VisitBinop(this, node, kX64Sub); in VisitInt64Sub()
699 void InstructionSelector::VisitInt64SubWithOverflow(Node* node) { in VisitInt64SubWithOverflow() argument
700 if (Node* ovf = NodeProperties::FindProjection(node, 1)) { in VisitInt64SubWithOverflow()
702 return VisitBinop(this, node, kX64Sub, &cont); in VisitInt64SubWithOverflow()
705 VisitBinop(this, node, kX64Sub, &cont); in VisitInt64SubWithOverflow()
711 void VisitMul(InstructionSelector* selector, Node* node, ArchOpcode opcode) { in VisitMul() argument
713 Int32BinopMatcher m(node); in VisitMul()
714 Node* left = m.left().node(); in VisitMul()
715 Node* right = m.right().node(); in VisitMul()
717 selector->Emit(opcode, g.DefineAsRegister(node), g.Use(left), in VisitMul()
723 selector->Emit(opcode, g.DefineSameAsFirst(node), g.UseRegister(left), in VisitMul()
729 void VisitMulHigh(InstructionSelector* selector, Node* node, in VisitMulHigh() argument
732 Node* left = node->InputAt(0); in VisitMulHigh()
733 Node* right = node->InputAt(1); in VisitMulHigh()
739 selector->Emit(opcode, g.DefineAsFixed(node, rdx), g.UseFixed(left, rax), in VisitMulHigh()
744 void VisitDiv(InstructionSelector* selector, Node* node, ArchOpcode opcode) { in VisitDiv() argument
748 opcode, g.DefineAsFixed(node, rax), g.UseFixed(node->InputAt(0), rax), in VisitDiv()
749 g.UseUniqueRegister(node->InputAt(1)), arraysize(temps), temps); in VisitDiv()
753 void VisitMod(InstructionSelector* selector, Node* node, ArchOpcode opcode) { in VisitMod() argument
755 selector->Emit(opcode, g.DefineAsFixed(node, rdx), in VisitMod()
756 g.UseFixed(node->InputAt(0), rax), in VisitMod()
757 g.UseUniqueRegister(node->InputAt(1))); in VisitMod()
763 void InstructionSelector::VisitInt32Mul(Node* node) { in VisitInt32Mul() argument
764 Int32ScaleMatcher m(node, true); in VisitInt32Mul()
766 Node* index = node->InputAt(0); in VisitInt32Mul()
768 EmitLea(this, kX64Lea32, node, index, m.scale(), base, nullptr); in VisitInt32Mul()
771 VisitMul(this, node, kX64Imul32); in VisitInt32Mul()
775 void InstructionSelector::VisitInt64Mul(Node* node) { in VisitInt64Mul() argument
776 VisitMul(this, node, kX64Imul); in VisitInt64Mul()
780 void InstructionSelector::VisitInt32MulHigh(Node* node) { in VisitInt32MulHigh() argument
781 VisitMulHigh(this, node, kX64ImulHigh32); in VisitInt32MulHigh()
785 void InstructionSelector::VisitInt32Div(Node* node) { in VisitInt32Div() argument
786 VisitDiv(this, node, kX64Idiv32); in VisitInt32Div()
790 void InstructionSelector::VisitInt64Div(Node* node) { in VisitInt64Div() argument
791 VisitDiv(this, node, kX64Idiv); in VisitInt64Div()
795 void InstructionSelector::VisitUint32Div(Node* node) { in VisitUint32Div() argument
796 VisitDiv(this, node, kX64Udiv32); in VisitUint32Div()
800 void InstructionSelector::VisitUint64Div(Node* node) { in VisitUint64Div() argument
801 VisitDiv(this, node, kX64Udiv); in VisitUint64Div()
805 void InstructionSelector::VisitInt32Mod(Node* node) { in VisitInt32Mod() argument
806 VisitMod(this, node, kX64Idiv32); in VisitInt32Mod()
810 void InstructionSelector::VisitInt64Mod(Node* node) { in VisitInt64Mod() argument
811 VisitMod(this, node, kX64Idiv); in VisitInt64Mod()
815 void InstructionSelector::VisitUint32Mod(Node* node) { in VisitUint32Mod() argument
816 VisitMod(this, node, kX64Udiv32); in VisitUint32Mod()
820 void InstructionSelector::VisitUint64Mod(Node* node) { in VisitUint64Mod() argument
821 VisitMod(this, node, kX64Udiv); in VisitUint64Mod()
825 void InstructionSelector::VisitUint32MulHigh(Node* node) { in VisitUint32MulHigh() argument
826 VisitMulHigh(this, node, kX64UmulHigh32); in VisitUint32MulHigh()
830 void InstructionSelector::VisitChangeFloat32ToFloat64(Node* node) { in VisitChangeFloat32ToFloat64() argument
832 Emit(kSSEFloat32ToFloat64, g.DefineAsRegister(node), g.Use(node->InputAt(0))); in VisitChangeFloat32ToFloat64()
836 void InstructionSelector::VisitChangeInt32ToFloat64(Node* node) { in VisitChangeInt32ToFloat64() argument
838 Emit(kSSEInt32ToFloat64, g.DefineAsRegister(node), g.Use(node->InputAt(0))); in VisitChangeInt32ToFloat64()
842 void InstructionSelector::VisitChangeUint32ToFloat64(Node* node) { in VisitChangeUint32ToFloat64() argument
844 Emit(kSSEUint32ToFloat64, g.DefineAsRegister(node), g.Use(node->InputAt(0))); in VisitChangeUint32ToFloat64()
848 void InstructionSelector::VisitChangeFloat64ToInt32(Node* node) { in VisitChangeFloat64ToInt32() argument
850 Emit(kSSEFloat64ToInt32, g.DefineAsRegister(node), g.Use(node->InputAt(0))); in VisitChangeFloat64ToInt32()
854 void InstructionSelector::VisitChangeFloat64ToUint32(Node* node) { in VisitChangeFloat64ToUint32() argument
856 Emit(kSSEFloat64ToUint32, g.DefineAsRegister(node), g.Use(node->InputAt(0))); in VisitChangeFloat64ToUint32()
860 void InstructionSelector::VisitTryTruncateFloat32ToInt64(Node* node) { in VisitTryTruncateFloat32ToInt64() argument
862 InstructionOperand inputs[] = {g.UseRegister(node->InputAt(0))}; in VisitTryTruncateFloat32ToInt64()
865 outputs[output_count++] = g.DefineAsRegister(node); in VisitTryTruncateFloat32ToInt64()
867 Node* success_output = NodeProperties::FindProjection(node, 1); in VisitTryTruncateFloat32ToInt64()
876 void InstructionSelector::VisitTryTruncateFloat64ToInt64(Node* node) { in VisitTryTruncateFloat64ToInt64() argument
878 InstructionOperand inputs[] = {g.UseRegister(node->InputAt(0))}; in VisitTryTruncateFloat64ToInt64()
881 outputs[output_count++] = g.DefineAsRegister(node); in VisitTryTruncateFloat64ToInt64()
883 Node* success_output = NodeProperties::FindProjection(node, 1); in VisitTryTruncateFloat64ToInt64()
892 void InstructionSelector::VisitTryTruncateFloat32ToUint64(Node* node) { in VisitTryTruncateFloat32ToUint64() argument
894 InstructionOperand inputs[] = {g.UseRegister(node->InputAt(0))}; in VisitTryTruncateFloat32ToUint64()
897 outputs[output_count++] = g.DefineAsRegister(node); in VisitTryTruncateFloat32ToUint64()
899 Node* success_output = NodeProperties::FindProjection(node, 1); in VisitTryTruncateFloat32ToUint64()
908 void InstructionSelector::VisitTryTruncateFloat64ToUint64(Node* node) { in VisitTryTruncateFloat64ToUint64() argument
910 InstructionOperand inputs[] = {g.UseRegister(node->InputAt(0))}; in VisitTryTruncateFloat64ToUint64()
913 outputs[output_count++] = g.DefineAsRegister(node); in VisitTryTruncateFloat64ToUint64()
915 Node* success_output = NodeProperties::FindProjection(node, 1); in VisitTryTruncateFloat64ToUint64()
924 void InstructionSelector::VisitChangeInt32ToInt64(Node* node) { in VisitChangeInt32ToInt64() argument
926 Emit(kX64Movsxlq, g.DefineAsRegister(node), g.Use(node->InputAt(0))); in VisitChangeInt32ToInt64()
930 void InstructionSelector::VisitChangeUint32ToUint64(Node* node) { in VisitChangeUint32ToUint64() argument
932 Node* value = node->InputAt(0); in VisitChangeUint32ToUint64()
957 Emit(kArchNop, g.DefineSameAsFirst(node), g.Use(value)); in VisitChangeUint32ToUint64()
963 Emit(kX64Movl, g.DefineAsRegister(node), g.Use(value)); in VisitChangeUint32ToUint64()
969 void VisitRO(InstructionSelector* selector, Node* node, in VisitRO() argument
972 selector->Emit(opcode, g.DefineAsRegister(node), g.Use(node->InputAt(0))); in VisitRO()
976 void VisitRR(InstructionSelector* selector, Node* node, in VisitRR() argument
979 selector->Emit(opcode, g.DefineAsRegister(node), in VisitRR()
980 g.UseRegister(node->InputAt(0))); in VisitRR()
984 void VisitFloatBinop(InstructionSelector* selector, Node* node, in VisitFloatBinop() argument
987 InstructionOperand operand0 = g.UseRegister(node->InputAt(0)); in VisitFloatBinop()
988 InstructionOperand operand1 = g.Use(node->InputAt(1)); in VisitFloatBinop()
990 selector->Emit(avx_opcode, g.DefineAsRegister(node), operand0, operand1); in VisitFloatBinop()
992 selector->Emit(sse_opcode, g.DefineSameAsFirst(node), operand0, operand1); in VisitFloatBinop()
997 void VisitFloatUnop(InstructionSelector* selector, Node* node, Node* input, in VisitFloatUnop() argument
1001 selector->Emit(avx_opcode, g.DefineAsRegister(node), g.Use(input)); in VisitFloatUnop()
1003 selector->Emit(sse_opcode, g.DefineSameAsFirst(node), g.UseRegister(input)); in VisitFloatUnop()
1010 void InstructionSelector::VisitTruncateFloat64ToFloat32(Node* node) { in VisitTruncateFloat64ToFloat32() argument
1011 VisitRO(this, node, kSSEFloat64ToFloat32); in VisitTruncateFloat64ToFloat32()
1015 void InstructionSelector::VisitTruncateFloat64ToInt32(Node* node) { in VisitTruncateFloat64ToInt32() argument
1016 switch (TruncationModeOf(node->op())) { in VisitTruncateFloat64ToInt32()
1018 return VisitRR(this, node, kArchTruncateDoubleToI); in VisitTruncateFloat64ToInt32()
1020 return VisitRO(this, node, kSSEFloat64ToInt32); in VisitTruncateFloat64ToInt32()
1026 void InstructionSelector::VisitTruncateInt64ToInt32(Node* node) { in VisitTruncateInt64ToInt32() argument
1028 Node* value = node->InputAt(0); in VisitTruncateInt64ToInt32()
1029 if (CanCover(node, value)) { in VisitTruncateInt64ToInt32()
1035 Emit(kX64Shr, g.DefineSameAsFirst(node), in VisitTruncateInt64ToInt32()
1036 g.UseRegister(m.left().node()), g.TempImmediate(32)); in VisitTruncateInt64ToInt32()
1045 Emit(kX64Movl, g.DefineAsRegister(node), g.Use(value)); in VisitTruncateInt64ToInt32()
1049 void InstructionSelector::VisitRoundInt64ToFloat32(Node* node) { in VisitRoundInt64ToFloat32() argument
1051 Emit(kSSEInt64ToFloat32, g.DefineAsRegister(node), g.Use(node->InputAt(0))); in VisitRoundInt64ToFloat32()
1055 void InstructionSelector::VisitRoundInt64ToFloat64(Node* node) { in VisitRoundInt64ToFloat64() argument
1057 Emit(kSSEInt64ToFloat64, g.DefineAsRegister(node), g.Use(node->InputAt(0))); in VisitRoundInt64ToFloat64()
1061 void InstructionSelector::VisitRoundUint64ToFloat32(Node* node) { in VisitRoundUint64ToFloat32() argument
1064 Emit(kSSEUint64ToFloat32, g.DefineAsRegister(node), g.Use(node->InputAt(0)), in VisitRoundUint64ToFloat32()
1069 void InstructionSelector::VisitRoundUint64ToFloat64(Node* node) { in VisitRoundUint64ToFloat64() argument
1072 Emit(kSSEUint64ToFloat64, g.DefineAsRegister(node), g.Use(node->InputAt(0)), in VisitRoundUint64ToFloat64()
1077 void InstructionSelector::VisitBitcastFloat32ToInt32(Node* node) { in VisitBitcastFloat32ToInt32() argument
1079 Emit(kX64BitcastFI, g.DefineAsRegister(node), g.Use(node->InputAt(0))); in VisitBitcastFloat32ToInt32()
1083 void InstructionSelector::VisitBitcastFloat64ToInt64(Node* node) { in VisitBitcastFloat64ToInt64() argument
1085 Emit(kX64BitcastDL, g.DefineAsRegister(node), g.Use(node->InputAt(0))); in VisitBitcastFloat64ToInt64()
1089 void InstructionSelector::VisitBitcastInt32ToFloat32(Node* node) { in VisitBitcastInt32ToFloat32() argument
1091 Emit(kX64BitcastIF, g.DefineAsRegister(node), g.Use(node->InputAt(0))); in VisitBitcastInt32ToFloat32()
1095 void InstructionSelector::VisitBitcastInt64ToFloat64(Node* node) { in VisitBitcastInt64ToFloat64() argument
1097 Emit(kX64BitcastLD, g.DefineAsRegister(node), g.Use(node->InputAt(0))); in VisitBitcastInt64ToFloat64()
1101 void InstructionSelector::VisitFloat32Add(Node* node) { in VisitFloat32Add() argument
1102 VisitFloatBinop(this, node, kAVXFloat32Add, kSSEFloat32Add); in VisitFloat32Add()
1106 void InstructionSelector::VisitFloat32Sub(Node* node) { in VisitFloat32Sub() argument
1108 Float32BinopMatcher m(node); in VisitFloat32Sub()
1110 VisitFloatUnop(this, node, m.right().node(), kAVXFloat32Neg, in VisitFloat32Sub()
1114 VisitFloatBinop(this, node, kAVXFloat32Sub, kSSEFloat32Sub); in VisitFloat32Sub()
1118 void InstructionSelector::VisitFloat32Mul(Node* node) { in VisitFloat32Mul() argument
1119 VisitFloatBinop(this, node, kAVXFloat32Mul, kSSEFloat32Mul); in VisitFloat32Mul()
1123 void InstructionSelector::VisitFloat32Div(Node* node) { in VisitFloat32Div() argument
1124 VisitFloatBinop(this, node, kAVXFloat32Div, kSSEFloat32Div); in VisitFloat32Div()
1128 void InstructionSelector::VisitFloat32Max(Node* node) { in VisitFloat32Max() argument
1129 VisitFloatBinop(this, node, kAVXFloat32Max, kSSEFloat32Max); in VisitFloat32Max()
1133 void InstructionSelector::VisitFloat32Min(Node* node) { in VisitFloat32Min() argument
1134 VisitFloatBinop(this, node, kAVXFloat32Min, kSSEFloat32Min); in VisitFloat32Min()
1138 void InstructionSelector::VisitFloat32Abs(Node* node) { in VisitFloat32Abs() argument
1139 VisitFloatUnop(this, node, node->InputAt(0), kAVXFloat32Abs, kSSEFloat32Abs); in VisitFloat32Abs()
1143 void InstructionSelector::VisitFloat32Sqrt(Node* node) { in VisitFloat32Sqrt() argument
1144 VisitRO(this, node, kSSEFloat32Sqrt); in VisitFloat32Sqrt()
1148 void InstructionSelector::VisitFloat64Add(Node* node) { in VisitFloat64Add() argument
1149 VisitFloatBinop(this, node, kAVXFloat64Add, kSSEFloat64Add); in VisitFloat64Add()
1153 void InstructionSelector::VisitFloat64Sub(Node* node) { in VisitFloat64Sub() argument
1155 Float64BinopMatcher m(node); in VisitFloat64Sub()
1158 CanCover(m.node(), m.right().node())) { in VisitFloat64Sub()
1160 CanCover(m.right().node(), m.right().InputAt(0))) { in VisitFloat64Sub()
1164 g.DefineAsRegister(node), g.UseRegister(mright0.right().node())); in VisitFloat64Sub()
1169 VisitFloatUnop(this, node, m.right().node(), kAVXFloat64Neg, in VisitFloat64Sub()
1173 VisitFloatBinop(this, node, kAVXFloat64Sub, kSSEFloat64Sub); in VisitFloat64Sub()
1177 void InstructionSelector::VisitFloat64Mul(Node* node) { in VisitFloat64Mul() argument
1178 VisitFloatBinop(this, node, kAVXFloat64Mul, kSSEFloat64Mul); in VisitFloat64Mul()
1182 void InstructionSelector::VisitFloat64Div(Node* node) { in VisitFloat64Div() argument
1183 VisitFloatBinop(this, node, kAVXFloat64Div, kSSEFloat64Div); in VisitFloat64Div()
1187 void InstructionSelector::VisitFloat64Mod(Node* node) { in VisitFloat64Mod() argument
1190 Emit(kSSEFloat64Mod, g.DefineSameAsFirst(node), in VisitFloat64Mod()
1191 g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1)), 1, in VisitFloat64Mod()
1196 void InstructionSelector::VisitFloat64Max(Node* node) { in VisitFloat64Max() argument
1197 VisitFloatBinop(this, node, kAVXFloat64Max, kSSEFloat64Max); in VisitFloat64Max()
1201 void InstructionSelector::VisitFloat64Min(Node* node) { in VisitFloat64Min() argument
1202 VisitFloatBinop(this, node, kAVXFloat64Min, kSSEFloat64Min); in VisitFloat64Min()
1206 void InstructionSelector::VisitFloat64Abs(Node* node) { in VisitFloat64Abs() argument
1207 VisitFloatUnop(this, node, node->InputAt(0), kAVXFloat64Abs, kSSEFloat64Abs); in VisitFloat64Abs()
1211 void InstructionSelector::VisitFloat64Sqrt(Node* node) { in VisitFloat64Sqrt() argument
1212 VisitRO(this, node, kSSEFloat64Sqrt); in VisitFloat64Sqrt()
1216 void InstructionSelector::VisitFloat32RoundDown(Node* node) { in VisitFloat32RoundDown() argument
1217 VisitRR(this, node, kSSEFloat32Round | MiscField::encode(kRoundDown)); in VisitFloat32RoundDown()
1221 void InstructionSelector::VisitFloat64RoundDown(Node* node) { in VisitFloat64RoundDown() argument
1222 VisitRR(this, node, kSSEFloat64Round | MiscField::encode(kRoundDown)); in VisitFloat64RoundDown()
1226 void InstructionSelector::VisitFloat32RoundUp(Node* node) { in VisitFloat32RoundUp() argument
1227 VisitRR(this, node, kSSEFloat32Round | MiscField::encode(kRoundUp)); in VisitFloat32RoundUp()
1231 void InstructionSelector::VisitFloat64RoundUp(Node* node) { in VisitFloat64RoundUp() argument
1232 VisitRR(this, node, kSSEFloat64Round | MiscField::encode(kRoundUp)); in VisitFloat64RoundUp()
1236 void InstructionSelector::VisitFloat32RoundTruncate(Node* node) { in VisitFloat32RoundTruncate() argument
1237 VisitRR(this, node, kSSEFloat32Round | MiscField::encode(kRoundToZero)); in VisitFloat32RoundTruncate()
1241 void InstructionSelector::VisitFloat64RoundTruncate(Node* node) { in VisitFloat64RoundTruncate() argument
1242 VisitRR(this, node, kSSEFloat64Round | MiscField::encode(kRoundToZero)); in VisitFloat64RoundTruncate()
1246 void InstructionSelector::VisitFloat64RoundTiesAway(Node* node) { in VisitFloat64RoundTiesAway() argument
1251 void InstructionSelector::VisitFloat32RoundTiesEven(Node* node) { in VisitFloat32RoundTiesEven() argument
1252 VisitRR(this, node, kSSEFloat32Round | MiscField::encode(kRoundToNearest)); in VisitFloat32RoundTiesEven()
1256 void InstructionSelector::VisitFloat64RoundTiesEven(Node* node) { in VisitFloat64RoundTiesEven() argument
1257 VisitRR(this, node, kSSEFloat64Round | MiscField::encode(kRoundToNearest)); in VisitFloat64RoundTiesEven()
1263 Node* node) { in EmitPrepareArguments() argument
1275 if (input.node()) { in EmitPrepareArguments()
1277 InstructionOperand value = g.CanBeImmediate(input.node()) in EmitPrepareArguments()
1278 ? g.UseImmediate(input.node()) in EmitPrepareArguments()
1279 : g.UseRegister(input.node()); in EmitPrepareArguments()
1289 g.CanBeImmediate(input.node()) in EmitPrepareArguments()
1290 ? g.UseImmediate(input.node()) in EmitPrepareArguments()
1292 sequence()->IsFloat(GetVirtualRegister(input.node())) in EmitPrepareArguments()
1293 ? g.UseRegister(input.node()) in EmitPrepareArguments()
1294 : g.Use(input.node()); in EmitPrepareArguments()
1335 void VisitWordCompare(InstructionSelector* selector, Node* node, in VisitWordCompare() argument
1338 Node* const left = node->InputAt(0); in VisitWordCompare()
1339 Node* const right = node->InputAt(1); in VisitWordCompare()
1345 if (!node->op()->HasProperty(Operator::kCommutative)) cont->Commute(); in VisitWordCompare()
1349 node->op()->HasProperty(Operator::kCommutative)); in VisitWordCompare()
1355 void VisitWord64Compare(InstructionSelector* selector, Node* node, in VisitWord64Compare() argument
1358 Int64BinopMatcher m(node); in VisitWord64Compare()
1360 LoadMatcher<ExternalReferenceMatcher> mleft(m.left().node()); in VisitWord64Compare()
1365 if (!node->op()->HasProperty(Operator::kCommutative)) cont->Commute(); in VisitWord64Compare()
1377 VisitWordCompare(selector, node, kX64Cmp, cont); in VisitWord64Compare()
1382 void VisitCompareZero(InstructionSelector* selector, Node* node, in VisitCompareZero() argument
1385 VisitCompare(selector, opcode, g.Use(node), g.TempImmediate(0), cont); in VisitCompareZero()
1390 void VisitFloat32Compare(InstructionSelector* selector, Node* node, in VisitFloat32Compare() argument
1392 Node* const left = node->InputAt(0); in VisitFloat32Compare()
1393 Node* const right = node->InputAt(1); in VisitFloat32Compare()
1401 void VisitFloat64Compare(InstructionSelector* selector, Node* node, in VisitFloat64Compare() argument
1403 Node* const left = node->InputAt(0); in VisitFloat64Compare()
1404 Node* const right = node->InputAt(1); in VisitFloat64Compare()
1426 value = m.left().node(); in VisitBranch()
1456 Node* const user = m.node(); in VisitBranch()
1457 Node* const value = m.left().node(); in VisitBranch()
1511 Node* const node = value->InputAt(0); in VisitBranch() local
1512 Node* const result = NodeProperties::FindProjection(node, 0); in VisitBranch()
1514 switch (node->opcode()) { in VisitBranch()
1517 return VisitBinop(this, node, kX64Add32, &cont); in VisitBranch()
1520 return VisitBinop(this, node, kX64Sub32, &cont); in VisitBranch()
1523 return VisitBinop(this, node, kX64Add, &cont); in VisitBranch()
1526 return VisitBinop(this, node, kX64Sub, &cont); in VisitBranch()
1551 void InstructionSelector::VisitSwitch(Node* node, const SwitchInfo& sw) { in VisitSwitch() argument
1553 InstructionOperand value_operand = g.UseRegister(node->InputAt(0)); in VisitSwitch()
1582 void InstructionSelector::VisitWord32Equal(Node* const node) { in VisitWord32Equal() argument
1583 Node* user = node; in VisitWord32Equal()
1584 FlagsContinuation cont(kEqual, node); in VisitWord32Equal()
1587 Node* value = m.left().node(); in VisitWord32Equal()
1594 value = m.left().node(); in VisitWord32Equal()
1614 VisitWordCompare(this, node, kX64Cmp32, &cont); in VisitWord32Equal()
1618 void InstructionSelector::VisitInt32LessThan(Node* node) { in VisitInt32LessThan() argument
1619 FlagsContinuation cont(kSignedLessThan, node); in VisitInt32LessThan()
1620 VisitWordCompare(this, node, kX64Cmp32, &cont); in VisitInt32LessThan()
1624 void InstructionSelector::VisitInt32LessThanOrEqual(Node* node) { in VisitInt32LessThanOrEqual() argument
1625 FlagsContinuation cont(kSignedLessThanOrEqual, node); in VisitInt32LessThanOrEqual()
1626 VisitWordCompare(this, node, kX64Cmp32, &cont); in VisitInt32LessThanOrEqual()
1630 void InstructionSelector::VisitUint32LessThan(Node* node) { in VisitUint32LessThan() argument
1631 FlagsContinuation cont(kUnsignedLessThan, node); in VisitUint32LessThan()
1632 VisitWordCompare(this, node, kX64Cmp32, &cont); in VisitUint32LessThan()
1636 void InstructionSelector::VisitUint32LessThanOrEqual(Node* node) { in VisitUint32LessThanOrEqual() argument
1637 FlagsContinuation cont(kUnsignedLessThanOrEqual, node); in VisitUint32LessThanOrEqual()
1638 VisitWordCompare(this, node, kX64Cmp32, &cont); in VisitUint32LessThanOrEqual()
1642 void InstructionSelector::VisitWord64Equal(Node* const node) { in VisitWord64Equal() argument
1643 FlagsContinuation cont(kEqual, node); in VisitWord64Equal()
1644 Int64BinopMatcher m(node); in VisitWord64Equal()
1647 Node* const user = m.node(); in VisitWord64Equal()
1648 Node* const value = m.left().node(); in VisitWord64Equal()
1660 VisitWord64Compare(this, node, &cont); in VisitWord64Equal()
1664 void InstructionSelector::VisitInt32AddWithOverflow(Node* node) { in VisitInt32AddWithOverflow() argument
1665 if (Node* ovf = NodeProperties::FindProjection(node, 1)) { in VisitInt32AddWithOverflow()
1667 VisitBinop(this, node, kX64Add32, &cont); in VisitInt32AddWithOverflow()
1670 VisitBinop(this, node, kX64Add32, &cont); in VisitInt32AddWithOverflow()
1674 void InstructionSelector::VisitInt32SubWithOverflow(Node* node) { in VisitInt32SubWithOverflow() argument
1675 if (Node* ovf = NodeProperties::FindProjection(node, 1)) { in VisitInt32SubWithOverflow()
1677 return VisitBinop(this, node, kX64Sub32, &cont); in VisitInt32SubWithOverflow()
1680 VisitBinop(this, node, kX64Sub32, &cont); in VisitInt32SubWithOverflow()
1684 void InstructionSelector::VisitInt64LessThan(Node* node) { in VisitInt64LessThan() argument
1685 FlagsContinuation cont(kSignedLessThan, node); in VisitInt64LessThan()
1686 VisitWord64Compare(this, node, &cont); in VisitInt64LessThan()
1690 void InstructionSelector::VisitInt64LessThanOrEqual(Node* node) { in VisitInt64LessThanOrEqual() argument
1691 FlagsContinuation cont(kSignedLessThanOrEqual, node); in VisitInt64LessThanOrEqual()
1692 VisitWord64Compare(this, node, &cont); in VisitInt64LessThanOrEqual()
1696 void InstructionSelector::VisitUint64LessThan(Node* node) { in VisitUint64LessThan() argument
1697 FlagsContinuation cont(kUnsignedLessThan, node); in VisitUint64LessThan()
1698 VisitWord64Compare(this, node, &cont); in VisitUint64LessThan()
1702 void InstructionSelector::VisitUint64LessThanOrEqual(Node* node) { in VisitUint64LessThanOrEqual() argument
1703 FlagsContinuation cont(kUnsignedLessThanOrEqual, node); in VisitUint64LessThanOrEqual()
1704 VisitWord64Compare(this, node, &cont); in VisitUint64LessThanOrEqual()
1708 void InstructionSelector::VisitFloat32Equal(Node* node) { in VisitFloat32Equal() argument
1709 FlagsContinuation cont(kUnorderedEqual, node); in VisitFloat32Equal()
1710 VisitFloat32Compare(this, node, &cont); in VisitFloat32Equal()
1714 void InstructionSelector::VisitFloat32LessThan(Node* node) { in VisitFloat32LessThan() argument
1715 FlagsContinuation cont(kUnsignedGreaterThan, node); in VisitFloat32LessThan()
1716 VisitFloat32Compare(this, node, &cont); in VisitFloat32LessThan()
1720 void InstructionSelector::VisitFloat32LessThanOrEqual(Node* node) { in VisitFloat32LessThanOrEqual() argument
1721 FlagsContinuation cont(kUnsignedGreaterThanOrEqual, node); in VisitFloat32LessThanOrEqual()
1722 VisitFloat32Compare(this, node, &cont); in VisitFloat32LessThanOrEqual()
1726 void InstructionSelector::VisitFloat64Equal(Node* node) { in VisitFloat64Equal() argument
1727 FlagsContinuation cont(kUnorderedEqual, node); in VisitFloat64Equal()
1728 VisitFloat64Compare(this, node, &cont); in VisitFloat64Equal()
1732 void InstructionSelector::VisitFloat64LessThan(Node* node) { in VisitFloat64LessThan() argument
1733 FlagsContinuation cont(kUnsignedGreaterThan, node); in VisitFloat64LessThan()
1734 VisitFloat64Compare(this, node, &cont); in VisitFloat64LessThan()
1738 void InstructionSelector::VisitFloat64LessThanOrEqual(Node* node) { in VisitFloat64LessThanOrEqual() argument
1739 FlagsContinuation cont(kUnsignedGreaterThanOrEqual, node); in VisitFloat64LessThanOrEqual()
1740 VisitFloat64Compare(this, node, &cont); in VisitFloat64LessThanOrEqual()
1744 void InstructionSelector::VisitFloat64ExtractLowWord32(Node* node) { in VisitFloat64ExtractLowWord32() argument
1746 Emit(kSSEFloat64ExtractLowWord32, g.DefineAsRegister(node), in VisitFloat64ExtractLowWord32()
1747 g.Use(node->InputAt(0))); in VisitFloat64ExtractLowWord32()
1751 void InstructionSelector::VisitFloat64ExtractHighWord32(Node* node) { in VisitFloat64ExtractHighWord32() argument
1753 Emit(kSSEFloat64ExtractHighWord32, g.DefineAsRegister(node), in VisitFloat64ExtractHighWord32()
1754 g.Use(node->InputAt(0))); in VisitFloat64ExtractHighWord32()
1758 void InstructionSelector::VisitFloat64InsertLowWord32(Node* node) { in VisitFloat64InsertLowWord32() argument
1760 Node* left = node->InputAt(0); in VisitFloat64InsertLowWord32()
1761 Node* right = node->InputAt(1); in VisitFloat64InsertLowWord32()
1764 Emit(kSSEFloat64LoadLowWord32, g.DefineAsRegister(node), g.Use(right)); in VisitFloat64InsertLowWord32()
1767 Emit(kSSEFloat64InsertLowWord32, g.DefineSameAsFirst(node), in VisitFloat64InsertLowWord32()
1772 void InstructionSelector::VisitFloat64InsertHighWord32(Node* node) { in VisitFloat64InsertHighWord32() argument
1774 Node* left = node->InputAt(0); in VisitFloat64InsertHighWord32()
1775 Node* right = node->InputAt(1); in VisitFloat64InsertHighWord32()
1776 Emit(kSSEFloat64InsertHighWord32, g.DefineSameAsFirst(node), in VisitFloat64InsertHighWord32()