@@ -107,13 +107,22 @@ AArch64RegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const {
107
107
if (MF->getFunction ().getCallingConv () ==
108
108
CallingConv::AArch64_SME_ABI_Support_Routines_PreserveMost_From_X0)
109
109
report_fatal_error (
110
- " Calling convention AArch64_SME_ABI_Support_Routines_PreserveMost_From_X0 is "
111
- " only supported to improve calls to SME ACLE save/restore/disable-za "
110
+ " Calling convention "
111
+ " AArch64_SME_ABI_Support_Routines_PreserveMost_From_X0 is only "
112
+ " supported to improve calls to SME ACLE save/restore/disable-za "
112
113
" functions, and is not intended to be used beyond that scope." );
114
+ if (MF->getFunction ().getCallingConv () ==
115
+ CallingConv::AArch64_SME_ABI_Support_Routines_PreserveMost_From_X1)
116
+ report_fatal_error (
117
+ " Calling convention "
118
+ " AArch64_SME_ABI_Support_Routines_PreserveMost_From_X1 is "
119
+ " only supported to improve calls to SME ACLE __arm_get_current_vg "
120
+ " function, and is not intended to be used beyond that scope." );
113
121
if (MF->getFunction ().getCallingConv () ==
114
122
CallingConv::AArch64_SME_ABI_Support_Routines_PreserveMost_From_X2)
115
123
report_fatal_error (
116
- " Calling convention AArch64_SME_ABI_Support_Routines_PreserveMost_From_X2 is "
124
+ " Calling convention "
125
+ " AArch64_SME_ABI_Support_Routines_PreserveMost_From_X2 is "
117
126
" only supported to improve calls to SME ACLE __arm_sme_state "
118
127
" and is not intended to be used beyond that scope." );
119
128
if (MF->getSubtarget <AArch64Subtarget>().getTargetLowering ()
@@ -153,13 +162,22 @@ AArch64RegisterInfo::getDarwinCalleeSavedRegs(const MachineFunction *MF) const {
153
162
if (MF->getFunction ().getCallingConv () ==
154
163
CallingConv::AArch64_SME_ABI_Support_Routines_PreserveMost_From_X0)
155
164
report_fatal_error (
156
- " Calling convention AArch64_SME_ABI_Support_Routines_PreserveMost_From_X0 is "
165
+ " Calling convention "
166
+ " AArch64_SME_ABI_Support_Routines_PreserveMost_From_X0 is "
157
167
" only supported to improve calls to SME ACLE save/restore/disable-za "
158
168
" functions, and is not intended to be used beyond that scope." );
169
+ if (MF->getFunction ().getCallingConv () ==
170
+ CallingConv::AArch64_SME_ABI_Support_Routines_PreserveMost_From_X1)
171
+ report_fatal_error (
172
+ " Calling convention "
173
+ " AArch64_SME_ABI_Support_Routines_PreserveMost_From_X1 is "
174
+ " only supported to improve calls to SME ACLE __arm_get_current_vg "
175
+ " function, and is not intended to be used beyond that scope." );
159
176
if (MF->getFunction ().getCallingConv () ==
160
177
CallingConv::AArch64_SME_ABI_Support_Routines_PreserveMost_From_X2)
161
178
report_fatal_error (
162
- " Calling convention AArch64_SME_ABI_Support_Routines_PreserveMost_From_X2 is "
179
+ " Calling convention "
180
+ " AArch64_SME_ABI_Support_Routines_PreserveMost_From_X2 is "
163
181
" only supported to improve calls to SME ACLE __arm_sme_state "
164
182
" and is not intended to be used beyond that scope." );
165
183
if (MF->getFunction ().getCallingConv () == CallingConv::CXX_FAST_TLS)
@@ -236,6 +254,8 @@ AArch64RegisterInfo::getDarwinCallPreservedMask(const MachineFunction &MF,
236
254
" Calling convention SVE_VectorCall is unsupported on Darwin." );
237
255
if (CC == CallingConv::AArch64_SME_ABI_Support_Routines_PreserveMost_From_X0)
238
256
return CSR_AArch64_SME_ABI_Support_Routines_PreserveMost_From_X0_RegMask;
257
+ if (CC == CallingConv::AArch64_SME_ABI_Support_Routines_PreserveMost_From_X1)
258
+ return CSR_AArch64_SME_ABI_Support_Routines_PreserveMost_From_X1_RegMask;
239
259
if (CC == CallingConv::AArch64_SME_ABI_Support_Routines_PreserveMost_From_X2)
240
260
return CSR_AArch64_SME_ABI_Support_Routines_PreserveMost_From_X2_RegMask;
241
261
if (CC == CallingConv::CFGuard_Check)
@@ -282,6 +302,8 @@ AArch64RegisterInfo::getCallPreservedMask(const MachineFunction &MF,
282
302
: CSR_AArch64_SVE_AAPCS_RegMask;
283
303
if (CC == CallingConv::AArch64_SME_ABI_Support_Routines_PreserveMost_From_X0)
284
304
return CSR_AArch64_SME_ABI_Support_Routines_PreserveMost_From_X0_RegMask;
305
+ if (CC == CallingConv::AArch64_SME_ABI_Support_Routines_PreserveMost_From_X1)
306
+ return CSR_AArch64_SME_ABI_Support_Routines_PreserveMost_From_X1_RegMask;
285
307
if (CC == CallingConv::AArch64_SME_ABI_Support_Routines_PreserveMost_From_X2)
286
308
return CSR_AArch64_SME_ABI_Support_Routines_PreserveMost_From_X2_RegMask;
287
309
if (CC == CallingConv::CFGuard_Check)
@@ -643,6 +665,7 @@ bool AArch64RegisterInfo::isArgumentRegister(const MachineFunction &MF,
643
665
case CallingConv::AArch64_VectorCall:
644
666
case CallingConv::AArch64_SVE_VectorCall:
645
667
case CallingConv::AArch64_SME_ABI_Support_Routines_PreserveMost_From_X0:
668
+ case CallingConv::AArch64_SME_ABI_Support_Routines_PreserveMost_From_X1:
646
669
case CallingConv::AArch64_SME_ABI_Support_Routines_PreserveMost_From_X2:
647
670
if (STI.isTargetWindows ())
648
671
return HasReg (CC_AArch64_Win64PCS_ArgRegs, Reg);
0 commit comments