31 return os <<
mi.constructor_name;
41 return m.Int32Constant(value);
45 return m.Int64Constant(value);
69 0x00000002, 0x00000003, 0x00000070, 0x00000080, 0x00000100, 0x000001c0,
70 0x00000300, 0x000007e0, 0x00003ffc, 0x00007fc0, 0x0003c000, 0x0003f000,
71 0x0003ffc0, 0x0003fff8, 0x0007ff00, 0x0007ffe0, 0x000e0000, 0x001e0000,
72 0x001ffffc, 0x003f0000, 0x003f8000, 0x00780000, 0x007fc000, 0x00ff0000,
73 0x01800000, 0x01800180, 0x01f801f8, 0x03fe0000, 0x03ffffc0, 0x03fffffc,
74 0x06000000, 0x07fc0000, 0x07ffc000, 0x07ffffc0, 0x07ffffe0, 0x0ffe0ffe,
75 0x0ffff800, 0x0ffffff0, 0x0fffffff, 0x18001800, 0x1f001f00, 0x1f801f80,
76 0x30303030, 0x3ff03ff0, 0x3ff83ff8, 0x3fff0000, 0x3fff8000, 0x3fffffc0,
77 0x70007000, 0x7f7f7f7f, 0x7fc00000, 0x7fffffc0, 0x8000001f, 0x800001ff,
78 0x81818181, 0x9fff9fff, 0xc00007ff, 0xc0ffffff, 0xdddddddd, 0xe00001ff,
79 0xe00003ff, 0xe007ffff, 0xefffefff, 0xf000003f, 0xf001f001, 0xf3fff3ff,
80 0xf800001f, 0xf80fffff, 0xf87ff87f, 0xfbfbfbfb, 0xfc00001f, 0xfc0000ff,
81 0xfc0001ff, 0xfc03fc03, 0xfe0001ff, 0xff000001, 0xff03ff03, 0xff800000,
82 0xff800fff, 0xff801fff, 0xff87ffff, 0xffc0003f, 0xffc007ff, 0xffcfffcf,
83 0xffe00003, 0xffe1ffff, 0xfff0001f, 0xfff07fff, 0xfff80007, 0xfff87fff,
84 0xfffc00ff, 0xfffe07ff, 0xffff00ff, 0xffffc001, 0xfffff007, 0xfffff3ff,
85 0xfffff807, 0xfffff9ff, 0xfffffc0f, 0xfffffeff};
99 0, 1, 69, 493, 599, 701, 719,
100 768, 818, 842, 945, 1246, 1286, 1429,
101 1669, 2171, 2179, 2182, 2254, 2334, 2338,
102 2343, 2396, 2449, 2610, 2732, 2855, 2876,
103 2944, 3377, 3458, 3475, 3476, 3540, 3574,
104 3601, 3813, 3871, 3917, 4095, 4096, 16384,
105 364544, 462848, 970752, 1523712, 1863680, 2363392, 3219456,
106 3280896, 4247552, 4526080, 4575232, 4960256, 5505024, 5894144,
107 6004736, 6193152, 6385664, 6795264, 7114752, 7233536, 7348224,
108 7499776, 7573504, 7729152, 8634368, 8937472, 9465856, 10354688,
109 10682368, 11059200, 11460608, 13168640, 13176832, 14336000, 15028224,
110 15597568, 15892480, 16773120};
194 return os << conv.
mi;
204 "TruncateFloat64ToFloat32", kArm64Float64ToFloat32,
kMachFloat32},
235 typedef InstructionSelectorTestWithParam<MachInst2>
242 StreamBuilder m(
this, type, type, type);
243 m.Return((m.*dpi.constructor)(m.Parameter(0), m.Parameter(1)));
244 Stream s = m.Build();
245 ASSERT_EQ(1U, s.size());
246 EXPECT_EQ(dpi.arch_opcode, s[0]->arch_opcode());
247 EXPECT_EQ(2U, s[0]->InputCount());
248 EXPECT_EQ(1U, s[0]->OutputCount());
259 StreamBuilder m(
this, type, type);
260 m.Return((m.*dpi.constructor)(m.Parameter(0), m.Int32Constant(imm)));
261 Stream s = m.Build();
262 ASSERT_EQ(1U, s.size());
263 EXPECT_EQ(dpi.arch_opcode, s[0]->arch_opcode());
264 ASSERT_EQ(2U, s[0]->InputCount());
265 EXPECT_TRUE(s[0]->InputAt(1)->IsImmediate());
266 EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(1)));
267 EXPECT_EQ(1U, s[0]->OutputCount());
272 StreamBuilder m(
this, type, type);
273 m.Return((m.*dpi.constructor)(m.Int32Constant(imm), m.Parameter(0)));
274 Stream s = m.Build();
275 ASSERT_EQ(1U, s.size());
276 EXPECT_EQ(dpi.arch_opcode, s[0]->arch_opcode());
277 ASSERT_EQ(2U, s[0]->InputCount());
278 EXPECT_TRUE(s[0]->InputAt(1)->IsImmediate());
279 EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(1)));
280 EXPECT_EQ(1U, s[0]->OutputCount());
300 StreamBuilder m(
this, type, type, type);
301 m.Return((m.*dpi.constructor)(m.Parameter(0), m.Parameter(1)));
302 Stream s = m.Build();
303 ASSERT_EQ(1U, s.size());
304 EXPECT_EQ(dpi.arch_opcode, s[0]->arch_opcode());
305 EXPECT_EQ(2U, s[0]->InputCount());
306 EXPECT_EQ(1U, s[0]->OutputCount());
314 StreamBuilder m(
this, type, type);
315 m.Return((m.*dpi.constructor)(m.Parameter(0),
BuildConstant(m, type, imm)));
316 Stream s = m.Build();
317 ASSERT_EQ(1U, s.size());
318 EXPECT_EQ(dpi.arch_opcode, s[0]->arch_opcode());
319 ASSERT_EQ(2U, s[0]->InputCount());
320 EXPECT_TRUE(s[0]->InputAt(1)->IsImmediate());
321 EXPECT_EQ(imm, s.ToInt64(s[0]->InputAt(1)));
322 EXPECT_EQ(1U, s[0]->OutputCount());
332 StreamBuilder m(
this, type, type);
333 m.Return((m.*dpi.constructor)(
BuildConstant(m, type, imm), m.Parameter(0)));
334 Stream s = m.Build();
338 if (strstr(dpi.constructor_name,
"Add") !=
NULL) {
339 ASSERT_EQ(1U, s.size());
340 EXPECT_EQ(dpi.arch_opcode, s[0]->arch_opcode());
341 ASSERT_EQ(2U, s[0]->InputCount());
342 EXPECT_TRUE(s[0]->InputAt(1)->IsImmediate());
343 EXPECT_EQ(imm, s.ToInt64(s[0]->InputAt(1)));
344 EXPECT_EQ(1U, s[0]->OutputCount());
359 m.Return(m.Int32Sub(m.Int32Constant(0), m.Parameter(0)));
360 Stream s = m.Build();
362 ASSERT_EQ(1U, s.size());
363 EXPECT_EQ(kArm64Neg32, s[0]->arch_opcode());
364 EXPECT_EQ(1U, s[0]->InputCount());
365 EXPECT_EQ(1U, s[0]->OutputCount());
370 m.Return(m.Int64Sub(m.Int64Constant(0), m.Parameter(0)));
371 Stream s = m.Build();
373 ASSERT_EQ(1U, s.size());
374 EXPECT_EQ(kArm64Neg, s[0]->arch_opcode());
375 EXPECT_EQ(1U, s[0]->InputCount());
376 EXPECT_EQ(1U, s[0]->OutputCount());
385 typedef InstructionSelectorTestWithParam<MachInst2>
392 StreamBuilder m(
this, type, type, type);
394 m.Branch((m.*dpi.constructor)(m.Parameter(0), m.Parameter(1)), &a, &b);
396 m.Return(m.Int32Constant(1));
398 m.Return(m.Int32Constant(0));
399 Stream s = m.Build();
400 ASSERT_EQ(1U, s.size());
401 EXPECT_EQ(dpi.arch_opcode, s[0]->arch_opcode());
403 EXPECT_EQ(
kNotEqual, s[0]->flags_condition());
416 m.Branch(m.Word32And(m.Parameter(0), m.Int32Constant(imm)), &a, &b);
418 m.Return(m.Int32Constant(1));
420 m.Return(m.Int32Constant(0));
421 Stream s = m.Build();
422 ASSERT_EQ(1U, s.size());
423 EXPECT_EQ(kArm64Tst32, s[0]->arch_opcode());
425 EXPECT_EQ(
kNotEqual, s[0]->flags_condition());
434 m.Branch(m.Int32Add(m.Parameter(0), m.Int32Constant(imm)), &a, &b);
436 m.Return(m.Int32Constant(1));
438 m.Return(m.Int32Constant(0));
439 Stream s = m.Build();
440 ASSERT_EQ(1U, s.size());
441 EXPECT_EQ(kArm64Cmn32, s[0]->arch_opcode());
443 EXPECT_EQ(
kNotEqual, s[0]->flags_condition());
452 m.Branch(m.Int32Sub(m.Parameter(0), m.Int32Constant(imm)), &a, &b);
454 m.Return(m.Int32Constant(1));
456 m.Return(m.Int32Constant(0));
457 Stream s = m.Build();
458 ASSERT_EQ(1U, s.size());
459 EXPECT_EQ(kArm64Cmp32, s[0]->arch_opcode());
461 EXPECT_EQ(
kNotEqual, s[0]->flags_condition());
470 m.Branch(m.Word32And(m.Int32Constant(imm), m.Parameter(0)), &a, &b);
472 m.Return(m.Int32Constant(1));
474 m.Return(m.Int32Constant(0));
475 Stream s = m.Build();
476 ASSERT_EQ(1U, s.size());
477 EXPECT_EQ(kArm64Tst32, s[0]->arch_opcode());
478 ASSERT_LE(1U, s[0]->InputCount());
480 EXPECT_EQ(
kNotEqual, s[0]->flags_condition());
489 m.Branch(m.Int32Add(m.Int32Constant(imm), m.Parameter(0)), &a, &b);
491 m.Return(m.Int32Constant(1));
493 m.Return(m.Int32Constant(0));
494 Stream s = m.Build();
495 ASSERT_EQ(1U, s.size());
496 EXPECT_EQ(kArm64Cmn32, s[0]->arch_opcode());
497 ASSERT_LE(1U, s[0]->InputCount());
499 EXPECT_EQ(
kNotEqual, s[0]->flags_condition());
508 typedef InstructionSelectorTestWithParam<MachInst2>
515 StreamBuilder m(
this, type, type, type);
517 m.Projection(1, (m.*dpi.constructor)(m.Parameter(0), m.Parameter(1))));
518 Stream s = m.Build();
519 ASSERT_EQ(1U, s.size());
520 EXPECT_EQ(dpi.arch_opcode, s[0]->arch_opcode());
521 EXPECT_EQ(2U, s[0]->InputCount());
522 EXPECT_LE(1U, s[0]->OutputCount());
524 EXPECT_EQ(
kOverflow, s[0]->flags_condition());
532 StreamBuilder m(
this, type, type);
533 m.Return(m.Projection(
534 1, (m.*dpi.constructor)(m.Parameter(0), m.Int32Constant(imm))));
535 Stream s = m.Build();
536 ASSERT_EQ(1U, s.size());
537 EXPECT_EQ(dpi.arch_opcode, s[0]->arch_opcode());
538 ASSERT_EQ(2U, s[0]->InputCount());
539 EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(1)));
540 EXPECT_LE(1U, s[0]->OutputCount());
542 EXPECT_EQ(
kOverflow, s[0]->flags_condition());
550 StreamBuilder m(
this, type, type, type);
552 m.Projection(0, (m.*dpi.constructor)(m.Parameter(0), m.Parameter(1))));
553 Stream s = m.Build();
554 ASSERT_EQ(1U, s.size());
555 EXPECT_EQ(dpi.arch_opcode, s[0]->arch_opcode());
556 EXPECT_EQ(2U, s[0]->InputCount());
557 EXPECT_LE(1U, s[0]->OutputCount());
566 StreamBuilder m(
this, type, type);
567 m.Return(m.Projection(
568 0, (m.*dpi.constructor)(m.Parameter(0), m.Int32Constant(imm))));
569 Stream s = m.Build();
570 ASSERT_EQ(1U, s.size());
571 EXPECT_EQ(dpi.arch_opcode, s[0]->arch_opcode());
572 ASSERT_EQ(2U, s[0]->InputCount());
573 EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(1)));
574 EXPECT_LE(1U, s[0]->OutputCount());
583 StreamBuilder m(
this, type, type, type);
584 Node* n = (m.*dpi.constructor)(m.Parameter(0), m.Parameter(1));
585 m.Return(m.Word32Equal(m.Projection(0, n), m.Projection(1, n)));
586 Stream s = m.Build();
587 ASSERT_LE(1U, s.size());
588 EXPECT_EQ(dpi.arch_opcode, s[0]->arch_opcode());
589 EXPECT_EQ(2U, s[0]->InputCount());
590 EXPECT_EQ(2U, s[0]->OutputCount());
592 EXPECT_EQ(
kOverflow, s[0]->flags_condition());
600 StreamBuilder m(
this, type, type);
601 Node* n = (m.*dpi.constructor)(m.Parameter(0), m.Int32Constant(imm));
602 m.Return(m.Word32Equal(m.Projection(0, n), m.Projection(1, n)));
603 Stream s = m.Build();
604 ASSERT_LE(1U, s.size());
605 EXPECT_EQ(dpi.arch_opcode, s[0]->arch_opcode());
606 ASSERT_EQ(2U, s[0]->InputCount());
607 EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(1)));
608 EXPECT_EQ(2U, s[0]->OutputCount());
610 EXPECT_EQ(
kOverflow, s[0]->flags_condition());
618 StreamBuilder m(
this, type, type, type);
620 Node* n = (m.*dpi.constructor)(m.Parameter(0), m.Parameter(1));
621 m.Branch(m.Projection(1, n), &a, &b);
623 m.Return(m.Int32Constant(0));
625 m.Return(m.Projection(0, n));
626 Stream s = m.Build();
627 ASSERT_EQ(1U, s.size());
628 EXPECT_EQ(dpi.arch_opcode, s[0]->arch_opcode());
629 EXPECT_EQ(4U, s[0]->InputCount());
630 EXPECT_EQ(1U, s[0]->OutputCount());
632 EXPECT_EQ(
kOverflow, s[0]->flags_condition());
640 StreamBuilder m(
this, type, type);
642 Node* n = (m.*dpi.constructor)(m.Parameter(0), m.Int32Constant(imm));
643 m.Branch(m.Projection(1, n), &a, &b);
645 m.Return(m.Int32Constant(0));
647 m.Return(m.Projection(0, n));
648 Stream s = m.Build();
649 ASSERT_EQ(1U, s.size());
650 EXPECT_EQ(dpi.arch_opcode, s[0]->arch_opcode());
651 ASSERT_EQ(4U, s[0]->InputCount());
652 EXPECT_EQ(1U, s[0]->OutputCount());
654 EXPECT_EQ(
kOverflow, s[0]->flags_condition());
667 m.Return(m.Projection(
668 1, m.Int32AddWithOverflow(m.Int32Constant(imm), m.Parameter(0))));
669 Stream s = m.Build();
671 ASSERT_EQ(1U, s.size());
672 EXPECT_EQ(kArm64Add32, s[0]->arch_opcode());
673 EXPECT_EQ(2U, s[0]->InputCount());
674 EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(1)));
675 EXPECT_LE(1U, s[0]->OutputCount());
677 EXPECT_EQ(
kOverflow, s[0]->flags_condition());
685 m.Return(m.Projection(
686 0, m.Int32AddWithOverflow(m.Int32Constant(imm), m.Parameter(0))));
687 Stream s = m.Build();
689 ASSERT_EQ(1U, s.size());
690 EXPECT_EQ(kArm64Add32, s[0]->arch_opcode());
691 ASSERT_EQ(2U, s[0]->InputCount());
692 EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(1)));
693 EXPECT_LE(1U, s[0]->OutputCount());
702 Node* n = m.Int32AddWithOverflow(m.Int32Constant(imm), m.Parameter(0));
703 m.Return(m.Word32Equal(m.Projection(0, n), m.Projection(1, n)));
704 Stream s = m.Build();
706 ASSERT_LE(1U, s.size());
707 EXPECT_EQ(kArm64Add32, s[0]->arch_opcode());
708 ASSERT_EQ(2U, s[0]->InputCount());
709 EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(1)));
710 EXPECT_EQ(2U, s[0]->OutputCount());
712 EXPECT_EQ(
kOverflow, s[0]->flags_condition());
721 Node* n = m.Int32AddWithOverflow(m.Int32Constant(imm), m.Parameter(0));
722 m.Branch(m.Projection(1, n), &a, &b);
724 m.Return(m.Int32Constant(0));
726 m.Return(m.Projection(0, n));
727 Stream s = m.Build();
729 ASSERT_EQ(1U, s.size());
730 EXPECT_EQ(kArm64Add32, s[0]->arch_opcode());
731 ASSERT_EQ(4U, s[0]->InputCount());
732 EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(1)));
733 EXPECT_EQ(1U, s[0]->OutputCount());
735 EXPECT_EQ(
kOverflow, s[0]->flags_condition());
744 typedef InstructionSelectorTestWithParam<MachInst2>
751 StreamBuilder m(
this, type, type, type);
752 m.Return((m.*dpi.constructor)(m.Parameter(0), m.Parameter(1)));
753 Stream s = m.Build();
754 ASSERT_EQ(1U, s.size());
755 EXPECT_EQ(dpi.arch_opcode, s[0]->arch_opcode());
756 EXPECT_EQ(2U, s[0]->InputCount());
757 EXPECT_EQ(1U, s[0]->OutputCount());
765 StreamBuilder m(
this, type, type);
766 m.Return((m.*dpi.constructor)(m.Parameter(0), m.Int32Constant(imm)));
767 Stream s = m.Build();
768 ASSERT_EQ(1U, s.size());
769 EXPECT_EQ(dpi.arch_opcode, s[0]->arch_opcode());
770 EXPECT_EQ(2U, s[0]->InputCount());
771 EXPECT_TRUE(s[0]->InputAt(1)->IsImmediate());
772 EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(1)));
773 EXPECT_EQ(1U, s[0]->OutputCount());
793 StreamBuilder m(
this, type, type, type);
794 m.Return((m.*dpi.constructor)(m.Parameter(0), m.Parameter(1)));
795 Stream s = m.Build();
796 ASSERT_EQ(1U, s.size());
797 EXPECT_EQ(dpi.arch_opcode, s[0]->arch_opcode());
798 EXPECT_EQ(2U, s[0]->InputCount());
799 EXPECT_EQ(1U, s[0]->OutputCount());
837 typedef InstructionSelectorTestWithParam<MulDPInst>
842 const MulDPInst mdpi = GetParam();
845 StreamBuilder m(
this, type, type, type, type);
846 Node* n = (m.*mdpi.mul_constructor)(m.Parameter(1), m.Parameter(2));
847 m.Return((m.*mdpi.add_constructor)(m.Parameter(0), n));
848 Stream s = m.Build();
849 ASSERT_EQ(1U, s.size());
850 EXPECT_EQ(mdpi.add_arch_opcode, s[0]->arch_opcode());
851 EXPECT_EQ(3U, s[0]->InputCount());
852 EXPECT_EQ(1U, s[0]->OutputCount());
855 StreamBuilder m(
this, type, type, type, type);
856 Node* n = (m.*mdpi.mul_constructor)(m.Parameter(0), m.Parameter(1));
857 m.Return((m.*mdpi.add_constructor)(n, m.Parameter(2)));
858 Stream s = m.Build();
859 ASSERT_EQ(1U, s.size());
860 EXPECT_EQ(mdpi.add_arch_opcode, s[0]->arch_opcode());
861 EXPECT_EQ(3U, s[0]->InputCount());
862 EXPECT_EQ(1U, s[0]->OutputCount());
868 const MulDPInst mdpi = GetParam();
871 StreamBuilder m(
this, type, type, type, type);
872 Node* n = (m.*mdpi.mul_constructor)(m.Parameter(1), m.Parameter(2));
873 m.Return((m.*mdpi.sub_constructor)(m.Parameter(0), n));
874 Stream s = m.Build();
875 ASSERT_EQ(1U, s.size());
876 EXPECT_EQ(mdpi.sub_arch_opcode, s[0]->arch_opcode());
877 EXPECT_EQ(3U, s[0]->InputCount());
878 EXPECT_EQ(1U, s[0]->OutputCount());
884 const MulDPInst mdpi = GetParam();
887 StreamBuilder m(
this, type, type, type);
889 (m.*mdpi.sub_constructor)(
BuildConstant(m, type, 0), m.Parameter(0));
890 m.Return((m.*mdpi.mul_constructor)(n, m.Parameter(1)));
891 Stream s = m.Build();
892 ASSERT_EQ(1U, s.size());
893 EXPECT_EQ(mdpi.neg_arch_opcode, s[0]->arch_opcode());
894 EXPECT_EQ(2U, s[0]->InputCount());
895 EXPECT_EQ(1U, s[0]->OutputCount());
898 StreamBuilder m(
this, type, type, type);
900 (m.*mdpi.sub_constructor)(
BuildConstant(m, type, 0), m.Parameter(1));
901 m.Return((m.*mdpi.mul_constructor)(m.Parameter(0), n));
902 Stream s = m.Build();
903 ASSERT_EQ(1U, s.size());
904 EXPECT_EQ(mdpi.neg_arch_opcode, s[0]->arch_opcode());
905 EXPECT_EQ(2U, s[0]->InputCount());
906 EXPECT_EQ(1U, s[0]->OutputCount());
925 StreamBuilder m(
this, fpa.machine_type, fpa.machine_type, fpa.machine_type);
926 m.Return((m.*fpa.constructor)(m.Parameter(0), m.Parameter(1)));
927 Stream s = m.Build();
928 ASSERT_EQ(1U, s.size());
929 EXPECT_EQ(fpa.arch_opcode, s[0]->arch_opcode());
930 EXPECT_EQ(2U, s[0]->InputCount());
931 EXPECT_EQ(1U, s[0]->OutputCount());
943 const FPCmp cmp = GetParam();
944 StreamBuilder m(
this,
kMachInt32, cmp.mi.machine_type, cmp.mi.machine_type);
945 m.Return((m.*cmp.mi.constructor)(m.Parameter(0), m.Parameter(1)));
946 Stream s = m.Build();
947 ASSERT_EQ(1U, s.size());
948 EXPECT_EQ(cmp.mi.arch_opcode, s[0]->arch_opcode());
949 EXPECT_EQ(2U, s[0]->InputCount());
950 EXPECT_EQ(1U, s[0]->OutputCount());
952 EXPECT_EQ(cmp.cond, s[0]->flags_condition());
968 const Conversion conv = GetParam();
969 StreamBuilder m(
this, conv.mi.machine_type, conv.src_machine_type);
970 m.Return((m.*conv.mi.constructor)(m.Parameter(0)));
971 Stream s = m.Build();
972 ASSERT_EQ(1U, s.size());
973 EXPECT_EQ(conv.mi.arch_opcode, s[0]->arch_opcode());
974 EXPECT_EQ(1U, s[0]->InputCount());
975 EXPECT_EQ(1U, s[0]->OutputCount());
1001 return os << ost.
c_str();
1009 {-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 257, 258, 1000, 1001,
1010 2121, 2442, 4093, 4094, 4095}},
1012 {-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 257, 258, 1000, 1001,
1013 2121, 2442, 4093, 4094, 4095}},
1015 {-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 258, 260, 4096, 4098,
1016 4100, 4242, 6786, 8188, 8190}},
1018 {-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 258, 260, 4096, 4098,
1019 4100, 4242, 6786, 8188, 8190}},
1021 {-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 260, 4096, 4100, 8192,
1022 8196, 3276, 3280, 16376, 16380}},
1024 {-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 260, 4096, 4100, 8192,
1025 8196, 3276, 3280, 16376, 16380}},
1027 {-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 264, 4096, 4104, 8192,
1028 8200, 16384, 16392, 32752, 32760}},
1030 {-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 264, 4096, 4104, 8192,
1031 8200, 16384, 16392, 32752, 32760}},
1033 {-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 260, 4096, 4100, 8192,
1034 8196, 3276, 3280, 16376, 16380}},
1036 {-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 264, 4096, 4104, 8192,
1037 8200, 16384, 16392, 32752, 32760}}};
1040 typedef InstructionSelectorTestWithParam<MemoryAccess>
1045 const MemoryAccess memacc = GetParam();
1047 m.Return(m.Load(memacc.type, m.Parameter(0), m.Parameter(1)));
1048 Stream s = m.Build();
1049 ASSERT_EQ(1U, s.size());
1050 EXPECT_EQ(memacc.ldr_opcode, s[0]->arch_opcode());
1051 EXPECT_EQ(kMode_MRR, s[0]->addressing_mode());
1052 EXPECT_EQ(2U, s[0]->InputCount());
1053 EXPECT_EQ(1U, s[0]->OutputCount());
1058 const MemoryAccess memacc = GetParam();
1059 TRACED_FOREACH(
int32_t, index, memacc.immediates) {
1060 StreamBuilder m(
this, memacc.type,
kMachPtr);
1061 m.Return(m.Load(memacc.type, m.Parameter(0), m.Int32Constant(index)));
1062 Stream s = m.Build();
1063 ASSERT_EQ(1U, s.size());
1064 EXPECT_EQ(memacc.ldr_opcode, s[0]->arch_opcode());
1065 EXPECT_EQ(kMode_MRI, s[0]->addressing_mode());
1066 EXPECT_EQ(2U, s[0]->InputCount());
1068 EXPECT_EQ(index, s.ToInt32(s[0]->InputAt(1)));
1069 ASSERT_EQ(1U, s[0]->OutputCount());
1075 const MemoryAccess memacc = GetParam();
1077 m.Store(memacc.type, m.Parameter(0), m.Parameter(1), m.Parameter(2));
1078 m.Return(m.Int32Constant(0));
1079 Stream s = m.Build();
1080 ASSERT_EQ(1U, s.size());
1081 EXPECT_EQ(memacc.str_opcode, s[0]->arch_opcode());
1082 EXPECT_EQ(kMode_MRR, s[0]->addressing_mode());
1083 EXPECT_EQ(3U, s[0]->InputCount());
1084 EXPECT_EQ(0
U, s[0]->OutputCount());
1089 const MemoryAccess memacc = GetParam();
1090 TRACED_FOREACH(
int32_t, index, memacc.immediates) {
1092 m.Store(memacc.type, m.Parameter(0), m.Int32Constant(index),
1094 m.Return(m.Int32Constant(0));
1095 Stream s = m.Build();
1096 ASSERT_EQ(1U, s.size());
1097 EXPECT_EQ(memacc.str_opcode, s[0]->arch_opcode());
1098 EXPECT_EQ(kMode_MRI, s[0]->addressing_mode());
1099 ASSERT_EQ(3U, s[0]->InputCount());
1101 EXPECT_EQ(index, s.ToInt32(s[0]->InputAt(1)));
1102 EXPECT_EQ(0
U, s[0]->OutputCount());
1121 typedef InstructionSelectorTestWithParam<MachInst2>
1128 StreamBuilder m(
this, type, type, type);
1129 m.Return((m.*cmp.constructor)(m.Parameter(0), m.Parameter(1)));
1130 Stream s = m.Build();
1131 ASSERT_EQ(1U, s.size());
1132 EXPECT_EQ(cmp.arch_opcode, s[0]->arch_opcode());
1133 EXPECT_EQ(2U, s[0]->InputCount());
1134 EXPECT_EQ(1U, s[0]->OutputCount());
1136 EXPECT_EQ(
kEqual, s[0]->flags_condition());
1145 if (imm == 0)
continue;
1146 StreamBuilder m(
this, type, type);
1147 m.Return((m.*cmp.constructor)(m.Parameter(0),
BuildConstant(m, type, imm)));
1148 Stream s = m.Build();
1149 ASSERT_EQ(1U, s.size());
1150 EXPECT_EQ(cmp.arch_opcode, s[0]->arch_opcode());
1151 ASSERT_EQ(2U, s[0]->InputCount());
1153 EXPECT_EQ(imm, s.ToInt64(s[0]->InputAt(1)));
1154 EXPECT_EQ(1U, s[0]->OutputCount());
1156 EXPECT_EQ(
kEqual, s[0]->flags_condition());
1160 if (imm == 0)
continue;
1161 StreamBuilder m(
this, type, type);
1162 m.Return((m.*cmp.constructor)(
BuildConstant(m, type, imm), m.Parameter(0)));
1163 Stream s = m.Build();
1164 ASSERT_EQ(1U, s.size());
1165 EXPECT_EQ(cmp.arch_opcode, s[0]->arch_opcode());
1166 ASSERT_EQ(2U, s[0]->InputCount());
1168 EXPECT_EQ(imm, s.ToInt64(s[0]->InputAt(1)));
1169 EXPECT_EQ(1U, s[0]->OutputCount());
1171 EXPECT_EQ(
kEqual, s[0]->flags_condition());
1183 m.Return(m.Word32Equal(m.Parameter(0), m.Int32Constant(0)));
1184 Stream s = m.Build();
1185 ASSERT_EQ(1U, s.size());
1186 EXPECT_EQ(kArm64Tst32, s[0]->arch_opcode());
1187 ASSERT_EQ(2U, s[0]->InputCount());
1188 EXPECT_EQ(s.ToVreg(s[0]->InputAt(0)), s.ToVreg(s[0]->InputAt(1)));
1189 EXPECT_EQ(1U, s[0]->OutputCount());
1191 EXPECT_EQ(
kEqual, s[0]->flags_condition());
1195 m.Return(m.Word32Equal(m.Int32Constant(0), m.Parameter(0)));
1196 Stream s = m.Build();
1197 ASSERT_EQ(1U, s.size());
1198 EXPECT_EQ(kArm64Tst32, s[0]->arch_opcode());
1199 ASSERT_EQ(2U, s[0]->InputCount());
1200 EXPECT_EQ(s.ToVreg(s[0]->InputAt(0)), s.ToVreg(s[0]->InputAt(1)));
1201 EXPECT_EQ(1U, s[0]->OutputCount());
1203 EXPECT_EQ(
kEqual, s[0]->flags_condition());
1211 m.Return(m.Word64Equal(m.Parameter(0), m.Int64Constant(0)));
1212 Stream s = m.Build();
1213 ASSERT_EQ(1U, s.size());
1214 EXPECT_EQ(kArm64Tst, s[0]->arch_opcode());
1215 ASSERT_EQ(2U, s[0]->InputCount());
1216 EXPECT_EQ(s.ToVreg(s[0]->InputAt(0)), s.ToVreg(s[0]->InputAt(1)));
1217 EXPECT_EQ(1U, s[0]->OutputCount());
1219 EXPECT_EQ(
kEqual, s[0]->flags_condition());
1223 m.Return(m.Word64Equal(m.Int64Constant(0), m.Parameter(0)));
1224 Stream s = m.Build();
1225 ASSERT_EQ(1U, s.size());
1226 EXPECT_EQ(kArm64Tst, s[0]->arch_opcode());
1227 ASSERT_EQ(2U, s[0]->InputCount());
1228 EXPECT_EQ(s.ToVreg(s[0]->InputAt(0)), s.ToVreg(s[0]->InputAt(1)));
1229 EXPECT_EQ(1U, s[0]->OutputCount());
1231 EXPECT_EQ(
kEqual, s[0]->flags_condition());
1249 typedef InstructionSelectorTestWithParam<MachInst2>
1258 StreamBuilder m(
this, type, type, type);
1260 m.Return((m.*inst.constructor)(
1261 m.Parameter(0), m.Word32Xor(m.Parameter(1), m.Int32Constant(-1))));
1264 m.Return((m.*inst.constructor)(
1265 m.Parameter(0), m.Word64Xor(m.Parameter(1), m.Int64Constant(-1))));
1267 Stream s = m.Build();
1268 ASSERT_EQ(1U, s.size());
1269 EXPECT_EQ(inst.arch_opcode, s[0]->arch_opcode());
1270 EXPECT_EQ(2U, s[0]->InputCount());
1271 EXPECT_EQ(1U, s[0]->OutputCount());
1274 StreamBuilder m(
this, type, type, type);
1276 m.Return((m.*inst.constructor)(
1277 m.Word32Xor(m.Parameter(0), m.Int32Constant(-1)), m.Parameter(1)));
1280 m.Return((m.*inst.constructor)(
1281 m.Word64Xor(m.Parameter(0), m.Int64Constant(-1)), m.Parameter(1)));
1283 Stream s = m.Build();
1284 ASSERT_EQ(1U, s.size());
1285 EXPECT_EQ(inst.arch_opcode, s[0]->arch_opcode());
1286 EXPECT_EQ(2U, s[0]->InputCount());
1287 EXPECT_EQ(1U, s[0]->OutputCount());
1291 StreamBuilder m(
this, type, type, type);
1294 (m.*inst.constructor)(m.Parameter(0), m.Word32Not(m.Parameter(1))));
1298 (m.*inst.constructor)(m.Parameter(0), m.Word64Not(m.Parameter(1))));
1300 Stream s = m.Build();
1301 ASSERT_EQ(1U, s.size());
1302 EXPECT_EQ(inst.arch_opcode, s[0]->arch_opcode());
1303 EXPECT_EQ(2U, s[0]->InputCount());
1304 EXPECT_EQ(1U, s[0]->OutputCount());
1307 StreamBuilder m(
this, type, type, type);
1310 (m.*inst.constructor)(m.Word32Not(m.Parameter(0)), m.Parameter(1)));
1314 (m.*inst.constructor)(m.Word64Not(m.Parameter(0)), m.Parameter(1)));
1316 Stream s = m.Build();
1317 ASSERT_EQ(1U, s.size());
1318 EXPECT_EQ(inst.arch_opcode, s[0]->arch_opcode());
1319 EXPECT_EQ(2U, s[0]->InputCount());
1320 EXPECT_EQ(1U, s[0]->OutputCount());
1332 m.Return(m.Word32Not(m.Parameter(0)));
1333 Stream s = m.Build();
1334 ASSERT_EQ(1U, s.size());
1335 EXPECT_EQ(kArm64Not32, s[0]->arch_opcode());
1336 EXPECT_EQ(1U, s[0]->InputCount());
1337 EXPECT_EQ(1U, s[0]->OutputCount());
1343 m.Return(m.Word64Not(m.Parameter(0)));
1344 Stream s = m.Build();
1345 ASSERT_EQ(1U, s.size());
1346 EXPECT_EQ(kArm64Not, s[0]->arch_opcode());
1347 EXPECT_EQ(1U, s[0]->InputCount());
1348 EXPECT_EQ(1U, s[0]->OutputCount());
1355 m.Return(m.Word32Xor(m.Parameter(0), m.Int32Constant(-1)));
1356 Stream s = m.Build();
1357 ASSERT_EQ(1U, s.size());
1358 EXPECT_EQ(kArm64Not32, s[0]->arch_opcode());
1359 EXPECT_EQ(1U, s[0]->InputCount());
1360 EXPECT_EQ(1U, s[0]->OutputCount());
1364 m.Return(m.Word32Xor(m.Int32Constant(-1), m.Parameter(0)));
1365 Stream s = m.Build();
1366 ASSERT_EQ(1U, s.size());
1367 EXPECT_EQ(kArm64Not32, s[0]->arch_opcode());
1368 EXPECT_EQ(1U, s[0]->InputCount());
1369 EXPECT_EQ(1U, s[0]->OutputCount());
1377 m.Return(m.Word64Xor(m.Parameter(0), m.Int64Constant(-1)));
1378 Stream s = m.Build();
1379 ASSERT_EQ(1U, s.size());
1380 EXPECT_EQ(kArm64Not, s[0]->arch_opcode());
1381 EXPECT_EQ(1U, s[0]->InputCount());
1382 EXPECT_EQ(1U, s[0]->OutputCount());
1386 m.Return(m.Word64Xor(m.Int64Constant(-1), m.Parameter(0)));
1387 Stream s = m.Build();
1388 ASSERT_EQ(1U, s.size());
1389 EXPECT_EQ(kArm64Not, s[0]->arch_opcode());
1390 EXPECT_EQ(1U, s[0]->InputCount());
1391 EXPECT_EQ(1U, s[0]->OutputCount());
const char * c_str() const
Node * Int64Div(Node *a, Node *b)
Node * Float64Mul(Node *a, Node *b)
Node * Float64LessThan(Node *a, Node *b)
Node * Int64Add(Node *a, Node *b)
Node * Float64Div(Node *a, Node *b)
Node * Int32Sub(Node *a, Node *b)
Node * Word64And(Node *a, Node *b)
Node * Word32And(Node *a, Node *b)
Node * ChangeFloat64ToInt32(Node *a)
Node * Int32AddWithOverflow(Node *a, Node *b)
Node * Word64Xor(Node *a, Node *b)
Node * Word64Or(Node *a, Node *b)
Node * Int32SubWithOverflow(Node *a, Node *b)
Node * ChangeInt32ToFloat64(Node *a)
Node * Word64Equal(Node *a, Node *b)
Node * Word64Shr(Node *a, Node *b)
Node * Word32Xor(Node *a, Node *b)
Node * Int32UDiv(Node *a, Node *b)
Node * Word32Equal(Node *a, Node *b)
Node * Word32Or(Node *a, Node *b)
Node * ChangeInt32ToInt64(Node *a)
Node * ChangeFloat32ToFloat64(Node *a)
Node * Int64UDiv(Node *a, Node *b)
Node * Word32Ror(Node *a, Node *b)
Node * TruncateFloat64ToFloat32(Node *a)
Node * Word32Shl(Node *a, Node *b)
Node * Word64Shl(Node *a, Node *b)
Node * Int32Div(Node *a, Node *b)
Node * Word32Shr(Node *a, Node *b)
Node * Int64Sub(Node *a, Node *b)
Node * Float64Equal(Node *a, Node *b)
Node * Float64Sub(Node *a, Node *b)
Node * TruncateInt64ToInt32(Node *a)
Node * Float64Add(Node *a, Node *b)
Node * ChangeFloat64ToUint32(Node *a)
Node * Int32Mul(Node *a, Node *b)
Node * Float64LessThanOrEqual(Node *a, Node *b)
Node * ChangeUint32ToUint64(Node *a)
Node * Word32Sar(Node *a, Node *b)
Node * Word64Sar(Node *a, Node *b)
Node * ChangeUint32ToFloat64(Node *a)
Node * Int32Add(Node *a, Node *b)
Node * Word64Ror(Node *a, Node *b)
Node * Int64Mul(Node *a, Node *b)
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be NULL
MachInst< Node *(RawMachineAssembler::*)(Node *, Node *)> MachInst2
static const MachInst2 kMulDivInstructions[]
static const MachInst2 kFPArithInstructions[]
static const int32_t kAddSubImmediates[]
static const FPCmp kFPCmpInstructions[]
static const uint32_t kLogicalImmediates[]
Node * BuildConstant(InstructionSelectorTest::StreamBuilder &m, MachineType type, int64_t value)
static const Conversion kConversionInstructions[]
static const MachInst2 kAddSubInstructions[]
MachInst< Node *(RawMachineAssembler::*)(Node *)> MachInst1
RawMachineAssembler::Label MLabel
static const MachInst2 kDPFlagSetInstructions[]
static const MachInst2 kShiftInstructions[]
static const MachInst2 kOvfAddSubInstructions[]
static const MachInst2 kLogicalInstructions[]
InstructionSelectorTestWithParam< Shift > InstructionSelectorShiftTest
static const MulDPInst kMulDPInstructions[]
InstructionSelectorTestWithParam< FPCmp > InstructionSelectorFPCmpTest
std::ostream & operator<<(std::ostream &os, const MachineType &type)
InstructionSelectorTestWithParam< MachInst2 > InstructionSelectorLogicalWithNotRHSTest
InstructionSelectorTestWithParam< MachInst2 > InstructionSelectorDPFlagSetTest
InstructionSelectorTestWithParam< MachInst2 > InstructionSelectorComparisonTest
InstructionSelectorTestWithParam< MachInst2 > InstructionSelectorMulDivTest
static const MachInst2 kLogicalWithNotRHSs[]
static const MemoryAccess kMemoryAccesses[]
InstructionSelectorTestWithParam< MachInst2 > InstructionSelectorFPArithTest
TEST_P(InstructionSelectorDPITest, Parameters)
InstructionSelectorTestWithParam< MachInst2 > InstructionSelectorLogicalTest
InstructionSelectorTestWithParam< MemoryAccess > InstructionSelectorMemoryAccessTest
INSTANTIATE_TEST_CASE_P(InstructionSelectorTest, InstructionSelectorDPITest, ::testing::ValuesIn(kDPIs))
@ kUnorderedLessThanOrEqual
InstructionSelectorTestWithParam< MulDPInst > InstructionSelectorIntDPWithIntMulTest
InstructionSelectorTestWithParam< Conversion > InstructionSelectorConversionTest
TEST_F(InstructionSelectorTest, ChangeFloat32ToFloat64WithParameter)
InstructionSelectorTestWithParam< MachInst2 > InstructionSelectorOvfAddSubTest
int ElementSizeOf(MachineType machine_type)
InstructionSelectorTestWithParam< MachInst2 > InstructionSelectorAddSubTest
static const MachInst2 kComparisonInstructions[]
Debugger support for the V8 JavaScript engine.
MachineType src_machine_type
const char * constructor_name
Node *(RawMachineAssembler::* mul_constructor)(Node *, Node *)
Node *(RawMachineAssembler::* sub_constructor)(Node *, Node *)
ArchOpcode neg_arch_opcode
Node *(RawMachineAssembler::* add_constructor)(Node *, Node *)
const char * mul_constructor_name
ArchOpcode add_arch_opcode
ArchOpcode sub_arch_opcode
#define T(name, string, precedence)