Home | History | Annotate | Download | only in x64

Lines Matching refs:node

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