@@ -42,8 +42,10 @@ pub(crate) fn codegen_inline_asm<'tcx>(
42
42
assert_eq ! ( operands. len( ) , 4 ) ;
43
43
let ( leaf, eax_place) = match operands[ 1 ] {
44
44
InlineAsmOperand :: InOut { reg, late : true , ref in_value, out_place } => {
45
- let reg = expect_reg ( reg) ;
46
- assert_eq ! ( reg, InlineAsmReg :: X86 ( X86InlineAsmReg :: ax) ) ;
45
+ assert_eq ! (
46
+ reg,
47
+ InlineAsmRegOrRegClass :: Reg ( InlineAsmReg :: X86 ( X86InlineAsmReg :: ax) )
48
+ ) ;
47
49
(
48
50
crate :: base:: codegen_operand ( fx, in_value) . load_scalar ( fx) ,
49
51
crate :: base:: codegen_place ( fx, out_place. unwrap ( ) ) ,
@@ -65,8 +67,10 @@ pub(crate) fn codegen_inline_asm<'tcx>(
65
67
} ;
66
68
let ( sub_leaf, ecx_place) = match operands[ 2 ] {
67
69
InlineAsmOperand :: InOut { reg, late : true , ref in_value, out_place } => {
68
- let reg = expect_reg ( reg) ;
69
- assert_eq ! ( reg, InlineAsmReg :: X86 ( X86InlineAsmReg :: cx) ) ;
70
+ assert_eq ! (
71
+ reg,
72
+ InlineAsmRegOrRegClass :: Reg ( InlineAsmReg :: X86 ( X86InlineAsmReg :: cx) )
73
+ ) ;
70
74
(
71
75
crate :: base:: codegen_operand ( fx, in_value) . load_scalar ( fx) ,
72
76
crate :: base:: codegen_place ( fx, out_place. unwrap ( ) ) ,
@@ -76,8 +80,10 @@ pub(crate) fn codegen_inline_asm<'tcx>(
76
80
} ;
77
81
let edx_place = match operands[ 3 ] {
78
82
InlineAsmOperand :: Out { reg, late : true , place } => {
79
- let reg = expect_reg ( reg) ;
80
- assert_eq ! ( reg, InlineAsmReg :: X86 ( X86InlineAsmReg :: dx) ) ;
83
+ assert_eq ! (
84
+ reg,
85
+ InlineAsmRegOrRegClass :: Reg ( InlineAsmReg :: X86 ( X86InlineAsmReg :: dx) )
86
+ ) ;
81
87
crate :: base:: codegen_place ( fx, place. unwrap ( ) )
82
88
}
83
89
_ => unreachable ! ( ) ,
@@ -437,13 +443,6 @@ fn call_inline_asm<'tcx>(
437
443
}
438
444
}
439
445
440
- fn expect_reg ( reg_or_class : InlineAsmRegOrRegClass ) -> InlineAsmReg {
441
- match reg_or_class {
442
- InlineAsmRegOrRegClass :: Reg ( reg) => reg,
443
- InlineAsmRegOrRegClass :: RegClass ( class) => unimplemented ! ( "{:?}" , class) ,
444
- }
445
- }
446
-
447
446
fn save_register ( generated_asm : & mut String , arch : InlineAsmArch , reg : InlineAsmReg , offset : Size ) {
448
447
match arch {
449
448
InlineAsmArch :: X86_64 => {
0 commit comments