@@ -104,6 +104,7 @@ impl ABIMachineSpec for X64ABIMachineSpec {
104104 mut args : ArgsAccumulator ,
105105 ) -> CodegenResult < ( u32 , Option < usize > ) > {
106106 let is_fastcall = call_conv == CallConv :: WindowsFastcall ;
107+ let is_tail = call_conv == CallConv :: Tail ;
107108
108109 let mut next_gpr = 0 ;
109110 let mut next_vreg = 0 ;
@@ -182,6 +183,11 @@ impl ABIMachineSpec for X64ABIMachineSpec {
182183 // This is consistent with LLVM's behavior, and is needed for
183184 // some uses of Cranelift (e.g., the rustc backend).
184185 //
186+ // - Otherwise, if the calling convention is Tail, we behave as in
187+ // the previous case, even if `enable_llvm_abi_extensions` is not
188+ // set in the flags: This is a custom calling convention defined
189+ // by Cranelift, LLVM doesn't know about it.
190+ //
185191 // - Otherwise, both SysV and Fastcall specify behavior (use of
186192 // vector register, a register pair, or passing by reference
187193 // depending on the case), but for simplicity, we will just panic if
@@ -195,6 +201,7 @@ impl ABIMachineSpec for X64ABIMachineSpec {
195201 if param. value_type . bits ( ) > 64
196202 && !( param. value_type . is_vector ( ) || param. value_type . is_float ( ) )
197203 && !flags. enable_llvm_abi_extensions ( )
204+ && !is_tail
198205 {
199206 panic ! (
200207 "i128 args/return values not supported unless LLVM ABI extensions are enabled"
0 commit comments