@@ -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) ;
@@ -956,14 +956,14 @@ pub(crate) fn codegen_x86_llvm_intrinsic_call<'tcx>(
956
956
let b = b. load_scalar ( fx) ;
957
957
let lb = lb. load_scalar ( fx) ;
958
958
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
+ } ;
967
967
968
968
let imm8 = imm8. try_to_u8 ( ) . unwrap_or_else ( |_| panic ! ( "kind not scalar: {:?}" , imm8) ) ;
969
969
@@ -1009,14 +1009,14 @@ pub(crate) fn codegen_x86_llvm_intrinsic_call<'tcx>(
1009
1009
let b = b. load_scalar ( fx) ;
1010
1010
let lb = lb. load_scalar ( fx) ;
1011
1011
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
+ } ;
1020
1020
1021
1021
let imm8 = imm8. try_to_u8 ( ) . unwrap_or_else ( |_| panic ! ( "kind not scalar: {:?}" , imm8) ) ;
1022
1022
@@ -1056,15 +1056,15 @@ pub(crate) fn codegen_x86_llvm_intrinsic_call<'tcx>(
1056
1056
let a = a. load_scalar ( fx) ;
1057
1057
let b = b. load_scalar ( fx) ;
1058
1058
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
+ } ;
1068
1068
1069
1069
let imm8 = imm8. try_to_u8 ( ) . unwrap_or_else ( |_| panic ! ( "kind not scalar: {:?}" , imm8) ) ;
1070
1070
@@ -1093,15 +1093,15 @@ pub(crate) fn codegen_x86_llvm_intrinsic_call<'tcx>(
1093
1093
1094
1094
let a = a. load_scalar ( fx) ;
1095
1095
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
+ } ;
1105
1105
1106
1106
let imm8 = imm8. try_to_u8 ( ) . unwrap_or_else ( |_| panic ! ( "kind not scalar: {:?}" , imm8) ) ;
1107
1107
0 commit comments