@@ -11,7 +11,7 @@ pub(crate) fn codegen_x86_llvm_intrinsic_call<'tcx>(
1111 fx : & mut FunctionCx < ' _ , ' _ , ' tcx > ,
1212 intrinsic : & str ,
1313 _args : GenericArgsRef < ' tcx > ,
14- args : & [ mir:: Operand < ' tcx > ] ,
14+ args : & [ Spanned < mir:: Operand < ' tcx > > ] ,
1515 ret : CPlace < ' tcx > ,
1616 target : Option < BasicBlock > ,
1717 span : Span ,
@@ -175,9 +175,9 @@ pub(crate) fn codegen_x86_llvm_intrinsic_call<'tcx>(
175175 [ x, y, kind] => ( x, y, kind) ,
176176 _ => bug ! ( "wrong number of args for intrinsic {intrinsic}" ) ,
177177 } ;
178- let x = codegen_operand ( fx, x ) ;
179- let y = codegen_operand ( fx, y ) ;
180- let kind = match kind {
178+ let x = codegen_operand ( fx, & x . node ) ;
179+ let y = codegen_operand ( fx, & y . node ) ;
180+ let kind = match & kind. node {
181181 Operand :: Constant ( const_) => crate :: constant:: eval_mir_constant ( fx, const_) . 0 ,
182182 Operand :: Copy ( _) | Operand :: Move ( _) => unreachable ! ( "{kind:?}" ) ,
183183 } ;
@@ -287,8 +287,8 @@ pub(crate) fn codegen_x86_llvm_intrinsic_call<'tcx>(
287287 [ a, b] => ( a, b) ,
288288 _ => bug ! ( "wrong number of args for intrinsic {intrinsic}" ) ,
289289 } ;
290- let a = codegen_operand ( fx, a ) ;
291- let b = codegen_operand ( fx, b ) ;
290+ let a = codegen_operand ( fx, & a . node ) ;
291+ let b = codegen_operand ( fx, & b . node ) ;
292292
293293 // Based on the pseudocode at https://github.com/rust-lang/stdarch/blob/1cfbca8b38fd9b4282b2f054f61c6ca69fc7ce29/crates/core_arch/src/x86/avx2.rs#L2319-L2332
294294 let zero = fx. bcx . ins ( ) . iconst ( types:: I8 , 0 ) ;
@@ -325,9 +325,9 @@ pub(crate) fn codegen_x86_llvm_intrinsic_call<'tcx>(
325325 [ a, b, imm8] => ( a, b, imm8) ,
326326 _ => bug ! ( "wrong number of args for intrinsic {intrinsic}" ) ,
327327 } ;
328- let a = codegen_operand ( fx, a ) ;
329- let b = codegen_operand ( fx, b ) ;
330- let imm8 = codegen_operand ( fx, imm8) . load_scalar ( fx) ;
328+ let a = codegen_operand ( fx, & a . node ) ;
329+ let b = codegen_operand ( fx, & b . node ) ;
330+ let imm8 = codegen_operand ( fx, & imm8. node ) . load_scalar ( fx) ;
331331
332332 let a_low = a. value_typed_lane ( fx, fx. tcx . types . u128 , 0 ) . load_scalar ( fx) ;
333333 let a_high = a. value_typed_lane ( fx, fx. tcx . types . u128 , 1 ) . load_scalar ( fx) ;
@@ -956,14 +956,14 @@ pub(crate) fn codegen_x86_llvm_intrinsic_call<'tcx>(
956956 let b = b. load_scalar ( fx) ;
957957 let lb = lb. load_scalar ( fx) ;
958958
959- let imm8 = if let Some ( imm8 ) = crate :: constant :: mir_operand_get_const_val ( fx , & args [ 4 ] )
960- {
961- imm8
962- } else {
963- fx. tcx
964- . dcx ( )
965- . span_fatal ( span, "Index argument for `_mm_cmpestri` is not a constant" ) ;
966- } ;
959+ let imm8 =
960+ if let Some ( imm8 ) = crate :: constant :: mir_operand_get_const_val ( fx , & args [ 4 ] . node ) {
961+ imm8
962+ } else {
963+ fx. tcx
964+ . dcx ( )
965+ . span_fatal ( span, "Index argument for `_mm_cmpestri` is not a constant" ) ;
966+ } ;
967967
968968 let imm8 = imm8. try_to_u8 ( ) . unwrap_or_else ( |_| panic ! ( "kind not scalar: {:?}" , imm8) ) ;
969969
@@ -1009,14 +1009,14 @@ pub(crate) fn codegen_x86_llvm_intrinsic_call<'tcx>(
10091009 let b = b. load_scalar ( fx) ;
10101010 let lb = lb. load_scalar ( fx) ;
10111011
1012- let imm8 = if let Some ( imm8 ) = crate :: constant :: mir_operand_get_const_val ( fx , & args [ 4 ] )
1013- {
1014- imm8
1015- } else {
1016- fx. tcx
1017- . dcx ( )
1018- . span_fatal ( span, "Index argument for `_mm_cmpestrm` is not a constant" ) ;
1019- } ;
1012+ let imm8 =
1013+ if let Some ( imm8 ) = crate :: constant :: mir_operand_get_const_val ( fx , & args [ 4 ] . node ) {
1014+ imm8
1015+ } else {
1016+ fx. tcx
1017+ . dcx ( )
1018+ . span_fatal ( span, "Index argument for `_mm_cmpestrm` is not a constant" ) ;
1019+ } ;
10201020
10211021 let imm8 = imm8. try_to_u8 ( ) . unwrap_or_else ( |_| panic ! ( "kind not scalar: {:?}" , imm8) ) ;
10221022
@@ -1056,15 +1056,15 @@ pub(crate) fn codegen_x86_llvm_intrinsic_call<'tcx>(
10561056 let a = a. load_scalar ( fx) ;
10571057 let b = b. load_scalar ( fx) ;
10581058
1059- let imm8 = if let Some ( imm8 ) = crate :: constant :: mir_operand_get_const_val ( fx , & args [ 2 ] )
1060- {
1061- imm8
1062- } else {
1063- fx. tcx . dcx ( ) . span_fatal (
1064- span,
1065- "Index argument for `_mm_clmulepi64_si128` is not a constant" ,
1066- ) ;
1067- } ;
1059+ let imm8 =
1060+ if let Some ( imm8 ) = crate :: constant :: mir_operand_get_const_val ( fx , & args [ 2 ] . node ) {
1061+ imm8
1062+ } else {
1063+ fx. tcx . dcx ( ) . span_fatal (
1064+ span,
1065+ "Index argument for `_mm_clmulepi64_si128` is not a constant" ,
1066+ ) ;
1067+ } ;
10681068
10691069 let imm8 = imm8. try_to_u8 ( ) . unwrap_or_else ( |_| panic ! ( "kind not scalar: {:?}" , imm8) ) ;
10701070
@@ -1093,15 +1093,15 @@ pub(crate) fn codegen_x86_llvm_intrinsic_call<'tcx>(
10931093
10941094 let a = a. load_scalar ( fx) ;
10951095
1096- let imm8 = if let Some ( imm8 ) = crate :: constant :: mir_operand_get_const_val ( fx , & args [ 1 ] )
1097- {
1098- imm8
1099- } else {
1100- fx. tcx . dcx ( ) . span_fatal (
1101- span,
1102- "Index argument for `_mm_aeskeygenassist_si128` is not a constant" ,
1103- ) ;
1104- } ;
1096+ let imm8 =
1097+ if let Some ( imm8 ) = crate :: constant :: mir_operand_get_const_val ( fx , & args [ 1 ] . node ) {
1098+ imm8
1099+ } else {
1100+ fx. tcx . dcx ( ) . span_fatal (
1101+ span,
1102+ "Index argument for `_mm_aeskeygenassist_si128` is not a constant" ,
1103+ ) ;
1104+ } ;
11051105
11061106 let imm8 = imm8. try_to_u8 ( ) . unwrap_or_else ( |_| panic ! ( "kind not scalar: {:?}" , imm8) ) ;
11071107
0 commit comments