llvm.org GIT mirror llvm / 444f89a
[AVX-512] Replace get512BitSuperRegister with calls to TargetRegisterInfo::getMatchingSuperReg. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282359 91177308-0d34-0410-b5e6-96231b3b80d8 Craig Topper 3 years ago
3 changed file(s) with 10 addition(s) and 17 deletion(s). Raw diff Collapse all Expand all
48154815 // If this an extended register and we don't have VLX we need to use a
48164816 // 512-bit move.
48174817 Opc = X86::VMOVAPSZrr;
4818 DestReg = get512BitSuperRegister(DestReg);
4819 SrcReg = get512BitSuperRegister(SrcReg);
4818 const TargetRegisterInfo *TRI = &getRegisterInfo();
4819 DestReg = TRI->getMatchingSuperReg(DestReg, X86::sub_xmm,
4820 &X86::VR512RegClass);
4821 SrcReg = TRI->getMatchingSuperReg(SrcReg, X86::sub_xmm,
4822 &X86::VR512RegClass);
48204823 }
48214824 } else if (X86::VR256XRegClass.contains(DestReg, SrcReg)) {
48224825 if (HasVLX)
48274830 // If this an extended register and we don't have VLX we need to use a
48284831 // 512-bit move.
48294832 Opc = X86::VMOVAPSZrr;
4830 DestReg = get512BitSuperRegister(DestReg);
4831 SrcReg = get512BitSuperRegister(SrcReg);
4833 const TargetRegisterInfo *TRI = &getRegisterInfo();
4834 DestReg = TRI->getMatchingSuperReg(DestReg, X86::sub_ymm,
4835 &X86::VR512RegClass);
4836 SrcReg = TRI->getMatchingSuperReg(SrcReg, X86::sub_ymm,
4837 &X86::VR512RegClass);
48324838 }
48334839 } else if (X86::VR512RegClass.contains(DestReg, SrcReg))
48344840 Opc = X86::VMOVAPSZrr;
690690 FrameReg = getX86SubSuperRegister(FrameReg, 32);
691691 return FrameReg;
692692 }
693
694 unsigned llvm::get512BitSuperRegister(unsigned Reg) {
695 if (Reg >= X86::XMM0 && Reg <= X86::XMM31)
696 return X86::ZMM0 + (Reg - X86::XMM0);
697 if (Reg >= X86::YMM0 && Reg <= X86::YMM31)
698 return X86::ZMM0 + (Reg - X86::YMM0);
699 if (Reg >= X86::ZMM0 && Reg <= X86::ZMM31)
700 return Reg;
701 llvm_unreachable("Unexpected SIMD register");
702 }
136136 unsigned getSlotSize() const { return SlotSize; }
137137 };
138138
139 //get512BitRegister - X86 utility - returns 512-bit super register
140 unsigned get512BitSuperRegister(unsigned Reg);
141
142139 } // End llvm namespace
143140
144141 #endif