forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#137900 - matthiaskrgr:rollup-rvan5ao, r=matth…
…iaskrgr Rollup of 10 pull requests Successful merges: - rust-lang#137375 (Minor internal comments fix for `BufRead::read_line`) - rust-lang#137641 (More precisely document `Global::deallocate()`'s safety.) - rust-lang#137755 (doc: update Wasmtime flags) - rust-lang#137851 (improve `simd_select` error message when used with invalid mask type) - rust-lang#137860 (rustc_target: Add msync target feature and enable it on powerpcspe targets) - rust-lang#137871 (fix `RangeBounds::is_empty` documentation) - rust-lang#137873 (Disable `f16` on Aarch64 without `neon`) - rust-lang#137876 (Adjust triagebot.toml entries for `rustc_mir_build/src/builder/`) - rust-lang#137883 (edit mailmap) - rust-lang#137886 (`name()` and `trimmed_name()` for `stable_mir::crate_def::DefId`) r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
20 changed files
with
158 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
//@ build-fail | ||
//@ ignore-emscripten | ||
|
||
// Test that the simd_{gather,scatter} intrinsics produce ok-ish error | ||
// messages when misused. | ||
|
||
#![feature(repr_simd, core_intrinsics)] | ||
#![allow(non_camel_case_types)] | ||
|
||
use std::intrinsics::simd::{simd_gather, simd_scatter}; | ||
|
||
#[repr(simd)] | ||
#[derive(Copy, Clone, PartialEq, Debug)] | ||
struct x4<T>(pub [T; 4]); | ||
|
||
fn main() { | ||
let mut x = [0_f32, 1., 2., 3., 4., 5., 6., 7.]; | ||
|
||
let default = x4([-3_f32, -3., -3., -3.]); | ||
let s_strided = x4([0_f32, 2., -3., 6.]); | ||
|
||
let mask = x4([-1_i32, -1, 0, -1]); | ||
let umask = x4([0u16; 4]); | ||
let fmask = x4([0_f32; 4]); | ||
|
||
let pointer = x.as_mut_ptr(); | ||
let pointers = | ||
unsafe { x4([pointer.offset(0), pointer.offset(2), pointer.offset(4), pointer.offset(6)]) }; | ||
|
||
unsafe { | ||
simd_gather(default, mask, mask); | ||
//~^ ERROR expected element type `i32` of second argument `x4<i32>` to be a pointer to the element type `f32` | ||
|
||
simd_gather(default, pointers, umask); | ||
//~^ ERROR expected element type `u16` of third argument `x4<u16>` to be a signed integer type | ||
|
||
simd_gather(default, pointers, fmask); | ||
//~^ ERROR expected element type `f32` of third argument `x4<f32>` to be a signed integer type | ||
} | ||
|
||
unsafe { | ||
let values = x4([42_f32, 43_f32, 44_f32, 45_f32]); | ||
simd_scatter(values, mask, mask); | ||
//~^ ERROR expected element type `i32` of second argument `x4<i32>` to be a pointer to the element type `f32` of the first argument `x4<f32>`, found `i32` != `*mut f32` | ||
|
||
simd_scatter(values, pointers, umask); | ||
//~^ ERROR expected element type `u16` of third argument `x4<u16>` to be a signed integer type | ||
|
||
simd_scatter(values, pointers, fmask); | ||
//~^ ERROR expected element type `f32` of third argument `x4<f32>` to be a signed integer type | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
error[E0511]: invalid monomorphization of `simd_gather` intrinsic: expected element type `i32` of second argument `x4<i32>` to be a pointer to the element type `f32` of the first argument `x4<f32>`, found `i32` != `*_ f32` | ||
--> $DIR/generic-gather.rs:31:9 | ||
| | ||
LL | simd_gather(default, mask, mask); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error[E0511]: invalid monomorphization of `simd_gather` intrinsic: expected element type `u16` of third argument `x4<u16>` to be a signed integer type | ||
--> $DIR/generic-gather.rs:34:9 | ||
| | ||
LL | simd_gather(default, pointers, umask); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error[E0511]: invalid monomorphization of `simd_gather` intrinsic: expected element type `f32` of third argument `x4<f32>` to be a signed integer type | ||
--> $DIR/generic-gather.rs:37:9 | ||
| | ||
LL | simd_gather(default, pointers, fmask); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error[E0511]: invalid monomorphization of `simd_scatter` intrinsic: expected element type `i32` of second argument `x4<i32>` to be a pointer to the element type `f32` of the first argument `x4<f32>`, found `i32` != `*mut f32` | ||
--> $DIR/generic-gather.rs:43:9 | ||
| | ||
LL | simd_scatter(values, mask, mask); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error[E0511]: invalid monomorphization of `simd_scatter` intrinsic: expected element type `u16` of third argument `x4<u16>` to be a signed integer type | ||
--> $DIR/generic-gather.rs:46:9 | ||
| | ||
LL | simd_scatter(values, pointers, umask); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error[E0511]: invalid monomorphization of `simd_scatter` intrinsic: expected element type `f32` of third argument `x4<f32>` to be a signed integer type | ||
--> $DIR/generic-gather.rs:49:9 | ||
| | ||
LL | simd_scatter(values, pointers, fmask); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 6 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0511`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters