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