Skip to content

Commit e271119

Browse files
committed
Undo the changes to bitmask validation messages
1 parent c2fb555 commit e271119

File tree

3 files changed

+10
-18
lines changed

3 files changed

+10
-18
lines changed

compiler/rustc_codegen_llvm/src/intrinsic.rs

+6-14
Original file line numberDiff line numberDiff line change
@@ -1549,17 +1549,13 @@ fn generic_simd_intrinsic<'ll, 'tcx>(
15491549
}
15501550
);
15511551

1552-
let expected_int_bits = (mask_len.max(8) - 1).next_power_of_two();
1553-
let expected_bytes = mask_len / 8 + ((mask_len % 8 > 0) as u64);
1554-
15551552
require!(
15561553
matches!(mask_elem.kind(), ty::Int(_)),
1557-
InvalidMonomorphization::InvalidBitmask {
1554+
InvalidMonomorphization::ThirdArgElementType {
15581555
span,
15591556
name,
1560-
mask_ty,
1561-
expected_int_bits,
1562-
expected_bytes
1557+
expected_element: values_elem,
1558+
third_arg: mask_ty,
15631559
}
15641560
);
15651561

@@ -1645,17 +1641,13 @@ fn generic_simd_intrinsic<'ll, 'tcx>(
16451641
}
16461642
);
16471643

1648-
let expected_int_bits = (mask_len.max(8) - 1).next_power_of_two();
1649-
let expected_bytes = mask_len / 8 + ((mask_len % 8 > 0) as u64);
1650-
16511644
require!(
16521645
matches!(mask_elem.kind(), ty::Int(_)),
1653-
InvalidMonomorphization::InvalidBitmask {
1646+
InvalidMonomorphization::ThirdArgElementType {
16541647
span,
16551648
name,
1656-
mask_ty,
1657-
expected_int_bits,
1658-
expected_bytes
1649+
expected_element: values_elem,
1650+
third_arg: mask_ty,
16591651
}
16601652
);
16611653

tests/ui/simd/masked-load-store-build-fail.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ fn main() {
4141
arr.as_ptr(),
4242
default
4343
);
44-
//~^^^^^ ERROR invalid bitmask `Simd<u8, 4>`, expected `u8` or `[u8; 1]`
44+
//~^^^^^ ERROR expected element type `u8` of third argument `Simd<u8, 4>` to be a signed integer type
4545

4646
simd_masked_store(
4747
Simd([-1i8; 4]),
@@ -69,6 +69,6 @@ fn main() {
6969
arr.as_mut_ptr(),
7070
Simd([5u8; 4])
7171
);
72-
//~^^^^^ ERROR invalid bitmask `Simd<u32, 4>`, expected `u8` or `[u8; 1]
72+
//~^^^^^ ERROR expected element type `u8` of third argument `Simd<u32, 4>` to be a signed integer type
7373
}
7474
}

tests/ui/simd/masked-load-store-build-fail.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ LL | | Simd::<u32, 4>([9; 4])
2828
LL | | );
2929
| |_________^
3030

31-
error[E0511]: invalid monomorphization of `simd_masked_load` intrinsic: invalid bitmask `Simd<u8, 4>`, expected `u8` or `[u8; 1]`
31+
error[E0511]: invalid monomorphization of `simd_masked_load` intrinsic: expected element type `u8` of third argument `Simd<u8, 4>` to be a signed integer type
3232
--> $DIR/masked-load-store-build-fail.rs:39:9
3333
|
3434
LL | / simd_masked_load(
@@ -68,7 +68,7 @@ LL | | Simd([5u8; 2])
6868
LL | | );
6969
| |_________^
7070

71-
error[E0511]: invalid monomorphization of `simd_masked_store` intrinsic: invalid bitmask `Simd<u32, 4>`, expected `u8` or `[u8; 1]`
71+
error[E0511]: invalid monomorphization of `simd_masked_store` intrinsic: expected element type `u8` of third argument `Simd<u32, 4>` to be a signed integer type
7272
--> $DIR/masked-load-store-build-fail.rs:67:9
7373
|
7474
LL | / simd_masked_store(

0 commit comments

Comments
 (0)