@@ -11,7 +11,7 @@ pub(crate) fn codegen_x86_llvm_intrinsic_call<'tcx>(
11
11
fx : & mut FunctionCx < ' _ , ' _ , ' tcx > ,
12
12
intrinsic : & str ,
13
13
_args : GenericArgsRef < ' tcx > ,
14
- args : & [ mir:: Operand < ' tcx > ] ,
14
+ args : & [ Spanned < mir:: Operand < ' tcx > > ] ,
15
15
ret : CPlace < ' tcx > ,
16
16
target : Option < BasicBlock > ,
17
17
span : Span ,
@@ -175,9 +175,9 @@ pub(crate) fn codegen_x86_llvm_intrinsic_call<'tcx>(
175
175
[ x, y, kind] => ( x, y, kind) ,
176
176
_ => bug ! ( "wrong number of args for intrinsic {intrinsic}" ) ,
177
177
} ;
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 {
181
181
Operand :: Constant ( const_) => crate :: constant:: eval_mir_constant ( fx, const_) . 0 ,
182
182
Operand :: Copy ( _) | Operand :: Move ( _) => unreachable ! ( "{kind:?}" ) ,
183
183
} ;
@@ -287,8 +287,8 @@ pub(crate) fn codegen_x86_llvm_intrinsic_call<'tcx>(
287
287
[ a, b] => ( a, b) ,
288
288
_ => bug ! ( "wrong number of args for intrinsic {intrinsic}" ) ,
289
289
} ;
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 ) ;
292
292
293
293
// Based on the pseudocode at https://github.com/rust-lang/stdarch/blob/1cfbca8b38fd9b4282b2f054f61c6ca69fc7ce29/crates/core_arch/src/x86/avx2.rs#L2319-L2332
294
294
let zero = fx. bcx . ins ( ) . iconst ( types:: I8 , 0 ) ;
@@ -325,9 +325,9 @@ pub(crate) fn codegen_x86_llvm_intrinsic_call<'tcx>(
325
325
[ a, b, imm8] => ( a, b, imm8) ,
326
326
_ => bug ! ( "wrong number of args for intrinsic {intrinsic}" ) ,
327
327
} ;
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) ;
331
331
332
332
let a_low = a. value_typed_lane ( fx, fx. tcx . types . u128 , 0 ) . load_scalar ( fx) ;
333
333
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>(
782
782
let b = b. load_scalar ( fx) ;
783
783
let lb = lb. load_scalar ( fx) ;
784
784
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
+ } ;
793
793
794
794
let imm8 = imm8. try_to_u8 ( ) . unwrap_or_else ( |_| panic ! ( "kind not scalar: {:?}" , imm8) ) ;
795
795
@@ -835,14 +835,14 @@ pub(crate) fn codegen_x86_llvm_intrinsic_call<'tcx>(
835
835
let b = b. load_scalar ( fx) ;
836
836
let lb = lb. load_scalar ( fx) ;
837
837
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
+ } ;
846
846
847
847
let imm8 = imm8. try_to_u8 ( ) . unwrap_or_else ( |_| panic ! ( "kind not scalar: {:?}" , imm8) ) ;
848
848
@@ -882,15 +882,15 @@ pub(crate) fn codegen_x86_llvm_intrinsic_call<'tcx>(
882
882
let a = a. load_scalar ( fx) ;
883
883
let b = b. load_scalar ( fx) ;
884
884
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
+ } ;
894
894
895
895
let imm8 = imm8. try_to_u8 ( ) . unwrap_or_else ( |_| panic ! ( "kind not scalar: {:?}" , imm8) ) ;
896
896
@@ -919,15 +919,15 @@ pub(crate) fn codegen_x86_llvm_intrinsic_call<'tcx>(
919
919
920
920
let a = a. load_scalar ( fx) ;
921
921
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
+ } ;
931
931
932
932
let imm8 = imm8. try_to_u8 ( ) . unwrap_or_else ( |_| panic ! ( "kind not scalar: {:?}" , imm8) ) ;
933
933
0 commit comments