@@ -443,9 +443,14 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
443
443
m_len == v_len,
444
444
InvalidMonomorphization :: MismatchedLengths { span, name, m_len, v_len }
445
445
) ;
446
+ // TODO: also support unsigned integers.
446
447
match * m_elem_ty. kind ( ) {
447
448
ty:: Int ( _) => { }
448
- _ => return_error ! ( InvalidMonomorphization :: MaskType { span, name, ty: m_elem_ty } ) ,
449
+ _ => return_error ! ( InvalidMonomorphization :: MaskWrongElementType {
450
+ span,
451
+ name,
452
+ ty: m_elem_ty
453
+ } ) ,
449
454
}
450
455
return Ok ( bx. vector_select ( args[ 0 ] . immediate ( ) , args[ 1 ] . immediate ( ) , args[ 2 ] . immediate ( ) ) ) ;
451
456
}
@@ -987,19 +992,15 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
987
992
assert_eq ! ( pointer_count - 1 , ptr_count( element_ty0) ) ;
988
993
assert_eq ! ( underlying_ty, non_ptr( element_ty0) ) ;
989
994
990
- // The element type of the third argument must be a signed integer type of any width:
995
+ // The element type of the third argument must be an integer type of any width:
996
+ // TODO: also support unsigned integers.
991
997
let ( _, element_ty2) = arg_tys[ 2 ] . simd_size_and_type ( bx. tcx ( ) ) ;
992
998
match * element_ty2. kind ( ) {
993
999
ty:: Int ( _) => ( ) ,
994
1000
_ => {
995
1001
require ! (
996
1002
false ,
997
- InvalidMonomorphization :: ThirdArgElementType {
998
- span,
999
- name,
1000
- expected_element: element_ty2,
1001
- third_arg: arg_tys[ 2 ]
1002
- }
1003
+ InvalidMonomorphization :: MaskWrongElementType { span, name, ty: element_ty2 }
1003
1004
) ;
1004
1005
}
1005
1006
}
@@ -1105,17 +1106,13 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
1105
1106
assert_eq ! ( underlying_ty, non_ptr( element_ty0) ) ;
1106
1107
1107
1108
// The element type of the third argument must be a signed integer type of any width:
1109
+ // TODO: also support unsigned integers.
1108
1110
match * element_ty2. kind ( ) {
1109
1111
ty:: Int ( _) => ( ) ,
1110
1112
_ => {
1111
1113
require ! (
1112
1114
false ,
1113
- InvalidMonomorphization :: ThirdArgElementType {
1114
- span,
1115
- name,
1116
- expected_element: element_ty2,
1117
- third_arg: arg_tys[ 2 ]
1118
- }
1115
+ InvalidMonomorphization :: MaskWrongElementType { span, name, ty: element_ty2 }
1119
1116
) ;
1120
1117
}
1121
1118
}
0 commit comments