52 class X86MCInstLower {
87 CurrentShadowSize += Code.
size();
88 if (CurrentShadowSize >= RequiredShadowSize)
93 void X86AsmPrinter::StackMapShadowTracker::emitShadowPadding(
95 if (InShadow && CurrentShadowSize < RequiredShadowSize) {
97 EmitNops(OutStreamer, RequiredShadowSize - CurrentShadowSize,
102 void X86AsmPrinter::EmitAndCountInstruction(
MCInst &Inst) {
104 SMShadowTracker.count(Inst, getSubtargetInfo(), CodeEmitter.get());
109 : Ctx(mf.getContext()), MF(mf),
TM(mf.getTarget()), MAI(*
TM.getMCAsmInfo()),
121 "Isn't a symbol reference");
137 Suffix =
"$non_lazy_ptr";
149 }
else if (MO.
isMBB()) {
156 Sym = Ctx.getOrCreateSymbol(Name);
167 if (!StubSym.getPointer()) {
195 const MCExpr *Expr =
nullptr;
269 assert(MAI.doesSetDirectiveSuppressReloc());
299 "Unexpected instruction!");
303 if (Reg !=
X86::AL && Reg != X86::AX && Reg !=
X86::EAX && Reg != X86::RAX)
316 unsigned NewOpcode = 0;
321 case X86::MOVSX16rr8:
322 if (Op0 == X86::AX && Op1 ==
X86::AL)
323 NewOpcode = X86::CBW;
325 case X86::MOVSX32rr16:
326 if (Op0 ==
X86::EAX && Op1 == X86::AX)
327 NewOpcode = X86::CWDE;
329 case X86::MOVSX64rr32:
330 if (Op0 == X86::RAX && Op1 ==
X86::EAX)
331 NewOpcode = X86::CDQE;
335 if (NewOpcode != 0) {
350 unsigned AddrBase = IsStore;
351 unsigned RegOp = IsStore ? 0 : 5;
352 unsigned AddrOp = AddrBase + 3;
360 "Unexpected instruction!");
364 if (Reg !=
X86::AL && Reg != X86::AX && Reg !=
X86::EAX && Reg != X86::RAX)
394 return Subtarget.
is64Bit() ? X86::RETQ : X86::RETL;
435 Opcode = X86::JMP32r;
438 Opcode = X86::JMP32m;
440 case X86::TAILJMPr64:
441 Opcode = X86::JMP64r;
443 case X86::TAILJMPm64:
444 Opcode = X86::JMP64m;
446 case X86::TAILJMPr64_REX:
447 Opcode = X86::JMP64r_REX;
449 case X86::TAILJMPm64_REX:
450 Opcode = X86::JMP64m_REX;
453 case X86::TAILJMPd64:
456 case X86::TAILJMPd_CC:
457 case X86::TAILJMPd64_CC:
469 if (
auto MaybeMCOp = LowerMachineOperand(MI, MO))
480 "Unexpected # of LEA operands");
482 "LEA has segment specified!");
487 case X86::VMOVZPQILo2PQIrr:
489 case X86::VMOVAPDYrr:
491 case X86::VMOVAPSYrr:
493 case X86::VMOVDQAYrr:
495 case X86::VMOVDQUYrr:
497 case X86::VMOVUPDYrr:
499 case X86::VMOVUPSYrr: {
505 case X86::VMOVZPQILo2PQIrr: NewOpc = X86::VMOVPQI2QIrr;
break;
506 case X86::VMOVAPDrr: NewOpc = X86::VMOVAPDrr_REV;
break;
507 case X86::VMOVAPDYrr: NewOpc = X86::VMOVAPDYrr_REV;
break;
508 case X86::VMOVAPSrr: NewOpc = X86::VMOVAPSrr_REV;
break;
509 case X86::VMOVAPSYrr: NewOpc = X86::VMOVAPSYrr_REV;
break;
510 case X86::VMOVDQArr: NewOpc = X86::VMOVDQArr_REV;
break;
511 case X86::VMOVDQAYrr: NewOpc = X86::VMOVDQAYrr_REV;
break;
512 case X86::VMOVDQUrr: NewOpc = X86::VMOVDQUrr_REV;
break;
513 case X86::VMOVDQUYrr: NewOpc = X86::VMOVDQUYrr_REV;
break;
514 case X86::VMOVUPDrr: NewOpc = X86::VMOVUPDrr_REV;
break;
515 case X86::VMOVUPDYrr: NewOpc = X86::VMOVUPDYrr_REV;
break;
516 case X86::VMOVUPSrr: NewOpc = X86::VMOVUPSrr_REV;
break;
517 case X86::VMOVUPSYrr: NewOpc = X86::VMOVUPSYrr_REV;
break;
524 case X86::VMOVSSrr: {
530 case X86::VMOVSDrr: NewOpc = X86::VMOVSDrr_REV;
break;
531 case X86::VMOVSSrr: NewOpc = X86::VMOVSSrr_REV;
break;
538 case X86::VPCMPBZ128rmi:
case X86::VPCMPBZ128rmik:
539 case X86::VPCMPBZ128rri:
case X86::VPCMPBZ128rrik:
540 case X86::VPCMPBZ256rmi:
case X86::VPCMPBZ256rmik:
541 case X86::VPCMPBZ256rri:
case X86::VPCMPBZ256rrik:
542 case X86::VPCMPBZrmi:
case X86::VPCMPBZrmik:
543 case X86::VPCMPBZrri:
case X86::VPCMPBZrrik:
544 case X86::VPCMPDZ128rmi:
case X86::VPCMPDZ128rmik:
545 case X86::VPCMPDZ128rmib:
case X86::VPCMPDZ128rmibk:
546 case X86::VPCMPDZ128rri:
case X86::VPCMPDZ128rrik:
547 case X86::VPCMPDZ256rmi:
case X86::VPCMPDZ256rmik:
548 case X86::VPCMPDZ256rmib:
case X86::VPCMPDZ256rmibk:
549 case X86::VPCMPDZ256rri:
case X86::VPCMPDZ256rrik:
550 case X86::VPCMPDZrmi:
case X86::VPCMPDZrmik:
551 case X86::VPCMPDZrmib:
case X86::VPCMPDZrmibk:
552 case X86::VPCMPDZrri:
case X86::VPCMPDZrrik:
553 case X86::VPCMPQZ128rmi:
case X86::VPCMPQZ128rmik:
554 case X86::VPCMPQZ128rmib:
case X86::VPCMPQZ128rmibk:
555 case X86::VPCMPQZ128rri:
case X86::VPCMPQZ128rrik:
556 case X86::VPCMPQZ256rmi:
case X86::VPCMPQZ256rmik:
557 case X86::VPCMPQZ256rmib:
case X86::VPCMPQZ256rmibk:
558 case X86::VPCMPQZ256rri:
case X86::VPCMPQZ256rrik:
559 case X86::VPCMPQZrmi:
case X86::VPCMPQZrmik:
560 case X86::VPCMPQZrmib:
case X86::VPCMPQZrmibk:
561 case X86::VPCMPQZrri:
case X86::VPCMPQZrrik:
562 case X86::VPCMPWZ128rmi:
case X86::VPCMPWZ128rmik:
563 case X86::VPCMPWZ128rri:
case X86::VPCMPWZ128rrik:
564 case X86::VPCMPWZ256rmi:
case X86::VPCMPWZ256rmik:
565 case X86::VPCMPWZ256rri:
case X86::VPCMPWZ256rrik:
566 case X86::VPCMPWZrmi:
case X86::VPCMPWZrmik:
567 case X86::VPCMPWZrri:
case X86::VPCMPWZrrik: {
573 case X86::VPCMPBZ128rmi: NewOpc = X86::VPCMPEQBZ128rm;
break;
574 case X86::VPCMPBZ128rmik: NewOpc = X86::VPCMPEQBZ128rmk;
break;
575 case X86::VPCMPBZ128rri: NewOpc = X86::VPCMPEQBZ128rr;
break;
576 case X86::VPCMPBZ128rrik: NewOpc = X86::VPCMPEQBZ128rrk;
break;
577 case X86::VPCMPBZ256rmi: NewOpc = X86::VPCMPEQBZ256rm;
break;
578 case X86::VPCMPBZ256rmik: NewOpc = X86::VPCMPEQBZ256rmk;
break;
579 case X86::VPCMPBZ256rri: NewOpc = X86::VPCMPEQBZ256rr;
break;
580 case X86::VPCMPBZ256rrik: NewOpc = X86::VPCMPEQBZ256rrk;
break;
581 case X86::VPCMPBZrmi: NewOpc = X86::VPCMPEQBZrm;
break;
582 case X86::VPCMPBZrmik: NewOpc = X86::VPCMPEQBZrmk;
break;
583 case X86::VPCMPBZrri: NewOpc = X86::VPCMPEQBZrr;
break;
584 case X86::VPCMPBZrrik: NewOpc = X86::VPCMPEQBZrrk;
break;
585 case X86::VPCMPDZ128rmi: NewOpc = X86::VPCMPEQDZ128rm;
break;
586 case X86::VPCMPDZ128rmib: NewOpc = X86::VPCMPEQDZ128rmb;
break;
587 case X86::VPCMPDZ128rmibk: NewOpc = X86::VPCMPEQDZ128rmbk;
break;
588 case X86::VPCMPDZ128rmik: NewOpc = X86::VPCMPEQDZ128rmk;
break;
589 case X86::VPCMPDZ128rri: NewOpc = X86::VPCMPEQDZ128rr;
break;
590 case X86::VPCMPDZ128rrik: NewOpc = X86::VPCMPEQDZ128rrk;
break;
591 case X86::VPCMPDZ256rmi: NewOpc = X86::VPCMPEQDZ256rm;
break;
592 case X86::VPCMPDZ256rmib: NewOpc = X86::VPCMPEQDZ256rmb;
break;
593 case X86::VPCMPDZ256rmibk: NewOpc = X86::VPCMPEQDZ256rmbk;
break;
594 case X86::VPCMPDZ256rmik: NewOpc = X86::VPCMPEQDZ256rmk;
break;
595 case X86::VPCMPDZ256rri: NewOpc = X86::VPCMPEQDZ256rr;
break;
596 case X86::VPCMPDZ256rrik: NewOpc = X86::VPCMPEQDZ256rrk;
break;
597 case X86::VPCMPDZrmi: NewOpc = X86::VPCMPEQDZrm;
break;
598 case X86::VPCMPDZrmib: NewOpc = X86::VPCMPEQDZrmb;
break;
599 case X86::VPCMPDZrmibk: NewOpc = X86::VPCMPEQDZrmbk;
break;
600 case X86::VPCMPDZrmik: NewOpc = X86::VPCMPEQDZrmk;
break;
601 case X86::VPCMPDZrri: NewOpc = X86::VPCMPEQDZrr;
break;
602 case X86::VPCMPDZrrik: NewOpc = X86::VPCMPEQDZrrk;
break;
603 case X86::VPCMPQZ128rmi: NewOpc = X86::VPCMPEQQZ128rm;
break;
604 case X86::VPCMPQZ128rmib: NewOpc = X86::VPCMPEQQZ128rmb;
break;
605 case X86::VPCMPQZ128rmibk: NewOpc = X86::VPCMPEQQZ128rmbk;
break;
606 case X86::VPCMPQZ128rmik: NewOpc = X86::VPCMPEQQZ128rmk;
break;
607 case X86::VPCMPQZ128rri: NewOpc = X86::VPCMPEQQZ128rr;
break;
608 case X86::VPCMPQZ128rrik: NewOpc = X86::VPCMPEQQZ128rrk;
break;
609 case X86::VPCMPQZ256rmi: NewOpc = X86::VPCMPEQQZ256rm;
break;
610 case X86::VPCMPQZ256rmib: NewOpc = X86::VPCMPEQQZ256rmb;
break;
611 case X86::VPCMPQZ256rmibk: NewOpc = X86::VPCMPEQQZ256rmbk;
break;
612 case X86::VPCMPQZ256rmik: NewOpc = X86::VPCMPEQQZ256rmk;
break;
613 case X86::VPCMPQZ256rri: NewOpc = X86::VPCMPEQQZ256rr;
break;
614 case X86::VPCMPQZ256rrik: NewOpc = X86::VPCMPEQQZ256rrk;
break;
615 case X86::VPCMPQZrmi: NewOpc = X86::VPCMPEQQZrm;
break;
616 case X86::VPCMPQZrmib: NewOpc = X86::VPCMPEQQZrmb;
break;
617 case X86::VPCMPQZrmibk: NewOpc = X86::VPCMPEQQZrmbk;
break;
618 case X86::VPCMPQZrmik: NewOpc = X86::VPCMPEQQZrmk;
break;
619 case X86::VPCMPQZrri: NewOpc = X86::VPCMPEQQZrr;
break;
620 case X86::VPCMPQZrrik: NewOpc = X86::VPCMPEQQZrrk;
break;
621 case X86::VPCMPWZ128rmi: NewOpc = X86::VPCMPEQWZ128rm;
break;
622 case X86::VPCMPWZ128rmik: NewOpc = X86::VPCMPEQWZ128rmk;
break;
623 case X86::VPCMPWZ128rri: NewOpc = X86::VPCMPEQWZ128rr;
break;
624 case X86::VPCMPWZ128rrik: NewOpc = X86::VPCMPEQWZ128rrk;
break;
625 case X86::VPCMPWZ256rmi: NewOpc = X86::VPCMPEQWZ256rm;
break;
626 case X86::VPCMPWZ256rmik: NewOpc = X86::VPCMPEQWZ256rmk;
break;
627 case X86::VPCMPWZ256rri: NewOpc = X86::VPCMPEQWZ256rr;
break;
628 case X86::VPCMPWZ256rrik: NewOpc = X86::VPCMPEQWZ256rrk;
break;
629 case X86::VPCMPWZrmi: NewOpc = X86::VPCMPEQWZrm;
break;
630 case X86::VPCMPWZrmik: NewOpc = X86::VPCMPEQWZrmk;
break;
631 case X86::VPCMPWZrri: NewOpc = X86::VPCMPEQWZrr;
break;
632 case X86::VPCMPWZrrik: NewOpc = X86::VPCMPEQWZrrk;
break;
645 case X86::VPCMPBZ128rmi: NewOpc = X86::VPCMPGTBZ128rm;
break;
646 case X86::VPCMPBZ128rmik: NewOpc = X86::VPCMPGTBZ128rmk;
break;
647 case X86::VPCMPBZ128rri: NewOpc = X86::VPCMPGTBZ128rr;
break;
648 case X86::VPCMPBZ128rrik: NewOpc = X86::VPCMPGTBZ128rrk;
break;
649 case X86::VPCMPBZ256rmi: NewOpc = X86::VPCMPGTBZ256rm;
break;
650 case X86::VPCMPBZ256rmik: NewOpc = X86::VPCMPGTBZ256rmk;
break;
651 case X86::VPCMPBZ256rri: NewOpc = X86::VPCMPGTBZ256rr;
break;
652 case X86::VPCMPBZ256rrik: NewOpc = X86::VPCMPGTBZ256rrk;
break;
653 case X86::VPCMPBZrmi: NewOpc = X86::VPCMPGTBZrm;
break;
654 case X86::VPCMPBZrmik: NewOpc = X86::VPCMPGTBZrmk;
break;
655 case X86::VPCMPBZrri: NewOpc = X86::VPCMPGTBZrr;
break;
656 case X86::VPCMPBZrrik: NewOpc = X86::VPCMPGTBZrrk;
break;
657 case X86::VPCMPDZ128rmi: NewOpc = X86::VPCMPGTDZ128rm;
break;
658 case X86::VPCMPDZ128rmib: NewOpc = X86::VPCMPGTDZ128rmb;
break;
659 case X86::VPCMPDZ128rmibk: NewOpc = X86::VPCMPGTDZ128rmbk;
break;
660 case X86::VPCMPDZ128rmik: NewOpc = X86::VPCMPGTDZ128rmk;
break;
661 case X86::VPCMPDZ128rri: NewOpc = X86::VPCMPGTDZ128rr;
break;
662 case X86::VPCMPDZ128rrik: NewOpc = X86::VPCMPGTDZ128rrk;
break;
663 case X86::VPCMPDZ256rmi: NewOpc = X86::VPCMPGTDZ256rm;
break;
664 case X86::VPCMPDZ256rmib: NewOpc = X86::VPCMPGTDZ256rmb;
break;
665 case X86::VPCMPDZ256rmibk: NewOpc = X86::VPCMPGTDZ256rmbk;
break;
666 case X86::VPCMPDZ256rmik: NewOpc = X86::VPCMPGTDZ256rmk;
break;
667 case X86::VPCMPDZ256rri: NewOpc = X86::VPCMPGTDZ256rr;
break;
668 case X86::VPCMPDZ256rrik: NewOpc = X86::VPCMPGTDZ256rrk;
break;
669 case X86::VPCMPDZrmi: NewOpc = X86::VPCMPGTDZrm;
break;
670 case X86::VPCMPDZrmib: NewOpc = X86::VPCMPGTDZrmb;
break;
671 case X86::VPCMPDZrmibk: NewOpc = X86::VPCMPGTDZrmbk;
break;
672 case X86::VPCMPDZrmik: NewOpc = X86::VPCMPGTDZrmk;
break;
673 case X86::VPCMPDZrri: NewOpc = X86::VPCMPGTDZrr;
break;
674 case X86::VPCMPDZrrik: NewOpc = X86::VPCMPGTDZrrk;
break;
675 case X86::VPCMPQZ128rmi: NewOpc = X86::VPCMPGTQZ128rm;
break;
676 case X86::VPCMPQZ128rmib: NewOpc = X86::VPCMPGTQZ128rmb;
break;
677 case X86::VPCMPQZ128rmibk: NewOpc = X86::VPCMPGTQZ128rmbk;
break;
678 case X86::VPCMPQZ128rmik: NewOpc = X86::VPCMPGTQZ128rmk;
break;
679 case X86::VPCMPQZ128rri: NewOpc = X86::VPCMPGTQZ128rr;
break;
680 case X86::VPCMPQZ128rrik: NewOpc = X86::VPCMPGTQZ128rrk;
break;
681 case X86::VPCMPQZ256rmi: NewOpc = X86::VPCMPGTQZ256rm;
break;
682 case X86::VPCMPQZ256rmib: NewOpc = X86::VPCMPGTQZ256rmb;
break;
683 case X86::VPCMPQZ256rmibk: NewOpc = X86::VPCMPGTQZ256rmbk;
break;
684 case X86::VPCMPQZ256rmik: NewOpc = X86::VPCMPGTQZ256rmk;
break;
685 case X86::VPCMPQZ256rri: NewOpc = X86::VPCMPGTQZ256rr;
break;
686 case X86::VPCMPQZ256rrik: NewOpc = X86::VPCMPGTQZ256rrk;
break;
687 case X86::VPCMPQZrmi: NewOpc = X86::VPCMPGTQZrm;
break;
688 case X86::VPCMPQZrmib: NewOpc = X86::VPCMPGTQZrmb;
break;
689 case X86::VPCMPQZrmibk: NewOpc = X86::VPCMPGTQZrmbk;
break;
690 case X86::VPCMPQZrmik: NewOpc = X86::VPCMPGTQZrmk;
break;
691 case X86::VPCMPQZrri: NewOpc = X86::VPCMPGTQZrr;
break;
692 case X86::VPCMPQZrrik: NewOpc = X86::VPCMPGTQZrrk;
break;
693 case X86::VPCMPWZ128rmi: NewOpc = X86::VPCMPGTWZ128rm;
break;
694 case X86::VPCMPWZ128rmik: NewOpc = X86::VPCMPGTWZ128rmk;
break;
695 case X86::VPCMPWZ128rri: NewOpc = X86::VPCMPGTWZ128rr;
break;
696 case X86::VPCMPWZ128rrik: NewOpc = X86::VPCMPGTWZ128rrk;
break;
697 case X86::VPCMPWZ256rmi: NewOpc = X86::VPCMPGTWZ256rm;
break;
698 case X86::VPCMPWZ256rmik: NewOpc = X86::VPCMPGTWZ256rmk;
break;
699 case X86::VPCMPWZ256rri: NewOpc = X86::VPCMPGTWZ256rr;
break;
700 case X86::VPCMPWZ256rrik: NewOpc = X86::VPCMPGTWZ256rrk;
break;
701 case X86::VPCMPWZrmi: NewOpc = X86::VPCMPGTWZrm;
break;
702 case X86::VPCMPWZrmik: NewOpc = X86::VPCMPGTWZrmk;
break;
703 case X86::VPCMPWZrri: NewOpc = X86::VPCMPGTWZrr;
break;
704 case X86::VPCMPWZrrik: NewOpc = X86::VPCMPGTWZrrk;
break;
720 case X86::CALL64pcrel32:
725 case X86::EH_RETURN64: {
751 case X86::TAILJMPr64:
752 case X86::TAILJMPr64_REX:
754 case X86::TAILJMPd64:
759 case X86::TAILJMPd_CC:
760 case X86::TAILJMPd64_CC:
766 case X86::TAILJMPm64:
767 case X86::TAILJMPm64_REX:
769 "Unexpected number of operands!");
782 case X86::DEC16r: Opcode = X86::DEC16r_alt;
break;
783 case X86::DEC32r: Opcode = X86::DEC32r_alt;
break;
784 case X86::INC16r: Opcode = X86::INC16r_alt;
break;
785 case X86::INC32r: Opcode = X86::INC32r_alt;
break;
798 case X86::MOV8mr_NOREX:
800 case X86::MOV8rm_NOREX:
809 case X86::MOV8mr_NOREX:
810 case X86::MOV8mr: NewOpc = X86::MOV8o32a;
break;
811 case X86::MOV8rm_NOREX:
812 case X86::MOV8rm: NewOpc = X86::MOV8ao32;
break;
813 case X86::MOV16mr: NewOpc = X86::MOV16o32a;
break;
814 case X86::MOV16rm: NewOpc = X86::MOV16ao32;
break;
815 case X86::MOV32mr: NewOpc = X86::MOV32o32a;
break;
816 case X86::MOV32rm: NewOpc = X86::MOV32ao32;
break;
822 case X86::ADC8ri:
case X86::ADC16ri:
case X86::ADC32ri:
case X86::ADC64ri32:
823 case X86::ADD8ri:
case X86::ADD16ri:
case X86::ADD32ri:
case X86::ADD64ri32:
824 case X86::AND8ri:
case X86::AND16ri:
case X86::AND32ri:
case X86::AND64ri32:
825 case X86::CMP8ri:
case X86::CMP16ri:
case X86::CMP32ri:
case X86::CMP64ri32:
826 case X86::OR8ri:
case X86::OR16ri:
case X86::OR32ri:
case X86::OR64ri32:
827 case X86::SBB8ri:
case X86::SBB16ri:
case X86::SBB32ri:
case X86::SBB64ri32:
828 case X86::SUB8ri:
case X86::SUB16ri:
case X86::SUB32ri:
case X86::SUB64ri32:
829 case X86::TEST8ri:
case X86::TEST16ri:
case X86::TEST32ri:
case X86::TEST64ri32:
830 case X86::XOR8ri:
case X86::XOR16ri:
case X86::XOR32ri:
case X86::XOR64ri32: {
834 case X86::ADC8ri: NewOpc = X86::ADC8i8;
break;
835 case X86::ADC16ri: NewOpc = X86::ADC16i16;
break;
836 case X86::ADC32ri: NewOpc = X86::ADC32i32;
break;
837 case X86::ADC64ri32: NewOpc = X86::ADC64i32;
break;
838 case X86::ADD8ri: NewOpc = X86::ADD8i8;
break;
839 case X86::ADD16ri: NewOpc = X86::ADD16i16;
break;
840 case X86::ADD32ri: NewOpc = X86::ADD32i32;
break;
841 case X86::ADD64ri32: NewOpc = X86::ADD64i32;
break;
842 case X86::AND8ri: NewOpc = X86::AND8i8;
break;
843 case X86::AND16ri: NewOpc = X86::AND16i16;
break;
844 case X86::AND32ri: NewOpc = X86::AND32i32;
break;
845 case X86::AND64ri32: NewOpc = X86::AND64i32;
break;
846 case X86::CMP8ri: NewOpc = X86::CMP8i8;
break;
847 case X86::CMP16ri: NewOpc = X86::CMP16i16;
break;
848 case X86::CMP32ri: NewOpc = X86::CMP32i32;
break;
849 case X86::CMP64ri32: NewOpc = X86::CMP64i32;
break;
850 case X86::OR8ri: NewOpc = X86::OR8i8;
break;
851 case X86::OR16ri: NewOpc = X86::OR16i16;
break;
852 case X86::OR32ri: NewOpc = X86::OR32i32;
break;
853 case X86::OR64ri32: NewOpc = X86::OR64i32;
break;
854 case X86::SBB8ri: NewOpc = X86::SBB8i8;
break;
855 case X86::SBB16ri: NewOpc = X86::SBB16i16;
break;
856 case X86::SBB32ri: NewOpc = X86::SBB32i32;
break;
857 case X86::SBB64ri32: NewOpc = X86::SBB64i32;
break;
858 case X86::SUB8ri: NewOpc = X86::SUB8i8;
break;
859 case X86::SUB16ri: NewOpc = X86::SUB16i16;
break;
860 case X86::SUB32ri: NewOpc = X86::SUB32i32;
break;
861 case X86::SUB64ri32: NewOpc = X86::SUB64i32;
break;
862 case X86::TEST8ri: NewOpc = X86::TEST8i8;
break;
863 case X86::TEST16ri: NewOpc = X86::TEST16i16;
break;
864 case X86::TEST32ri: NewOpc = X86::TEST32i32;
break;
865 case X86::TEST64ri32: NewOpc = X86::TEST64i32;
break;
866 case X86::XOR8ri: NewOpc = X86::XOR8i8;
break;
867 case X86::XOR16ri: NewOpc = X86::XOR16i16;
break;
868 case X86::XOR32ri: NewOpc = X86::XOR32i32;
break;
869 case X86::XOR64ri32: NewOpc = X86::XOR64i32;
break;
876 case X86::MOVSX16rr8:
877 case X86::MOVSX32rr16:
878 case X86::MOVSX64rr32:
883 case X86::VCMPPDYrri:
885 case X86::VCMPPSYrri:
887 case X86::VCMPSSrr: {
906 case X86::VMOVHLPSrr:
907 case X86::VUNPCKHPDrr:
930 void X86AsmPrinter::LowerTlsAddr(X86MCInstLower &MCInstLowering,
932 bool Is64Bits = MI.
getOpcode() == X86::TLS_addr64 ||
938 case X86::TLS_addr32:
939 case X86::TLS_addr64:
942 case X86::TLS_base_addr32:
945 case X86::TLS_base_addr64:
953 MCInstLowering.GetSymbolFromOperand(MI.
getOperand(3)), SRVK, Ctx);
991 EmitAndCountInstruction(
1026 EmitAndCountInstruction(
1038 uint64_t MaxNopLength = 10;
1045 return MaxNopLength;
1062 unsigned Opc, BaseReg, ScaleVal, IndexReg, Displacement, SegmentReg;
1063 IndexReg = Displacement = SegmentReg = 0;
1076 Opc = X86::XCHG16ar;
1091 IndexReg = X86::RAX;
1097 IndexReg = X86::RAX;
1108 IndexReg = X86::RAX;
1114 IndexReg = X86::RAX;
1120 IndexReg = X86::RAX;
1121 SegmentReg = X86::CS;
1125 unsigned NumPrefixes = std::min(NumBytes - NopSize, 5U);
1126 NopSize += NumPrefixes;
1127 for (
unsigned i = 0; i != NumPrefixes; ++i)
1144 .addImm(Displacement)
1145 .addReg(SegmentReg),
1149 assert(NopSize <= NumBytes &&
"We overemitted?");
1156 unsigned NopsToEmit = NumBytes;
1159 NumBytes -=
EmitNop(OS, NumBytes, Is64Bit, STI);
1160 assert(NopsToEmit >= NumBytes &&
"Emitted more than I asked for!");
1170 : OS(OS), OldAllowAutoPadding(OS.getAllowAutoPadding()) {
1171 changeAndComment(
false);
1174 changeAndComment(OldAllowAutoPadding);
1187 void X86AsmPrinter::LowerSTATEPOINT(
const MachineInstr &MI,
1188 X86MCInstLower &MCIL) {
1189 assert(Subtarget->is64Bit() &&
"Statepoint currently only supports X86-64");
1195 EmitNops(*OutStreamer, PatchBytes, Subtarget->is64Bit(),
1201 unsigned CallOpcode;
1202 switch (CallTarget.
getType()) {
1205 CallTargetMCOp = MCIL.LowerSymbolOperand(
1206 CallTarget, MCIL.GetSymbolFromOperand(CallTarget));
1207 CallOpcode = X86::CALL64pcrel32;
1215 CallOpcode = X86::CALL64pcrel32;
1223 if (Subtarget->useRetpolineIndirectCalls())
1225 "yet implemented.");
1227 CallOpcode = X86::CALL64r;
1244 MCSymbol *MILabel = Ctx.createTempSymbol();
1246 SM.recordStatepoint(*MILabel, MI);
1249 void X86AsmPrinter::LowerFAULTING_OP(
const MachineInstr &FaultingMI,
1250 X86MCInstLower &MCIL) {
1261 unsigned OperandsBeginIdx = 4;
1264 MCSymbol *FaultingLabel = Ctx.createTempSymbol();
1268 FM.recordFaultingOp(FK, FaultingLabel, HandlerLabel);
1273 if (DefRegister != X86::NoRegister)
1279 if (
auto MaybeOperand = MCIL.LowerMachineOperand(&FaultingMI, *
I))
1286 void X86AsmPrinter::LowerFENTRY_CALL(
const MachineInstr &MI,
1287 X86MCInstLower &MCIL) {
1288 bool Is64Bits = Subtarget->is64Bit();
1294 EmitAndCountInstruction(
1295 MCInstBuilder(Is64Bits ? X86::CALL64pcrel32 : X86::CALLpcrel32)
1299 void X86AsmPrinter::LowerPATCHABLE_OP(
const MachineInstr &MI,
1300 X86MCInstLower &MCIL) {
1311 if (
auto MaybeOperand = MCIL.LowerMachineOperand(&MI, MO))
1319 if (Code.
size() < MinSize) {
1320 if (MinSize == 2 && Opcode == X86::PUSH64r) {
1328 unsigned NopSize =
EmitNop(*OutStreamer, MinSize, Subtarget->is64Bit(),
1330 assert(NopSize == MinSize &&
"Could not implement MinSize!");
1340 void X86AsmPrinter::LowerSTACKMAP(
const MachineInstr &MI) {
1344 MCSymbol *MILabel = Ctx.createTempSymbol();
1347 SM.recordStackMap(*MILabel, MI);
1349 SMShadowTracker.reset(NumShadowBytes);
1354 void X86AsmPrinter::LowerPATCHPOINT(
const MachineInstr &MI,
1355 X86MCInstLower &MCIL) {
1356 assert(Subtarget->is64Bit() &&
"Patchpoint currently only supports X86-64");
1363 MCSymbol *MILabel = Ctx.createTempSymbol();
1365 SM.recordPatchPoint(*MILabel, MI);
1369 unsigned EncodedBytes = 0;
1386 CalleeMCOp = MCIL.LowerSymbolOperand(CalleeMO,
1387 MCIL.GetSymbolFromOperand(CalleeMO));
1399 EmitAndCountInstruction(
1402 if (Subtarget->useRetpolineIndirectCalls())
1404 "Lowering patchpoint with retpoline not yet implemented.");
1405 EmitAndCountInstruction(
MCInstBuilder(X86::CALL64r).addReg(ScratchReg));
1410 assert(NumBytes >= EncodedBytes &&
1411 "Patchpoint can't request size less than the length of a call.");
1413 EmitNops(*OutStreamer, NumBytes - EncodedBytes, Subtarget->is64Bit(),
1417 void X86AsmPrinter::LowerPATCHABLE_EVENT_CALL(
const MachineInstr &MI,
1418 X86MCInstLower &MCIL) {
1419 assert(Subtarget->is64Bit() &&
"XRay custom events only supports X86-64");
1444 OutStreamer->
AddComment(
"# XRay Custom Event Log");
1455 const Register DestRegs[] = {X86::RDI, X86::RSI};
1456 bool UsedMask[] = {
false,
false};
1466 if (
auto Op = MCIL.LowerMachineOperand(&MI, MI.
getOperand(
I))) {
1467 assert(
Op->isReg() &&
"Only support arguments in registers");
1469 if (SrcRegs[
I] != DestRegs[
I]) {
1471 EmitAndCountInstruction(
1483 if (SrcRegs[
I] != DestRegs[
I])
1484 EmitAndCountInstruction(
1485 MCInstBuilder(X86::MOV64rr).addReg(DestRegs[I]).addReg(SrcRegs[I]));
1496 .
addOperand(MCIL.LowerSymbolOperand(TOp, TSym)));
1499 for (
unsigned I =
sizeof UsedMask; I-- > 0;)
1501 EmitAndCountInstruction(
MCInstBuilder(X86::POP64r).addReg(DestRegs[I]));
1505 OutStreamer->
AddComment(
"xray custom event end.");
1513 void X86AsmPrinter::LowerPATCHABLE_TYPED_EVENT_CALL(
const MachineInstr &MI,
1514 X86MCInstLower &MCIL) {
1515 assert(Subtarget->is64Bit() &&
"XRay typed events only supports X86-64");
1540 OutStreamer->
AddComment(
"# XRay Typed Event Log");
1552 const Register DestRegs[] = {X86::RDI, X86::RSI, X86::RDX};
1553 bool UsedMask[] = {
false,
false,
false};
1563 if (
auto Op = MCIL.LowerMachineOperand(&MI, MI.
getOperand(
I))) {
1565 assert(
Op->isReg() &&
"Only supports arguments in registers");
1567 if (SrcRegs[
I] != DestRegs[
I]) {
1569 EmitAndCountInstruction(
1587 EmitAndCountInstruction(
1588 MCInstBuilder(X86::MOV64rr).addReg(DestRegs[I]).addReg(SrcRegs[I]));
1599 .
addOperand(MCIL.LowerSymbolOperand(TOp, TSym)));
1602 for (
unsigned I =
sizeof UsedMask; I-- > 0;)
1604 EmitAndCountInstruction(
MCInstBuilder(X86::POP64r).addReg(DestRegs[I]));
1608 OutStreamer->
AddComment(
"xray typed event end.");
1614 void X86AsmPrinter::LowerPATCHABLE_FUNCTION_ENTER(
const MachineInstr &MI,
1615 X86MCInstLower &MCIL) {
1654 void X86AsmPrinter::LowerPATCHABLE_RET(
const MachineInstr &MI,
1655 X86MCInstLower &MCIL) {
1679 if (
auto MaybeOperand = MCIL.LowerMachineOperand(&MI, MO))
1686 void X86AsmPrinter::LowerPATCHABLE_TAIL_CALL(
const MachineInstr &MI,
1687 X86MCInstLower &MCIL) {
1718 if (
auto MaybeOperand = MCIL.LowerMachineOperand(&MI, MO))
1728 while (MBBI == MBB->
begin()) {
1754 "Expected a constant of the same type!");
1760 std::string Comment;
1767 auto GetRegisterName = [](
unsigned RegNum) ->
StringRef {
1777 SrcOp1.
isReg() ? GetRegisterName(SrcOp1.
getReg()) :
"mem";
1779 SrcOp2.
isReg() ? GetRegisterName(SrcOp2.
getReg()) :
"mem";
1783 if (Src1Name == Src2Name)
1784 for (
int i = 0,
e = ShuffleMask.size(); i !=
e; ++i)
1785 if (ShuffleMask[i] >=
e)
1786 ShuffleMask[i] -=
e;
1794 if (SrcOp1Idx > 1) {
1795 assert((SrcOp1Idx == 2 || SrcOp1Idx == 3) &&
"Unexpected writemask");
1798 if (WriteMaskOp.
isReg()) {
1799 CS <<
" {%" << GetRegisterName(WriteMaskOp.
getReg()) <<
"}";
1801 if (SrcOp1Idx == 2) {
1809 for (
int i = 0,
e = ShuffleMask.size(); i !=
e; ++i) {
1819 bool isSrc1 = ShuffleMask[i] < (int)
e;
1820 CS << (isSrc1 ? Src1Name : Src2Name) <<
'[';
1822 bool IsFirst =
true;
1824 (ShuffleMask[i] < (
int)
e) == isSrc1) {
1832 CS << ShuffleMask[i] % (int)
e;
1866 if (isa<UndefValue>(COp)) {
1868 }
else if (
auto *CI = dyn_cast<ConstantInt>(COp)) {
1870 }
else if (
auto *CF = dyn_cast<ConstantFP>(COp)) {
1877 void X86AsmPrinter::EmitSEHInstruction(
const MachineInstr *MI) {
1886 case X86::SEH_PushReg:
1889 case X86::SEH_StackAlloc:
1892 case X86::SEH_StackAlign:
1895 case X86::SEH_SetFrame:
1897 ".cv_fpo_setframe takes no offset");
1900 case X86::SEH_EndPrologue:
1903 case X86::SEH_SaveReg:
1904 case X86::SEH_SaveXMM:
1905 case X86::SEH_PushFrame:
1916 case X86::SEH_PushReg:
1920 case X86::SEH_SaveReg:
1925 case X86::SEH_SaveXMM:
1930 case X86::SEH_StackAlloc:
1934 case X86::SEH_SetFrame:
1939 case X86::SEH_PushFrame:
1943 case X86::SEH_EndPrologue:
1953 if (Info.
RegClass == X86::VR128RegClassID ||
1954 Info.
RegClass == X86::VR128XRegClassID)
1956 if (Info.
RegClass == X86::VR256RegClassID ||
1957 Info.
RegClass == X86::VR256XRegClassID)
1959 if (Info.
RegClass == X86::VR512RegClassID)
1965 X86MCInstLower MCInstLowering(*
MF, *
this);
1973 OutStreamer->
AddComment(
"EVEX TO VEX Compression ",
false);
1977 case TargetOpcode::DBG_VALUE:
1981 case X86::Int_MemBarrier:
1986 case X86::EH_RETURN64: {
2006 case X86::ENDBR64: {
2015 MCInstLowering.Lower(MI, Inst);
2016 EmitAndCountInstruction(Inst);
2027 case X86::TAILJMPd_CC:
2028 case X86::TAILJMPr64:
2029 case X86::TAILJMPm64:
2030 case X86::TAILJMPd64:
2031 case X86::TAILJMPd64_CC:
2032 case X86::TAILJMPr64_REX:
2033 case X86::TAILJMPm64_REX:
2038 case X86::TLS_addr32:
2039 case X86::TLS_addr64:
2040 case X86::TLS_base_addr32:
2041 case X86::TLS_base_addr64:
2042 return LowerTlsAddr(MCInstLowering, *MI);
2051 case X86::MASKPAIR16LOAD: {
2053 assert(Disp >= 0 && Disp <= INT32_MAX - 2 &&
"Unexpected displacement");
2055 Register Reg0 = RI->getSubReg(Reg, X86::sub_mask_0);
2056 Register Reg1 = RI->getSubReg(Reg, X86::sub_mask_1);
2062 auto Op = MCInstLowering.LowerMachineOperand(MI, MI->
getOperand(1 + i));
2065 EmitAndCountInstruction(MIB);
2074 auto Op = MCInstLowering.LowerMachineOperand(MI, MI->
getOperand(1 + i));
2078 EmitAndCountInstruction(MIB);
2082 case X86::MASKPAIR16STORE: {
2084 assert(Disp >= 0 && Disp <= INT32_MAX - 2 &&
"Unexpected displacement");
2086 Register Reg0 = RI->getSubReg(Reg, X86::sub_mask_0);
2087 Register Reg1 = RI->getSubReg(Reg, X86::sub_mask_1);
2094 EmitAndCountInstruction(MIB);
2102 auto Op = MCInstLowering.LowerMachineOperand(MI, MI->
getOperand(0 + i));
2107 EmitAndCountInstruction(MIB);
2111 case X86::MOVPC32r: {
2122 EmitAndCountInstruction(
2128 bool hasFP = FrameLowering->
hasFP(*
MF);
2136 if (HasActiveDwarfFrame && !hasFP) {
2144 EmitAndCountInstruction(
2147 if (HasActiveDwarfFrame && !hasFP) {
2153 case X86::ADD32ri: {
2185 case TargetOpcode::STATEPOINT:
2186 return LowerSTATEPOINT(*MI, MCInstLowering);
2188 case TargetOpcode::FAULTING_OP:
2189 return LowerFAULTING_OP(*MI, MCInstLowering);
2191 case TargetOpcode::FENTRY_CALL:
2192 return LowerFENTRY_CALL(*MI, MCInstLowering);
2194 case TargetOpcode::PATCHABLE_OP:
2195 return LowerPATCHABLE_OP(*MI, MCInstLowering);
2197 case TargetOpcode::STACKMAP:
2198 return LowerSTACKMAP(*MI);
2200 case TargetOpcode::PATCHPOINT:
2201 return LowerPATCHPOINT(*MI, MCInstLowering);
2203 case TargetOpcode::PATCHABLE_FUNCTION_ENTER:
2204 return LowerPATCHABLE_FUNCTION_ENTER(*MI, MCInstLowering);
2206 case TargetOpcode::PATCHABLE_RET:
2207 return LowerPATCHABLE_RET(*MI, MCInstLowering);
2209 case TargetOpcode::PATCHABLE_TAIL_CALL:
2210 return LowerPATCHABLE_TAIL_CALL(*MI, MCInstLowering);
2212 case TargetOpcode::PATCHABLE_EVENT_CALL:
2213 return LowerPATCHABLE_EVENT_CALL(*MI, MCInstLowering);
2215 case TargetOpcode::PATCHABLE_TYPED_EVENT_CALL:
2216 return LowerPATCHABLE_TYPED_EVENT_CALL(*MI, MCInstLowering);
2218 case X86::MORESTACK_RET:
2222 case X86::MORESTACK_RET_RESTORE_R10:
2225 EmitAndCountInstruction(
2226 MCInstBuilder(X86::MOV64rr).addReg(X86::R10).addReg(X86::RAX));
2229 case X86::SEH_PushReg:
2230 case X86::SEH_SaveReg:
2231 case X86::SEH_SaveXMM:
2232 case X86::SEH_StackAlloc:
2233 case X86::SEH_StackAlign:
2234 case X86::SEH_SetFrame:
2235 case X86::SEH_PushFrame:
2236 case X86::SEH_EndPrologue:
2237 EmitSEHInstruction(MI);
2240 case X86::SEH_Epilogue: {
2249 if (!MBBI->isPseudo()) {
2262 case X86::VPSHUFBrm:
2263 case X86::VPSHUFBYrm:
2264 case X86::VPSHUFBZ128rm:
2265 case X86::VPSHUFBZ128rmk:
2266 case X86::VPSHUFBZ128rmkz:
2267 case X86::VPSHUFBZ256rm:
2268 case X86::VPSHUFBZ256rmk:
2269 case X86::VPSHUFBZ256rmkz:
2270 case X86::VPSHUFBZrm:
2271 case X86::VPSHUFBZrmk:
2272 case X86::VPSHUFBZrmkz: {
2275 unsigned SrcIdx, MaskIdx;
2279 case X86::VPSHUFBrm:
2280 case X86::VPSHUFBYrm:
2281 case X86::VPSHUFBZ128rm:
2282 case X86::VPSHUFBZ256rm:
2283 case X86::VPSHUFBZrm:
2284 SrcIdx = 1; MaskIdx = 5;
break;
2285 case X86::VPSHUFBZ128rmkz:
2286 case X86::VPSHUFBZ256rmkz:
2287 case X86::VPSHUFBZrmkz:
2288 SrcIdx = 2; MaskIdx = 6;
break;
2289 case X86::VPSHUFBZ128rmk:
2290 case X86::VPSHUFBZ256rmk:
2291 case X86::VPSHUFBZrmk:
2292 SrcIdx = 3; MaskIdx = 7;
break;
2296 "We should always have at least 6 operands!");
2309 case X86::VPERMILPSrm:
2310 case X86::VPERMILPSYrm:
2311 case X86::VPERMILPSZ128rm:
2312 case X86::VPERMILPSZ128rmk:
2313 case X86::VPERMILPSZ128rmkz:
2314 case X86::VPERMILPSZ256rm:
2315 case X86::VPERMILPSZ256rmk:
2316 case X86::VPERMILPSZ256rmkz:
2317 case X86::VPERMILPSZrm:
2318 case X86::VPERMILPSZrmk:
2319 case X86::VPERMILPSZrmkz:
2320 case X86::VPERMILPDrm:
2321 case X86::VPERMILPDYrm:
2322 case X86::VPERMILPDZ128rm:
2323 case X86::VPERMILPDZ128rmk:
2324 case X86::VPERMILPDZ128rmkz:
2325 case X86::VPERMILPDZ256rm:
2326 case X86::VPERMILPDZ256rmk:
2327 case X86::VPERMILPDZ256rmkz:
2328 case X86::VPERMILPDZrm:
2329 case X86::VPERMILPDZrmk:
2330 case X86::VPERMILPDZrmkz: {
2333 unsigned SrcIdx, MaskIdx;
2337 case X86::VPERMILPSrm:
2338 case X86::VPERMILPSYrm:
2339 case X86::VPERMILPSZ128rm:
2340 case X86::VPERMILPSZ256rm:
2341 case X86::VPERMILPSZrm:
2342 SrcIdx = 1; MaskIdx = 5; ElSize = 32;
break;
2343 case X86::VPERMILPSZ128rmkz:
2344 case X86::VPERMILPSZ256rmkz:
2345 case X86::VPERMILPSZrmkz:
2346 SrcIdx = 2; MaskIdx = 6; ElSize = 32;
break;
2347 case X86::VPERMILPSZ128rmk:
2348 case X86::VPERMILPSZ256rmk:
2349 case X86::VPERMILPSZrmk:
2350 SrcIdx = 3; MaskIdx = 7; ElSize = 32;
break;
2351 case X86::VPERMILPDrm:
2352 case X86::VPERMILPDYrm:
2353 case X86::VPERMILPDZ128rm:
2354 case X86::VPERMILPDZ256rm:
2355 case X86::VPERMILPDZrm:
2356 SrcIdx = 1; MaskIdx = 5; ElSize = 64;
break;
2357 case X86::VPERMILPDZ128rmkz:
2358 case X86::VPERMILPDZ256rmkz:
2359 case X86::VPERMILPDZrmkz:
2360 SrcIdx = 2; MaskIdx = 6; ElSize = 64;
break;
2361 case X86::VPERMILPDZ128rmk:
2362 case X86::VPERMILPDZ256rmk:
2363 case X86::VPERMILPDZrmk:
2364 SrcIdx = 3; MaskIdx = 7; ElSize = 64;
break;
2368 "We should always have at least 6 operands!");
2381 case X86::VPERMIL2PDrm:
2382 case X86::VPERMIL2PSrm:
2383 case X86::VPERMIL2PDYrm:
2384 case X86::VPERMIL2PSYrm: {
2388 "We should always have at least 8 operands!");
2391 if (!CtrlOp.isImm())
2397 case X86::VPERMIL2PSrm:
case X86::VPERMIL2PSYrm: ElSize = 32;
break;
2398 case X86::VPERMIL2PDrm:
case X86::VPERMIL2PDYrm: ElSize = 64;
break;
2412 case X86::VPPERMrrm: {
2416 "We should always have at least 7 operands!");
2429 case X86::MMX_MOVQ64rm: {
2435 std::string Comment;
2439 if (
auto *CF = dyn_cast<ConstantFP>(
C)) {
2440 CS <<
"0x" << CF->getValueAPF().bitcastToAPInt().toString(16,
false);
2447 #define MOV_CASE(Prefix, Suffix) \ 2448 case X86::Prefix##MOVAPD##Suffix##rm: \ 2449 case X86::Prefix##MOVAPS##Suffix##rm: \ 2450 case X86::Prefix##MOVUPD##Suffix##rm: \ 2451 case X86::Prefix##MOVUPS##Suffix##rm: \ 2452 case X86::Prefix##MOVDQA##Suffix##rm: \ 2453 case X86::Prefix##MOVDQU##Suffix##rm: 2455 #define MOV_AVX512_CASE(Suffix) \ 2456 case X86::VMOVDQA64##Suffix##rm: \ 2457 case X86::VMOVDQA32##Suffix##rm: \ 2458 case X86::VMOVDQU64##Suffix##rm: \ 2459 case X86::VMOVDQU32##Suffix##rm: \ 2460 case X86::VMOVDQU16##Suffix##rm: \ 2461 case X86::VMOVDQU8##Suffix##rm: \ 2462 case X86::VMOVAPS##Suffix##rm: \ 2463 case X86::VMOVAPD##Suffix##rm: \ 2464 case X86::VMOVUPS##Suffix##rm: \ 2465 case X86::VMOVUPD##Suffix##rm: 2467 #define CASE_ALL_MOV_RM() \ 2471 MOV_AVX512_CASE(Z) \ 2472 MOV_AVX512_CASE(Z256) \ 2473 MOV_AVX512_CASE(Z128) 2478 case X86::VBROADCASTF128:
2479 case X86::VBROADCASTI128:
2480 case X86::VBROADCASTF32X4Z256rm:
2481 case X86::VBROADCASTF32X4rm:
2482 case X86::VBROADCASTF32X8rm:
2483 case X86::VBROADCASTF64X2Z128rm:
2484 case X86::VBROADCASTF64X2rm:
2485 case X86::VBROADCASTF64X4rm:
2486 case X86::VBROADCASTI32X4Z256rm:
2487 case X86::VBROADCASTI32X4rm:
2488 case X86::VBROADCASTI32X8rm:
2489 case X86::VBROADCASTI64X2Z128rm:
2490 case X86::VBROADCASTI64X2rm:
2491 case X86::VBROADCASTI64X4rm:
2500 case X86::VBROADCASTF128: NumLanes = 2;
break;
2501 case X86::VBROADCASTI128: NumLanes = 2;
break;
2502 case X86::VBROADCASTF32X4Z256rm: NumLanes = 2;
break;
2503 case X86::VBROADCASTF32X4rm: NumLanes = 4;
break;
2504 case X86::VBROADCASTF32X8rm: NumLanes = 2;
break;
2505 case X86::VBROADCASTF64X2Z128rm: NumLanes = 2;
break;
2506 case X86::VBROADCASTF64X2rm: NumLanes = 4;
break;
2507 case X86::VBROADCASTF64X4rm: NumLanes = 2;
break;
2508 case X86::VBROADCASTI32X4Z256rm: NumLanes = 2;
break;
2509 case X86::VBROADCASTI32X4rm: NumLanes = 4;
break;
2510 case X86::VBROADCASTI32X8rm: NumLanes = 2;
break;
2511 case X86::VBROADCASTI64X2Z128rm: NumLanes = 2;
break;
2512 case X86::VBROADCASTI64X2rm: NumLanes = 4;
break;
2513 case X86::VBROADCASTI64X4rm: NumLanes = 2;
break;
2516 std::string Comment;
2520 if (
auto *CDS = dyn_cast<ConstantDataSequential>(
C)) {
2522 for (
int l = 0; l != NumLanes; ++l) {
2523 for (
int i = 0, NumElements = CDS->getNumElements(); i < NumElements;
2525 if (i != 0 || l != 0)
2527 if (CDS->getElementType()->isIntegerTy())
2529 else if (CDS->getElementType()->isHalfTy() ||
2530 CDS->getElementType()->isFloatTy() ||
2531 CDS->getElementType()->isDoubleTy())
2539 }
else if (
auto *CV = dyn_cast<ConstantVector>(
C)) {
2541 for (
int l = 0; l != NumLanes; ++l) {
2542 for (
int i = 0, NumOperands = CV->getNumOperands(); i < NumOperands;
2544 if (i != 0 || l != 0)
2554 case X86::MOVDDUPrm:
2555 case X86::VMOVDDUPrm:
2556 case X86::VMOVDDUPZ128rm:
2557 case X86::VBROADCASTSSrm:
2558 case X86::VBROADCASTSSYrm:
2559 case X86::VBROADCASTSSZ128m:
2560 case X86::VBROADCASTSSZ256m:
2561 case X86::VBROADCASTSSZm:
2562 case X86::VBROADCASTSDYrm:
2563 case X86::VBROADCASTSDZ256m:
2564 case X86::VBROADCASTSDZm:
2565 case X86::VPBROADCASTBrm:
2566 case X86::VPBROADCASTBYrm:
2567 case X86::VPBROADCASTBZ128m:
2568 case X86::VPBROADCASTBZ256m:
2569 case X86::VPBROADCASTBZm:
2570 case X86::VPBROADCASTDrm:
2571 case X86::VPBROADCASTDYrm:
2572 case X86::VPBROADCASTDZ128m:
2573 case X86::VPBROADCASTDZ256m:
2574 case X86::VPBROADCASTDZm:
2575 case X86::VPBROADCASTQrm:
2576 case X86::VPBROADCASTQYrm:
2577 case X86::VPBROADCASTQZ128m:
2578 case X86::VPBROADCASTQZ256m:
2579 case X86::VPBROADCASTQZm:
2580 case X86::VPBROADCASTWrm:
2581 case X86::VPBROADCASTWYrm:
2582 case X86::VPBROADCASTWZ128m:
2583 case X86::VPBROADCASTWZ256m:
2584 case X86::VPBROADCASTWZm:
2593 case X86::MOVDDUPrm: NumElts = 2;
break;
2594 case X86::VMOVDDUPrm: NumElts = 2;
break;
2595 case X86::VMOVDDUPZ128rm: NumElts = 2;
break;
2596 case X86::VBROADCASTSSrm: NumElts = 4;
break;
2597 case X86::VBROADCASTSSYrm: NumElts = 8;
break;
2598 case X86::VBROADCASTSSZ128m: NumElts = 4;
break;
2599 case X86::VBROADCASTSSZ256m: NumElts = 8;
break;
2600 case X86::VBROADCASTSSZm: NumElts = 16;
break;
2601 case X86::VBROADCASTSDYrm: NumElts = 4;
break;
2602 case X86::VBROADCASTSDZ256m: NumElts = 4;
break;
2603 case X86::VBROADCASTSDZm: NumElts = 8;
break;
2604 case X86::VPBROADCASTBrm: NumElts = 16;
break;
2605 case X86::VPBROADCASTBYrm: NumElts = 32;
break;
2606 case X86::VPBROADCASTBZ128m: NumElts = 16;
break;
2607 case X86::VPBROADCASTBZ256m: NumElts = 32;
break;
2608 case X86::VPBROADCASTBZm: NumElts = 64;
break;
2609 case X86::VPBROADCASTDrm: NumElts = 4;
break;
2610 case X86::VPBROADCASTDYrm: NumElts = 8;
break;
2611 case X86::VPBROADCASTDZ128m: NumElts = 4;
break;
2612 case X86::VPBROADCASTDZ256m: NumElts = 8;
break;
2613 case X86::VPBROADCASTDZm: NumElts = 16;
break;
2614 case X86::VPBROADCASTQrm: NumElts = 2;
break;
2615 case X86::VPBROADCASTQYrm: NumElts = 4;
break;
2616 case X86::VPBROADCASTQZ128m: NumElts = 2;
break;
2617 case X86::VPBROADCASTQZ256m: NumElts = 4;
break;
2618 case X86::VPBROADCASTQZm: NumElts = 8;
break;
2619 case X86::VPBROADCASTWrm: NumElts = 8;
break;
2620 case X86::VPBROADCASTWYrm: NumElts = 16;
break;
2621 case X86::VPBROADCASTWZ128m: NumElts = 8;
break;
2622 case X86::VPBROADCASTWZ256m: NumElts = 16;
break;
2623 case X86::VPBROADCASTWZm: NumElts = 32;
break;
2626 std::string Comment;
2631 for (
int i = 0; i != NumElts; ++i) {
2642 MCInstLowering.Lower(MI, TmpInst);
2659 EmitAndCountInstruction(TmpInst);
unsigned getTargetFlags() const
MO_SECREL - On a symbol operand this indicates that the immediate is the offset from beginning of sec...
const MCAsmInfo * getAsmInfo() const
bool is64Bit() const
Is this x86_64? (disregarding specific ABI / programming model)
A parsed version of the target data layout string in and methods for querying it. ...
mop_iterator operands_end()
raw_ostream & errs()
This returns a reference to a raw_ostream for standard error.
union llvm::MachineConstantPoolEntry::@168 Val
The constant itself.
unsigned getNextScratchIdx(unsigned StartIdx=0) const
Get the next scratch register operand index.
static const char * getRegisterName(unsigned RegNo)
uint64_t getZExtValue() const
Get zero extended value.
MO_COFFSTUB - On a symbol operand "FOO", this indicates that the reference is actually to the "...
virtual bool emitFPOSetFrame(unsigned Reg, SMLoc L={})=0
bool isCall(QueryType Type=AnyInBundle) const
MachineBasicBlock * getMBB() const
std::unique_ptr< MCStreamer > OutStreamer
This is the MCStreamer object for the file we are generating.
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
MCTargetOptions MCOptions
Machine level options.
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
This class represents lattice values for constants.
PointerTy getPointer() const
void setTargetFlags(unsigned F)
StringRef getPrivateGlobalPrefix() const
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
void DecodeVPPERMMask(ArrayRef< uint64_t > RawMask, const APInt &UndefElts, SmallVectorImpl< int > &ShuffleMask)
Decode a VPPERM mask from a raw array of constants such as from BUILD_VECTOR.
MO_TLSLD - On a symbol operand this indicates that the immediate is the offset of the GOT entry with ...
bool isCommutable() const
Return true if this may be a 2- or 3-address instruction (of the form "X = op Y, Z, ..."), which produces the same result if Y and Z are exchanged.
amdgpu Simplify well known AMD library false FunctionCallee Value const Twine & Name
MO_TLVP_PIC_BASE - On a symbol operand this indicates that the immediate is some TLS offset from the ...
MCContext & OutContext
This is the context for the output file that we are streaming.
static MachineModuleInfoMachO & getMachOMMI(AsmPrinter &AP)
static MCOperand createExpr(const MCExpr *Val)
unsigned getNumWords() const
Get the number of words.
const MCSubtargetInfo & getSubtargetInfo() const
Return information about subtarget.
This provides a very simple, boring adaptor for a begin and end iterator into a range type...
virtual void EmitBytes(StringRef Data)
Emit the bytes in Data into the output.
Address of indexed Jump Table for switch.
This class represents a function call, abstracting a target machine's calling convention.
AddrNumOperands - Total number of operands in a memory reference.
PointerIntPair< MCSymbol *, 1, bool > StubValueTy
static std::string getShuffleComment(const MachineInstr *MI, unsigned SrcOp1Idx, unsigned SrcOp2Idx, ArrayRef< int > Mask)
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
A raw_ostream that writes to an SmallVector or SmallString.
MachineBasicBlock reference.
MachineFunction * MF
The current machine function.
bool isCPI() const
isCPI - Tests if this is a MO_ConstantPoolIndex operand.
MachineInstrBundleIterator< const MachineInstr > const_iterator
MO_GOTPCREL - On a symbol operand this indicates that the immediate is offset to the GOT entry for th...
MO_DTPOFF - On a symbol operand this indicates that the immediate is the offset of the GOT entry with...
static unsigned MaxLongNopLength(const MCSubtargetInfo &STI)
Return the longest nop which can be efficiently decoded for the given target cpu. ...
static void EmitNops(MCStreamer &OS, unsigned NumBytes, bool Is64Bit, const MCSubtargetInfo &STI)
Emit the optimal amount of multi-byte nops on X86.
virtual bool emitFPOPushReg(unsigned Reg, SMLoc L={})=0
iterator_range< mop_iterator > operands()
print alias Alias Set Printer
bool isImm() const
isImm - Tests if this is a MO_Immediate operand.
MCRegister getX86SubSuperRegister(MCRegister, unsigned, bool High=false)
Returns the sub or super register of a specific X86 register.
unsigned getSlotSize() const
virtual void EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI)
Emit the given Instruction into the current section.
bool canRelaxRelocations() const
unsigned getBitWidth() const
Return the number of bits in the APInt.
MRMSrcReg - This form is used for instructions that use the Mod/RM byte to specify a source...
Mask of preserved registers.
MCSymbol * CurrentPatchableFunctionEntrySym
The symbol for the entry in __patchable_function_entires.
static MCDisassembler::DecodeStatus addOperand(MCInst &Inst, const MCOperand &Opnd)
bool getAllowAutoPadding() const
MCContext & getContext() const
void recordSled(MCSymbol *Sled, const MachineInstr &MI, SledKind Kind, uint8_t Version=0)
CLEANUPRET - Represents a return from a cleanup block funclet.
unsigned getNumFrameInfos()
MO_DARWIN_NONLAZY_PIC_BASE - On a symbol operand "FOO", this indicates that the reference is actually...
bool isMachineConstantPoolEntry() const
isMachineConstantPoolEntry - Return true if the MachineConstantPoolEntry is indeed a target specific ...
static MCOperand createReg(unsigned Reg)
This file declares the MachineConstantPool class which is an abstract constant pool to keep track of ...
virtual bool emitFPOStackAlloc(unsigned StackAlloc, SMLoc L={})=0
const FeatureBitset & getFeatureBits() const
MachineModuleInfoCOFF - This is a MachineModuleInfoImpl implementation for COFF targets.
unsigned getNumOperands() const
Retuns the total number of operands.
void DecodeVPERMILPMask(unsigned NumElts, unsigned ScalarBits, ArrayRef< uint64_t > RawMask, const APInt &UndefElts, SmallVectorImpl< int > &ShuffleMask)
Decode a VPERMILPD/VPERMILPS variable mask from a raw array of constants.
virtual void encodeInstruction(const MCInst &Inst, raw_ostream &OS, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI) const =0
EncodeInstruction - Encode the given Inst to bytes on the output stream OS.
Base class for the full range of assembler expressions which are needed for parsing.
Name of external global symbol.
Represent a reference to a symbol from inside an expression.
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
virtual void EmitWinCFISetFrame(MCRegister Register, unsigned Offset, SMLoc Loc=SMLoc())
const char * getSymbolName() const
#define CASE_ALL_MOV_RM()
LLVM_NODISCARD bool empty() const
empty - Check if the string is empty.
unsigned getReg() const
Returns the register number.
Context object for machine code objects.
virtual void AddComment(const Twine &T, bool EOL=true)
Add a textual comment.
bool hasFP(const MachineFunction &MF) const override
hasFP - Return true if the specified function should have a dedicated frame pointer register...
const MCInstrDesc & getDesc() const
Returns the target instruction descriptor of this MachineInstr.
Type * getType() const
All values are typed, get the type of this value.
static const MCBinaryExpr * createSub(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
void toString(SmallVectorImpl< char > &Str, unsigned FormatPrecision=0, unsigned FormatMaxPadding=3, bool TruncateZero=true) const
bool isPositionIndependent() const
MO_GOT - On a symbol operand this indicates that the immediate is the offset to the GOT entry for the...
virtual void EmitWinCFISaveXMM(MCRegister Register, unsigned Offset, SMLoc Loc=SMLoc())
MO_GOTTPOFF - On a symbol operand this indicates that the immediate is the offset of the GOT entry wi...
MO_ABS8 - On a symbol operand this indicates that the symbol is known to be an absolute symbol in ran...
ArrayRef< MCDwarfFrameInfo > getDwarfFrameInfos() const
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
virtual void EmitWinCFISaveReg(MCRegister Register, unsigned Offset, SMLoc Loc=SMLoc())
virtual void emitRawComment(const Twine &T, bool TabPrefix=true)
Print T and prefix it with the comment string (normally #) and optionally a tab.
This class is a data container for one entry in a MachineConstantPool.
virtual void EmitBinaryData(StringRef Data)
Functionally identical to EmitBytes.
const MCExpr * getExpr() const
static const MCBinaryExpr * createAdd(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
MO_DARWIN_NONLAZY - On a symbol operand "FOO", this indicates that the reference is actually to the "...
MCInstBuilder & addOperand(const MCOperand &Op)
Add an operand.
MachineModuleInfo * MMI
This is a pointer to the current MachineModuleInfo.
Analysis containing CSE Info
Instances of this class represent a single low-level machine instruction.
auto count(R &&Range, const E &Element) -> typename std::iterator_traits< decltype(adl_begin(Range))>::difference_type
Wrapper function around std::count to count the number of times an element Element occurs in the give...
static const MCConstantExpr * create(int64_t Value, MCContext &Ctx, bool PrintInHex=false)
virtual bool emitFPOStackAlign(unsigned Align, SMLoc L={})=0
bool isX86_64ExtendedReg(unsigned RegNo)
const Constant * ConstVal
This class is intended to be used as a base class for asm properties and features specific to the tar...
Address of a global value.
Streaming machine code generation interface.
MCInstBuilder & addReg(unsigned Reg)
Add a new register operand.
MCSymbol * createTempSymbol(bool CanBeUnnamed=true)
Create and return a new assembler temporary symbol with a unique but unspecified name.
MCSymbol * CurrentFnBegin
MCTargetStreamer * getTargetStreamer()
const MachineOperand & getCallTarget() const
Returns the target of the underlying call.
MO_GOT_ABSOLUTE_ADDRESS - On a symbol operand, this represents a relocation of: SYMBOL_LABEL + [...
PointerIntPair - This class implements a pair of a pointer and small integer.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
MO_GOTNTPOFF - On a symbol operand this indicates that the immediate is the offset of the GOT entry w...
MO_TLVP - On a symbol operand this indicates that the immediate is some TLS offset.
virtual void EmitWinCFIPushReg(MCRegister Register, SMLoc Loc=SMLoc())
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
This is an important base class in LLVM.
const GlobalValue * getGlobal() const
MO_TLSLDM - On a symbol operand this indicates that the immediate is the offset of the GOT entry with...
MCCodeEmitter - Generic instruction encoding interface.
TargetMachine & TM
Target machine description.
This class is intended to be used as a driving class for all asm writers.
void getNameWithPrefix(SmallVectorImpl< char > &Name, const GlobalValue *GV) const
bool hasInternalLinkage() const
Address of a basic block.
static unsigned convertTailJumpOpcode(unsigned Opcode)
static void SimplifyShortMoveForm(X86AsmPrinter &Printer, MCInst &Inst, unsigned Opcode)
Simplify things like MOV32rm to MOV32o32a.
MO_NTPOFF - On a symbol operand this indicates that the immediate is the negative thread-pointer offs...
MCInstBuilder & addImm(int64_t Val)
Add a new integer immediate operand.
MI-level patchpoint operands.
unsigned getNumOperands() const
void print(raw_ostream &OS, bool IsStandalone=true, bool SkipOpers=false, bool SkipDebugLoc=false, bool AddNewLine=true, const TargetInstrInfo *TII=nullptr) const
Print this MI to OS.
MachineConstantPool * getConstantPool()
getConstantPool - Return the constant pool object for the current function.
static const Constant * getConstantFromPool(const MachineInstr &MI, const MachineOperand &Op)
const MachineBasicBlock & front() const
virtual MCSymbol * GetCPISymbol(unsigned CPID) const
Return the symbol for the specified constant pool entry.
StubValueTy & getGVStubEntry(MCSymbol *Sym)
void DecodeVPERMIL2PMask(unsigned NumElts, unsigned ScalarBits, unsigned M2Z, ArrayRef< uint64_t > RawMask, const APInt &UndefElts, SmallVectorImpl< int > &ShuffleMask)
Decode a VPERMIL2PD/VPERMIL2PS variable mask from a raw array of constants.
std::string & str()
Flushes the stream contents to the target string and returns the string's reference.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
void changeAndComment(bool b)
MO_TLSGD - On a symbol operand this indicates that the immediate is the offset of the GOT entry with ...
std::enable_if< std::numeric_limits< T >::is_signed, bool >::type getAsInteger(unsigned Radix, T &Result) const
Parse the current string as an integer of the specified radix.
const std::vector< MachineConstantPoolEntry > & getConstants() const
virtual void EmitWinCFIPushFrame(bool Code, SMLoc Loc=SMLoc())
MO_TPOFF - On a symbol operand this indicates that the immediate is the thread-pointer offset for the...
static void printConstant(const APInt &Val, raw_ostream &CS)
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
void setOpcode(unsigned Op)
MCSymbol * GetBlockAddressSymbol(const BlockAddress *BA) const
Return the MCSymbol used to satisfy BlockAddress uses of the specified basic block.
bool isJTI() const
isJTI - Tests if this is a MO_JumpTableIndex operand.
bool isGlobal() const
isGlobal - Tests if this is a MO_GlobalAddress operand.
static MCOperand LowerSymbolOperand(const MachineInstr *MI, const MachineOperand &MO, AsmPrinter &AP)
MCSymbol * getSymbol(const GlobalValue *GV) const
MachineOperand class - Representation of each machine instruction operand.
AddrSegmentReg - The operand # of the segment in the memory operand.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
virtual void EmitWinCFIEndProlog(SMLoc Loc=SMLoc())
virtual void EmitCodeAlignment(unsigned ByteAlignment, unsigned MaxBytesToEmit=0)
Emit nops until the byte alignment ByteAlignment is reached.
const MCOperand & getOperand(unsigned i) const
virtual void EmitWinCFIAllocStack(unsigned Size, SMLoc Loc=SMLoc())
X86 target streamer implementing x86-only assembly directives.
const Function & getFunction() const
Return the LLVM function that this machine code represents.
MCSymbol reference (for debug/eh info)
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
StubValueTy & getGVStubEntry(MCSymbol *Sym)
Target - Wrapper for Target specific information.
Class for arbitrary precision integers.
virtual bool emitFPOEndPrologue(SMLoc L={})=0
bool getRtLibUseGOT() const
Returns true if PLT should be avoided for RTLib calls.
CATCHRET - Represents a return from a catch block funclet.
const MachineBasicBlock * getParent() const
const bool OldAllowAutoPadding
const uint64_t * getRawData() const
This function returns a pointer to the internal storage of the APInt.
Representation of each machine instruction.
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
MO_GOTOFF - On a symbol operand this indicates that the immediate is the offset to the location of th...
static unsigned getRetOpcode(const X86Subtarget &Subtarget)
MCSymbol * GetJTISymbol(unsigned JTID, bool isLinkerPrivate=false) const
Return the symbol for the specified jump table entry.
MO_INDNTPOFF - On a symbol operand this indicates that the immediate is the absolute address of the G...
MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
StringRef getValueAsString() const
Return the attribute's value as a string.
int16_t RegClass
This specifies the register class enumeration of the operand if the operand is a register.
int64_t getOffset() const
Return the offset from the symbol in this operand.
const BlockAddress * getBlockAddress() const
MCSymbol * getSymbol() const
Return the MCSymbol for this basic block.
Generic base class for all target subtargets.
MI-level Statepoint operands.
void setAllowAutoPadding(bool v)
uint32_t getNumPatchBytes() const
Return the number of patchable bytes the given patchpoint should emit.
void EmitInstruction(const MachineInstr *MI) override
Targets should implement this to emit instructions.
bool isSymbol() const
isSymbol - Tests if this is a MO_ExternalSymbol operand.
const Module * getModule() const
MachineModuleInfoMachO - This is a MachineModuleInfoImpl implementation for MachO targets...
bool isReg() const
isReg - Tests if this is a MO_Register operand.
OUTCHAIN = EH_RETURN(INCHAIN, OFFSET, HANDLER) - This node represents 'eh_return' gcc dwarf builtin...
MO_PLT - On a symbol operand this indicates that the immediate is offset to the PLT entry of symbol n...
StringRef getName() const
getName - Get the symbol name.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
NoAutoPaddingScope(MCStreamer &OS)
uint32_t getNumPatchBytes() const
Return the number of patchable bytes the given statepoint should emit.
A raw_ostream that writes to an std::string.
MCSymbol * getMCSymbol() const
mop_iterator operands_begin()
MCSymbol * getPICBaseSymbol() const
getPICBaseSymbol - Return a function-local symbol to represent the PIC base.
const MCOperandInfo * OpInfo
std::underlying_type< E >::type Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
virtual void EmitLabel(MCSymbol *Symbol, SMLoc Loc=SMLoc())
Emit a label for Symbol into the current section.
Attribute getFnAttribute(Attribute::AttrKind Kind) const
Return the attribute for the given attribute kind.
This class implements an extremely fast bulk output stream that can only output to a stream...
Primary interface to the complete machine description for the target machine.
MO_PIC_BASE_OFFSET - On a symbol operand this indicates that the immediate should get the value of th...
void getNameWithPrefix(raw_ostream &OS, const GlobalValue *GV, bool CannotUsePrivateLabel) const
Print the appropriate prefix and the specified global variable's name.
static MachineBasicBlock::const_iterator PrevCrossBBInst(MachineBasicBlock::const_iterator MBBI)
const MachineOperand & getCallTarget() const
Returns the target of the underlying call.
void addOperand(const MCOperand &Op)
StringRef - Represent a constant reference to a string, i.e.
bool isMBB() const
isMBB - Tests if this is a MO_MachineBasicBlock operand.
Address of indexed Constant in Constant Pool.
static MCSymbol * GetSymbolFromOperand(const MachineOperand &MO, AsmPrinter &AP)
Register getReg() const
getReg - Returns the register number.
This holds information about one operand of a machine instruction, indicating the register class for ...
unsigned getOpcode() const
virtual bool isVerboseAsm() const
Return true if this streamer supports verbose assembly and if it is enabled.
const MachineOperand & getOperand(unsigned i) const
Instances of this class represent operands of the MCInst class.
MachineOperandType getType() const
getType - Returns the MachineOperandType for this operand.
MCSymbol * createTempSymbol(const Twine &Name) const
static MCOperand createImm(int64_t Val)
A RAII helper which defines a region of instructions which can't have padding added between them for ...
static unsigned EmitNop(MCStreamer &OS, unsigned NumBytes, bool Is64Bit, const MCSubtargetInfo &STI)
Emit the largest nop instruction smaller than or equal to NumBytes bytes.
const X86Subtarget & getSubtarget() const
static void SimplifyShortImmForm(MCInst &Inst, unsigned Opcode)
Simplify FOO $imm, %{al,ax,eax,rax} to FOO $imm, for instruction with a short fixed-register form...
virtual void EmitCFIAdjustCfaOffset(int64_t Adjustment)
static void SimplifyMOVSX(MCInst &Inst)
If a movsx instruction has a shorter encoding for the used register simplify the instruction to use i...
uint8_t getAsmPrinterFlags() const
Return the asm printer flags bitvector.
Wrapper class representing virtual and physical registers.
MO_DLLIMPORT - On a symbol operand "FOO", this indicates that the reference is actually to the "__imp...
static MachineOperand CreateMCSymbol(MCSymbol *Sym, unsigned TargetFlags=0)
void DecodePSHUFBMask(ArrayRef< uint64_t > RawMask, const APInt &UndefElts, SmallVectorImpl< int > &ShuffleMask)
Decode a PSHUFB mask from a raw array of constants such as from BUILD_VECTOR.
static unsigned getRegisterWidth(const MCOperandInfo &Info)