@@ -1502,22 +1502,26 @@ fn generic_simd_intrinsic<'blk, 'tcx, 'a>
1502
1502
1503
1503
let total_len = in_len as u64 * 2 ;
1504
1504
1505
- let vector = match args {
1506
- Some ( args) => & args [ 2 ] ,
1507
- None => bcx. sess ( ) . span_bug ( span ,
1508
- "intrinsic call with unexpected argument shape" ) ,
1509
- } ;
1510
- let vector = match consts :: const_expr ( bcx . ccx ( ) , vector, substs , None ,
1511
- consts :: TrueConst :: Yes , // this should probably help simd error reporting
1512
- ) {
1513
- Ok ( ( vector , _ ) ) => vector ,
1514
- Err ( err ) => bcx. sess ( ) . span_fatal ( span , & err . description ( ) ) ,
1505
+ let ( vector, indirect ) = match args {
1506
+ Some ( args) => {
1507
+ match consts :: const_expr ( bcx. ccx ( ) , & args [ 2 ] , substs , None ,
1508
+ // this should probably help simd error reporting
1509
+ consts :: TrueConst :: Yes ) {
1510
+ Ok ( ( vector , _ ) ) => ( vector, false ) ,
1511
+ Err ( err ) => bcx . sess ( ) . span_fatal ( span , & err . description ( ) ) ,
1512
+ }
1513
+ }
1514
+ None => ( llargs [ 2 ] , ! type_is_immediate ( bcx. ccx ( ) , arg_tys [ 2 ] ) )
1515
1515
} ;
1516
1516
1517
1517
let indices: Option < Vec < _ > > = ( 0 ..n)
1518
1518
. map ( |i| {
1519
1519
let arg_idx = i;
1520
- let val = const_get_elt ( vector, & [ i as libc:: c_uint ] ) ;
1520
+ let val = if indirect {
1521
+ Load ( bcx, StructGEP ( bcx, vector, i) )
1522
+ } else {
1523
+ const_get_elt ( vector, & [ i as libc:: c_uint ] )
1524
+ } ;
1521
1525
let c = const_to_opt_uint ( val) ;
1522
1526
match c {
1523
1527
None => {
0 commit comments