@@ -103,16 +103,44 @@ static void buildConfigMI(MachineBasicBlock::iterator MI, int FrameIdx,
103
103
const X86Subtarget *ST) {
104
104
auto *MBB = MI->getParent ();
105
105
106
- // FIXME: AMX should assume AVX512 enabled .
106
+ // Zero stack slot .
107
107
if (ST->hasAVX512 ()) {
108
- // Zero stack slot.
109
108
Register Zmm = MRI->createVirtualRegister (&X86::VR512RegClass);
110
109
BuildMI (*MBB, MI, DebugLoc (), TII->get (X86::VPXORDZrr), Zmm)
111
110
.addReg (Zmm, RegState::Undef)
112
111
.addReg (Zmm, RegState::Undef);
113
112
addFrameReference (BuildMI (*MBB, MI, DebugLoc (), TII->get (X86::VMOVUPSZmr)),
114
113
FrameIdx)
115
114
.addReg (Zmm);
115
+ } else if (ST->hasAVX2 ()) {
116
+ Register Ymm = MRI->createVirtualRegister (&X86::VR256RegClass);
117
+ BuildMI (*MBB, MI, DebugLoc (), TII->get (X86::VPXORYrr), Ymm)
118
+ .addReg (Ymm, RegState::Undef)
119
+ .addReg (Ymm, RegState::Undef);
120
+ addFrameReference (BuildMI (*MBB, MI, DebugLoc (), TII->get (X86::VMOVUPSYmr)),
121
+ FrameIdx)
122
+ .addReg (Ymm);
123
+ addFrameReference (BuildMI (*MBB, MI, DebugLoc (), TII->get (X86::VMOVUPSYmr)),
124
+ FrameIdx, 32 )
125
+ .addReg (Ymm);
126
+ } else {
127
+ assert (ST->hasSSE2 () && " AMX should assume SSE2 enabled" );
128
+ Register Xmm = MRI->createVirtualRegister (&X86::VR128RegClass);
129
+ BuildMI (*MBB, MI, DebugLoc (), TII->get (X86::PXORrr), Xmm)
130
+ .addReg (Xmm, RegState::Undef)
131
+ .addReg (Xmm, RegState::Undef);
132
+ addFrameReference (BuildMI (*MBB, MI, DebugLoc (), TII->get (X86::MOVUPSmr)),
133
+ FrameIdx)
134
+ .addReg (Xmm);
135
+ addFrameReference (BuildMI (*MBB, MI, DebugLoc (), TII->get (X86::MOVUPSmr)),
136
+ FrameIdx, 16 )
137
+ .addReg (Xmm);
138
+ addFrameReference (BuildMI (*MBB, MI, DebugLoc (), TII->get (X86::MOVUPSmr)),
139
+ FrameIdx, 32 )
140
+ .addReg (Xmm);
141
+ addFrameReference (BuildMI (*MBB, MI, DebugLoc (), TII->get (X86::MOVUPSmr)),
142
+ FrameIdx, 48 )
143
+ .addReg (Xmm);
116
144
}
117
145
118
146
// build psuedo ldtilecfg
0 commit comments