llvm.org GIT mirror llvm / f780acf
[X86][SSE] Merged SHUF/PERM shuffle decode comments. NFC. Now that we can recognise different vector sizes - will make future AVX512 additions easier. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253260 91177308-0d34-0410-b5e6-96231b3b80d8 Simon Pilgrim 4 years ago
1 changed file(s) with 17 addition(s) and 82 deletion(s). Raw diff Collapse all Expand all
426426
427427 case X86::PSHUFDri:
428428 case X86::VPSHUFDri:
429 case X86::VPSHUFDYri:
429430 Src1Name = getRegName(MI->getOperand(1).getReg());
430431 // FALL THROUGH.
431432 case X86::PSHUFDmi:
432433 case X86::VPSHUFDmi:
433 DestName = getRegName(MI->getOperand(0).getReg());
434 if (MI->getOperand(MI->getNumOperands() - 1).isImm())
435 DecodePSHUFMask(MVT::v4i32,
436 MI->getOperand(MI->getNumOperands() - 1).getImm(),
437 ShuffleMask);
438 break;
439
440 case X86::VPSHUFDYri:
441 Src1Name = getRegName(MI->getOperand(1).getReg());
442 // FALL THROUGH.
443434 case X86::VPSHUFDYmi:
444435 DestName = getRegName(MI->getOperand(0).getReg());
445436 if (MI->getOperand(MI->getNumOperands() - 1).isImm())
446 DecodePSHUFMask(MVT::v8i32,
437 DecodePSHUFMask(getRegOperandVectorVT(MI, MVT::i32, 0),
447438 MI->getOperand(MI->getNumOperands() - 1).getImm(),
448439 ShuffleMask);
449440 break;
450441
451442 case X86::PSHUFHWri:
452443 case X86::VPSHUFHWri:
444 case X86::VPSHUFHWYri:
453445 Src1Name = getRegName(MI->getOperand(1).getReg());
454446 // FALL THROUGH.
455447 case X86::PSHUFHWmi:
456448 case X86::VPSHUFHWmi:
457 DestName = getRegName(MI->getOperand(0).getReg());
458 if (MI->getOperand(MI->getNumOperands() - 1).isImm())
459 DecodePSHUFHWMask(MVT::v8i16,
449 case X86::VPSHUFHWYmi:
450 DestName = getRegName(MI->getOperand(0).getReg());
451 if (MI->getOperand(MI->getNumOperands() - 1).isImm())
452 DecodePSHUFHWMask(getRegOperandVectorVT(MI, MVT::i16, 0),
460453 MI->getOperand(MI->getNumOperands() - 1).getImm(),
461454 ShuffleMask);
462455 break;
463456
464 case X86::VPSHUFHWYri:
465 Src1Name = getRegName(MI->getOperand(1).getReg());
466 // FALL THROUGH.
467 case X86::VPSHUFHWYmi:
468 DestName = getRegName(MI->getOperand(0).getReg());
469 if (MI->getOperand(MI->getNumOperands() - 1).isImm())
470 DecodePSHUFHWMask(MVT::v16i16,
471 MI->getOperand(MI->getNumOperands() - 1).getImm(),
472 ShuffleMask);
473 break;
474
475457 case X86::PSHUFLWri:
476458 case X86::VPSHUFLWri:
459 case X86::VPSHUFLWYri:
477460 Src1Name = getRegName(MI->getOperand(1).getReg());
478461 // FALL THROUGH.
479462 case X86::PSHUFLWmi:
480463 case X86::VPSHUFLWmi:
481 DestName = getRegName(MI->getOperand(0).getReg());
482 if (MI->getOperand(MI->getNumOperands() - 1).isImm())
483 DecodePSHUFLWMask(MVT::v8i16,
484 MI->getOperand(MI->getNumOperands() - 1).getImm(),
485 ShuffleMask);
486 break;
487
488 case X86::VPSHUFLWYri:
489 Src1Name = getRegName(MI->getOperand(1).getReg());
490 // FALL THROUGH.
491464 case X86::VPSHUFLWYmi:
492465 DestName = getRegName(MI->getOperand(0).getReg());
493466 if (MI->getOperand(MI->getNumOperands() - 1).isImm())
494 DecodePSHUFLWMask(MVT::v16i16,
467 DecodePSHUFLWMask(getRegOperandVectorVT(MI, MVT::i16, 0),
495468 MI->getOperand(MI->getNumOperands() - 1).getImm(),
496469 ShuffleMask);
497470 break;
641614
642615 case X86::SHUFPDrri:
643616 case X86::VSHUFPDrri:
617 case X86::VSHUFPDYrri:
644618 Src2Name = getRegName(MI->getOperand(2).getReg());
645619 // FALL THROUGH.
646620 case X86::SHUFPDrmi:
647621 case X86::VSHUFPDrmi:
648 if (MI->getOperand(MI->getNumOperands() - 1).isImm())
649 DecodeSHUFPMask(MVT::v2f64,
650 MI->getOperand(MI->getNumOperands() - 1).getImm(),
651 ShuffleMask);
652 Src1Name = getRegName(MI->getOperand(1).getReg());
653 DestName = getRegName(MI->getOperand(0).getReg());
654 break;
655
656 case X86::VSHUFPDYrri:
657 Src2Name = getRegName(MI->getOperand(2).getReg());
658 // FALL THROUGH.
659622 case X86::VSHUFPDYrmi:
660623 if (MI->getOperand(MI->getNumOperands() - 1).isImm())
661 DecodeSHUFPMask(MVT::v4f64,
624 DecodeSHUFPMask(getRegOperandVectorVT(MI, MVT::f64, 0),
662625 MI->getOperand(MI->getNumOperands() - 1).getImm(),
663626 ShuffleMask);
664627 Src1Name = getRegName(MI->getOperand(1).getReg());
667630
668631 case X86::SHUFPSrri:
669632 case X86::VSHUFPSrri:
633 case X86::VSHUFPSYrri:
670634 Src2Name = getRegName(MI->getOperand(2).getReg());
671635 // FALL THROUGH.
672636 case X86::SHUFPSrmi:
673637 case X86::VSHUFPSrmi:
674 if (MI->getOperand(MI->getNumOperands() - 1).isImm())
675 DecodeSHUFPMask(MVT::v4f32,
676 MI->getOperand(MI->getNumOperands() - 1).getImm(),
677 ShuffleMask);
678 Src1Name = getRegName(MI->getOperand(1).getReg());
679 DestName = getRegName(MI->getOperand(0).getReg());
680 break;
681
682 case X86::VSHUFPSYrri:
683 Src2Name = getRegName(MI->getOperand(2).getReg());
684 // FALL THROUGH.
685638 case X86::VSHUFPSYrmi:
686639 if (MI->getOperand(MI->getNumOperands() - 1).isImm())
687 DecodeSHUFPMask(MVT::v8f32,
640 DecodeSHUFPMask(getRegOperandVectorVT(MI, MVT::f32, 0),
688641 MI->getOperand(MI->getNumOperands() - 1).getImm(),
689642 ShuffleMask);
690643 Src1Name = getRegName(MI->getOperand(1).getReg());
774727 break;
775728
776729 case X86::VPERMILPSri:
730 case X86::VPERMILPSYri:
777731 Src1Name = getRegName(MI->getOperand(1).getReg());
778732 // FALL THROUGH.
779733 case X86::VPERMILPSmi:
780 if (MI->getOperand(MI->getNumOperands() - 1).isImm())
781 DecodePSHUFMask(MVT::v4f32,
782 MI->getOperand(MI->getNumOperands() - 1).getImm(),
783 ShuffleMask);
784 DestName = getRegName(MI->getOperand(0).getReg());
785 break;
786
787 case X86::VPERMILPSYri:
788 Src1Name = getRegName(MI->getOperand(1).getReg());
789 // FALL THROUGH.
790734 case X86::VPERMILPSYmi:
791735 if (MI->getOperand(MI->getNumOperands() - 1).isImm())
792 DecodePSHUFMask(MVT::v8f32,
736 DecodePSHUFMask(getRegOperandVectorVT(MI, MVT::f32, 0),
793737 MI->getOperand(MI->getNumOperands() - 1).getImm(),
794738 ShuffleMask);
795739 DestName = getRegName(MI->getOperand(0).getReg());
796740 break;
797741
798742 case X86::VPERMILPDri:
743 case X86::VPERMILPDYri:
799744 Src1Name = getRegName(MI->getOperand(1).getReg());
800745 // FALL THROUGH.
801746 case X86::VPERMILPDmi:
802 if (MI->getOperand(MI->getNumOperands() - 1).isImm())
803 DecodePSHUFMask(MVT::v2f64,
804 MI->getOperand(MI->getNumOperands() - 1).getImm(),
805 ShuffleMask);
806 DestName = getRegName(MI->getOperand(0).getReg());
807 break;
808
809 case X86::VPERMILPDYri:
810 Src1Name = getRegName(MI->getOperand(1).getReg());
811 // FALL THROUGH.
812747 case X86::VPERMILPDYmi:
813748 if (MI->getOperand(MI->getNumOperands() - 1).isImm())
814 DecodePSHUFMask(MVT::v4f64,
749 DecodePSHUFMask(getRegOperandVectorVT(MI, MVT::f64, 0),
815750 MI->getOperand(MI->getNumOperands() - 1).getImm(),
816751 ShuffleMask);
817752 DestName = getRegName(MI->getOperand(0).getReg());