@@ -447,9 +447,14 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
447447 m_len == v_len,
448448 InvalidMonomorphization :: MismatchedLengths { span, name, m_len, v_len }
449449 ) ;
450+ // TODO: also support unsigned integers.
450451 match * m_elem_ty. kind ( ) {
451452 ty:: Int ( _) => { }
452- _ => return_error ! ( InvalidMonomorphization :: MaskType { span, name, ty: m_elem_ty } ) ,
453+ _ => return_error ! ( InvalidMonomorphization :: MaskWrongElementType {
454+ span,
455+ name,
456+ ty: m_elem_ty
457+ } ) ,
453458 }
454459 return Ok ( bx. vector_select ( args[ 0 ] . immediate ( ) , args[ 1 ] . immediate ( ) , args[ 2 ] . immediate ( ) ) ) ;
455460 }
@@ -991,19 +996,15 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
991996 assert_eq ! ( pointer_count - 1 , ptr_count( element_ty0) ) ;
992997 assert_eq ! ( underlying_ty, non_ptr( element_ty0) ) ;
993998
994- // The element type of the third argument must be a signed integer type of any width:
999+ // The element type of the third argument must be an integer type of any width:
1000+ // TODO: also support unsigned integers.
9951001 let ( _, element_ty2) = arg_tys[ 2 ] . simd_size_and_type ( bx. tcx ( ) ) ;
9961002 match * element_ty2. kind ( ) {
9971003 ty:: Int ( _) => ( ) ,
9981004 _ => {
9991005 require ! (
10001006 false ,
1001- InvalidMonomorphization :: ThirdArgElementType {
1002- span,
1003- name,
1004- expected_element: element_ty2,
1005- third_arg: arg_tys[ 2 ]
1006- }
1007+ InvalidMonomorphization :: MaskWrongElementType { span, name, ty: element_ty2 }
10071008 ) ;
10081009 }
10091010 }
@@ -1109,17 +1110,13 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
11091110 assert_eq ! ( underlying_ty, non_ptr( element_ty0) ) ;
11101111
11111112 // The element type of the third argument must be a signed integer type of any width:
1113+ // TODO: also support unsigned integers.
11121114 match * element_ty2. kind ( ) {
11131115 ty:: Int ( _) => ( ) ,
11141116 _ => {
11151117 require ! (
11161118 false ,
1117- InvalidMonomorphization :: ThirdArgElementType {
1118- span,
1119- name,
1120- expected_element: element_ty2,
1121- third_arg: arg_tys[ 2 ]
1122- }
1119+ InvalidMonomorphization :: MaskWrongElementType { span, name, ty: element_ty2 }
11231120 ) ;
11241121 }
11251122 }
0 commit comments