Auto merge of #56818 - kennytm:rollup-2, r=kennytm

Rollup of 14 pull requests (first batch)

Successful merges:

 - #56562 (Update libc version required by rustc)
 - #56609 (Unconditionally emit the target-cpu LLVM attribute.)
 - #56637 (rustdoc: Fix local reexports of proc macros)
 - #56658 (Add non-panicking `maybe_new_parser_from_file` variant)
 - #56695 (Fix irrefutable matches on integer ranges)
 - #56699 (Use a `newtype_index!` within `Symbol`.)
 - #56702 ([self-profiler] Add column for percent of total time)
 - #56708 (Remove some unnecessary feature gates)
 - #56709 (Remove unneeded extra chars to reduce search-index size)
 - #56744 (specialize: remove Boxes used by Children::insert)
 - #56748 (Update panic message to be clearer about env-vars)
 - #56749 (x86: Add the `adx` target feature to whitelist)
 - #56756 (Disable btree pretty-printers on older gdbs)
 - #56789 (rustc: Add an unstable `simd_select_bitmask` intrinsic)

r? @ghost
This commit is contained in:
bors 2018-12-14 16:15:20 +00:00
commit 1897657ef0
38 changed files with 335 additions and 100 deletions

View file

@ -19,12 +19,17 @@
#[derive(Copy, Clone, PartialEq, Debug)]
pub struct f32x4(pub f32, pub f32, pub f32, pub f32);
#[repr(simd)]
#[derive(Copy, Clone, PartialEq, Debug)]
pub struct f32x8(f32, f32, f32, f32, f32, f32, f32, f32);
#[repr(simd)]
#[derive(Copy, Clone, PartialEq, Debug)]
pub struct b8x4(pub i8, pub i8, pub i8, pub i8);
extern "platform-intrinsic" {
fn simd_select<T, U>(x: T, a: U, b: U) -> U;
fn simd_select_bitmask<T, U>(x: T, a: U, b: U) -> U;
}
// CHECK-LABEL: @select
@ -33,3 +38,10 @@ pub unsafe fn select(m: b8x4, a: f32x4, b: f32x4) -> f32x4 {
// CHECK: select <4 x i1>
simd_select(m, a, b)
}
// CHECK-LABEL: @select_bitmask
#[no_mangle]
pub unsafe fn select_bitmask(m: i8, a: f32x8, b: f32x8) -> f32x8 {
// CHECK: select <8 x i1>
simd_select_bitmask(m, a, b)
}

View file

@ -13,7 +13,11 @@
// ignore-freebsd: gdb package too new
// ignore-android: FIXME(#10381)
// compile-flags:-g
// min-gdb-version 7.7
// The pretty printers being tested here require the patch from
// https://sourceware.org/bugzilla/show_bug.cgi?id=21763
// min-gdb-version 8.1
// min-lldb-version: 310
// === GDB TESTS ===================================================================================

View file

@ -2,7 +2,7 @@
{ "type": "test", "event": "started", "name": "a" }
{ "type": "test", "name": "a", "event": "ok" }
{ "type": "test", "event": "started", "name": "b" }
{ "type": "test", "name": "b", "event": "failed", "stdout": "thread 'main' panicked at 'assertion failed: false', f.rs:18:5\nnote: Run with `RUST_BACKTRACE=1` for a backtrace.\n" }
{ "type": "test", "name": "b", "event": "failed", "stdout": "thread 'main' panicked at 'assertion failed: false', f.rs:18:5\nnote: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.\n" }
{ "type": "test", "event": "started", "name": "c" }
{ "type": "test", "name": "c", "event": "ok" }
{ "type": "test", "event": "started", "name": "d" }

View file

@ -17,7 +17,8 @@ fn check_for_no_backtrace(test: std::process::Output) {
let mut it = err.lines();
assert_eq!(it.next().map(|l| l.starts_with("thread '<unnamed>' panicked at")), Some(true));
assert_eq!(it.next(), Some("note: Run with `RUST_BACKTRACE=1` for a backtrace."));
assert_eq!(it.next(), Some("note: Run with `RUST_BACKTRACE=1` \
environment variable to display a backtrace."));
assert_eq!(it.next().map(|l| l.starts_with("thread 'main' panicked at")), Some(true));
assert_eq!(it.next(), None);
}

View file

@ -26,6 +26,10 @@ struct i32x4(pub i32, pub i32, pub i32, pub i32);
#[derive(Copy, Clone, PartialEq, Debug)]
struct u32x4(pub u32, pub u32, pub u32, pub u32);
#[repr(simd)]
#[derive(Copy, Clone, PartialEq, Debug)]
struct u32x8(u32, u32, u32, u32, u32, u32, u32, u32);
#[repr(simd)]
#[derive(Copy, Clone, PartialEq, Debug)]
struct f32x4(pub f32, pub f32, pub f32, pub f32);
@ -36,6 +40,7 @@ struct b8x4(pub i8, pub i8, pub i8, pub i8);
extern "platform-intrinsic" {
fn simd_select<T, U>(x: T, a: U, b: U) -> U;
fn simd_select_bitmask<T, U>(x: T, a: U, b: U) -> U;
}
fn main() {
@ -146,4 +151,29 @@ fn main() {
let e = b8x4(t, f, t, t);
assert_eq!(r, e);
}
unsafe {
let a = u32x8(0, 1, 2, 3, 4, 5, 6, 7);
let b = u32x8(8, 9, 10, 11, 12, 13, 14, 15);
let r: u32x8 = simd_select_bitmask(0u8, a, b);
let e = b;
assert_eq!(r, e);
let r: u32x8 = simd_select_bitmask(0xffu8, a, b);
let e = a;
assert_eq!(r, e);
let r: u32x8 = simd_select_bitmask(0b01010101u8, a, b);
let e = u32x8(0, 9, 2, 11, 4, 13, 6, 15);
assert_eq!(r, e);
let r: u32x8 = simd_select_bitmask(0b10101010u8, a, b);
let e = u32x8(8, 1, 10, 3, 12, 5, 14, 7);
assert_eq!(r, e);
let r: u32x8 = simd_select_bitmask(0b11110000u8, a, b);
let e = u32x8(8, 9, 10, 11, 4, 5, 6, 7);
assert_eq!(r, e);
}
}

