@@ -399,7 +399,7 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
399
399
}
400
400
401
401
#[ cfg( feature = "master" ) ]
402
- if name == sym:: simd_insert {
402
+ if name == sym:: simd_insert || name == sym :: simd_insert_dyn {
403
403
require ! (
404
404
in_elem == arg_tys[ 2 ] ,
405
405
InvalidMonomorphization :: InsertedType {
@@ -410,6 +410,8 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
410
410
out_ty: arg_tys[ 2 ]
411
411
}
412
412
) ;
413
+
414
+ // TODO(antoyo): For simd_insert, check if the index is a constant of the correct size.
413
415
let vector = args[ 0 ] . immediate ( ) ;
414
416
let index = args[ 1 ] . immediate ( ) ;
415
417
let value = args[ 2 ] . immediate ( ) ;
@@ -422,13 +424,15 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
422
424
}
423
425
424
426
#[ cfg( feature = "master" ) ]
425
- if name == sym:: simd_extract {
427
+ if name == sym:: simd_extract || name == sym :: simd_extract_dyn {
426
428
require ! (
427
429
ret_ty == in_elem,
428
430
InvalidMonomorphization :: ReturnType { span, name, in_elem, in_ty, ret_ty }
429
431
) ;
432
+ // TODO(antoyo): For simd_extract, check if the index is a constant of the correct size.
430
433
let vector = args[ 0 ] . immediate ( ) ;
431
- return Ok ( bx. context . new_vector_access ( None , vector, args[ 1 ] . immediate ( ) ) . to_rvalue ( ) ) ;
434
+ let index = args[ 1 ] . immediate ( ) ;
435
+ return Ok ( bx. context . new_vector_access ( None , vector, index) . to_rvalue ( ) ) ;
432
436
}
433
437
434
438
if name == sym:: simd_select {
0 commit comments