@@ -153,6 +153,7 @@ pub(crate) fn codegen_inline_asm_inner<'tcx>(
153153 let mut asm_gen = InlineAssemblyGenerator {
154154 tcx : fx. tcx ,
155155 arch : fx. tcx . sess . asm_arch . unwrap ( ) ,
156+ allow_experimental_reg : fx. tcx . features ( ) . asm_experimental_reg ( ) ,
156157 enclosing_def_id : fx. instance . def_id ( ) ,
157158 template,
158159 operands,
@@ -296,6 +297,7 @@ pub(crate) fn codegen_naked_asm<'tcx>(
296297 let asm_gen = InlineAssemblyGenerator {
297298 tcx,
298299 arch : tcx. sess . asm_arch . unwrap ( ) ,
300+ allow_experimental_reg : tcx. features ( ) . asm_experimental_reg ( ) ,
299301 enclosing_def_id : instance. def_id ( ) ,
300302 template,
301303 operands : & operands,
@@ -315,6 +317,7 @@ pub(crate) fn codegen_naked_asm<'tcx>(
315317struct InlineAssemblyGenerator < ' a , ' tcx > {
316318 tcx : TyCtxt < ' tcx > ,
317319 arch : InlineAsmArch ,
320+ allow_experimental_reg : bool ,
318321 enclosing_def_id : DefId ,
319322 template : & ' a [ InlineAsmTemplatePiece ] ,
320323 operands : & ' a [ CInlineAsmOperand < ' tcx > ] ,
@@ -462,8 +465,12 @@ impl<'tcx> InlineAssemblyGenerator<'_, 'tcx> {
462465 let mut slots_output = vec ! [ None ; self . operands. len( ) ] ;
463466
464467 let new_slot_fn = |slot_size : & mut Size , reg_class : InlineAsmRegClass | {
465- let reg_size =
466- reg_class. supported_types ( self . arch ) . iter ( ) . map ( |( ty, _) | ty. size ( ) ) . max ( ) . unwrap ( ) ;
468+ let reg_size = reg_class
469+ . supported_types ( self . arch , self . allow_experimental_reg )
470+ . iter ( )
471+ . map ( |( ty, _) | ty. size ( ) )
472+ . max ( )
473+ . unwrap ( ) ;
467474 let align = rustc_abi:: Align :: from_bytes ( reg_size. bytes ( ) ) . unwrap ( ) ;
468475 let offset = slot_size. align_to ( align) ;
469476 * slot_size = offset + reg_size;
0 commit comments