View file

@ -13,13 +13,13 @@ error[E0425]: cannot find value `no` in this scope
| ^^ not found in this scope
thread '$DIR/failed-doctest-output.rs - OtherStruct (line 27)' panicked at 'couldn't compile the test', src/librustdoc/test.rs:326:13
note: Run with `RUST_BACKTRACE=1` for a backtrace.
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
---- $DIR/failed-doctest-output.rs - SomeStruct (line 21) stdout ----
thread '$DIR/failed-doctest-output.rs - SomeStruct (line 21)' panicked at 'test executable failed:
thread 'main' panicked at 'oh no', $DIR/failed-doctest-output.rs:3:1
note: Run with `RUST_BACKTRACE=1` for a backtrace.
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
', src/librustdoc/test.rs:361:17

View file

@ -61,3 +61,16 @@ pub fn some_proc_attr(_attr: TokenStream, item: TokenStream) -> TokenStream {
pub fn some_derive(_item: TokenStream) -> TokenStream {
TokenStream::new()
}
// @has some_macros/foo/index.html
pub mod foo {
// @has - '//code' 'pub use some_proc_macro;'
// @has - '//a/@href' '../../some_macros/macro.some_proc_macro.html'
pub use some_proc_macro;
// @has - '//code' 'pub use some_proc_attr;'
// @has - '//a/@href' '../../some_macros/attr.some_proc_attr.html'
pub use some_proc_attr;
// @has - '//code' 'pub use some_derive;'
// @has - '//a/@href' '../../some_macros/derive.SomeDerive.html'
pub use some_derive;
}

View file

@ -0,0 +1,8 @@
// run-pass
fn main() {
let -2147483648..=2147483647 = 1;
let 0..=255 = 0u8;
let -128..=127 = 0i8;
let '\u{0000}'..='\u{10FFFF}' = 'v';
}

View file

@ -33,6 +33,7 @@ struct b8x8(pub i8, pub i8, pub i8, pub i8,
extern "platform-intrinsic" {
fn simd_select<T, U>(x: T, a: U, b: U) -> U;
fn simd_select_bitmask<T, U>(x: T, a: U, b: U) -> U;
}
fn main() {
@ -52,5 +53,14 @@ fn main() {
simd_select(z, z, z);
//~^ ERROR mask element type is `f32`, expected `i_`
simd_select_bitmask(0u8, x, x);
//~^ ERROR mask length `8` != other vector length `4`
simd_select_bitmask(0.0f32, x, x);
//~^ ERROR `f32` is not an integral type
simd_select_bitmask("x", x, x);
//~^ ERROR `&str` is not an integral type
}
}

View file

@ -1,21 +1,39 @@
error[E0511]: invalid monomorphization of `simd_select` intrinsic: mismatched lengths: mask length `8` != other vector length `4`
--> $DIR/simd-intrinsic-generic-select.rs:47:9
--> $DIR/simd-intrinsic-generic-select.rs:48:9
|
LL | simd_select(m8, x, x);
| ^^^^^^^^^^^^^^^^^^^^^
error[E0511]: invalid monomorphization of `simd_select` intrinsic: mask element type is `u32`, expected `i_`
--> $DIR/simd-intrinsic-generic-select.rs:50:9
--> $DIR/simd-intrinsic-generic-select.rs:51:9
|
LL | simd_select(x, x, x);
| ^^^^^^^^^^^^^^^^^^^^
error[E0511]: invalid monomorphization of `simd_select` intrinsic: mask element type is `f32`, expected `i_`
--> $DIR/simd-intrinsic-generic-select.rs:53:9
--> $DIR/simd-intrinsic-generic-select.rs:54:9
|
LL | simd_select(z, z, z);
| ^^^^^^^^^^^^^^^^^^^^
error: aborting due to 3 previous errors
error[E0511]: invalid monomorphization of `simd_select_bitmask` intrinsic: mismatched lengths: mask length `8` != other vector length `4`
--> $DIR/simd-intrinsic-generic-select.rs:57:9
|
LL | simd_select_bitmask(0u8, x, x);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0511]: invalid monomorphization of `simd_select_bitmask` intrinsic: `f32` is not an integral type
--> $DIR/simd-intrinsic-generic-select.rs:60:9
|
LL | simd_select_bitmask(0.0f32, x, x);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0511]: invalid monomorphization of `simd_select_bitmask` intrinsic: `&str` is not an integral type
--> $DIR/simd-intrinsic-generic-select.rs:63:9
|
LL | simd_select_bitmask("x", x, x);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 6 previous errors
For more information about this error, try `rustc --explain E0511`.