@@ -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) ;
@@ -782,14 +782,14 @@ pub(crate) fn codegen_x86_llvm_intrinsic_call<'tcx>(
782782 let b = b. load_scalar ( fx) ;
783783 let lb = lb. load_scalar ( fx) ;
784784
785- let imm8 = if let Some ( imm8 ) = crate :: constant :: mir_operand_get_const_val ( fx , & args [ 4 ] )
786- {
787- imm8
788- } else {
789- fx. tcx
790- . dcx ( )
791- . span_fatal ( span, "Index argument for `_mm_cmpestri` is not a constant" ) ;
792- } ;
785+ let imm8 =
786+ if let Some ( imm8 ) = crate :: constant :: mir_operand_get_const_val ( fx , & args [ 4 ] . node ) {
787+ imm8
788+ } else {
789+ fx. tcx
790+ . dcx ( )
791+ . span_fatal ( span, "Index argument for `_mm_cmpestri` is not a constant" ) ;
792+ } ;
793793
794794 let imm8 = imm8. try_to_u8 ( ) . unwrap_or_else ( |_| panic ! ( "kind not scalar: {:?}" , imm8) ) ;
795795
@@ -835,14 +835,14 @@ pub(crate) fn codegen_x86_llvm_intrinsic_call<'tcx>(
835835 let b = b. load_scalar ( fx) ;
836836 let lb = lb. load_scalar ( fx) ;
837837
838- let imm8 = if let Some ( imm8 ) = crate :: constant :: mir_operand_get_const_val ( fx , & args [ 4 ] )
839- {
840- imm8
841- } else {
842- fx. tcx
843- . dcx ( )
844- . span_fatal ( span, "Index argument for `_mm_cmpestrm` is not a constant" ) ;
845- } ;
838+ let imm8 =
839+ if let Some ( imm8 ) = crate :: constant :: mir_operand_get_const_val ( fx , & args [ 4 ] . node ) {
840+ imm8
841+ } else {
842+ fx. tcx
843+ . dcx ( )
844+ . span_fatal ( span, "Index argument for `_mm_cmpestrm` is not a constant" ) ;
845+ } ;
846846
847847 let imm8 = imm8. try_to_u8 ( ) . unwrap_or_else ( |_| panic ! ( "kind not scalar: {:?}" , imm8) ) ;
848848
@@ -882,15 +882,15 @@ pub(crate) fn codegen_x86_llvm_intrinsic_call<'tcx>(
882882 let a = a. load_scalar ( fx) ;
883883 let b = b. load_scalar ( fx) ;
884884
885- let imm8 = if let Some ( imm8 ) = crate :: constant :: mir_operand_get_const_val ( fx , & args [ 2 ] )
886- {
887- imm8
888- } else {
889- fx. tcx . dcx ( ) . span_fatal (
890- span,
891- "Index argument for `_mm_clmulepi64_si128` is not a constant" ,
892- ) ;
893- } ;
885+ let imm8 =
886+ if let Some ( imm8 ) = crate :: constant :: mir_operand_get_const_val ( fx , & args [ 2 ] . node ) {
887+ imm8
888+ } else {
889+ fx. tcx . dcx ( ) . span_fatal (
890+ span,
891+ "Index argument for `_mm_clmulepi64_si128` is not a constant" ,
892+ ) ;
893+ } ;
894894
895895 let imm8 = imm8. try_to_u8 ( ) . unwrap_or_else ( |_| panic ! ( "kind not scalar: {:?}" , imm8) ) ;
896896
@@ -919,15 +919,15 @@ pub(crate) fn codegen_x86_llvm_intrinsic_call<'tcx>(
919919
920920 let a = a. load_scalar ( fx) ;
921921
922- let imm8 = if let Some ( imm8 ) = crate :: constant :: mir_operand_get_const_val ( fx , & args [ 1 ] )
923- {
924- imm8
925- } else {
926- fx. tcx . dcx ( ) . span_fatal (
927- span,
928- "Index argument for `_mm_aeskeygenassist_si128` is not a constant" ,
929- ) ;
930- } ;
922+ let imm8 =
923+ if let Some ( imm8 ) = crate :: constant :: mir_operand_get_const_val ( fx , & args [ 1 ] . node ) {
924+ imm8
925+ } else {
926+ fx. tcx . dcx ( ) . span_fatal (
927+ span,
928+ "Index argument for `_mm_aeskeygenassist_si128` is not a constant" ,
929+ ) ;
930+ } ;
931931
932932 let imm8 = imm8. try_to_u8 ( ) . unwrap_or_else ( |_| panic ! ( "kind not scalar: {:?}" , imm8) ) ;
933933
0 commit comments