mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-10 06:47:34 +00:00
parent
4176343073
commit
28b987b99a
@ -47,6 +47,7 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[
|
||||
("macro_registrar", Active),
|
||||
("log_syntax", Active),
|
||||
("trace_macros", Active),
|
||||
("simd", Active),
|
||||
|
||||
// These are used to test this portion of the compiler, they don't actually
|
||||
// mean anything
|
||||
@ -171,6 +172,13 @@ impl Visitor<()> for Context {
|
||||
}
|
||||
}
|
||||
|
||||
ast::ItemStruct(..) => {
|
||||
if attr::contains_name(i.attrs, "simd") {
|
||||
self.gate_feature("simd", i.span,
|
||||
"SIMD types are experimental and possibly buggy");
|
||||
}
|
||||
}
|
||||
|
||||
_ => {}
|
||||
}
|
||||
|
||||
|
@ -52,13 +52,14 @@
|
||||
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
|
||||
html_root_url = "http://static.rust-lang.org/doc/master")];
|
||||
|
||||
#[feature(macro_rules, globs, asm, managed_boxes, thread_local, link_args)];
|
||||
#[feature(macro_rules, globs, asm, managed_boxes, thread_local, link_args, simd)];
|
||||
|
||||
// Don't link to std. We are std.
|
||||
#[no_std];
|
||||
|
||||
#[deny(non_camel_case_types)];
|
||||
#[deny(missing_doc)];
|
||||
#[allow(unknown_features)];
|
||||
|
||||
// When testing libstd, bring in libuv as the I/O backend so tests can print
|
||||
// things and all of the std::io tests have an I/O interface to run on top
|
||||
|
@ -12,32 +12,42 @@
|
||||
|
||||
#[allow(non_camel_case_types)];
|
||||
|
||||
#[experimental]
|
||||
#[simd]
|
||||
pub struct i8x16(i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8);
|
||||
|
||||
#[experimental]
|
||||
#[simd]
|
||||
pub struct i16x8(i16, i16, i16, i16, i16, i16, i16, i16);
|
||||
|
||||
#[experimental]
|
||||
#[simd]
|
||||
pub struct i32x4(i32, i32, i32, i32);
|
||||
|
||||
#[experimental]
|
||||
#[simd]
|
||||
pub struct i64x2(i64, i64);
|
||||
|
||||
#[experimental]
|
||||
#[simd]
|
||||
pub struct u8x16(u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8);
|
||||
|
||||
#[experimental]
|
||||
#[simd]
|
||||
pub struct u16x8(u16, u16, u16, u16, u16, u16, u16, u16);
|
||||
|
||||
#[experimental]
|
||||
#[simd]
|
||||
pub struct u32x4(u32, u32, u32, u32);
|
||||
|
||||
#[experimental]
|
||||
#[simd]
|
||||
pub struct u64x2(u64, u64);
|
||||
|
||||
#[experimental]
|
||||
#[simd]
|
||||
pub struct f32x4(f32, f32, f32, f32);
|
||||
|
||||
#[experimental]
|
||||
#[simd]
|
||||
pub struct f64x2(f64, f64);
|
||||
|
14
src/test/compile-fail/gated-simd.rs
Normal file
14
src/test/compile-fail/gated-simd.rs
Normal file
@ -0,0 +1,14 @@
|
||||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#[simd]
|
||||
pub struct i64x2(i64, i64); //~ ERROR: SIMD types are experimental
|
||||
|
||||
fn main() {}
|
19
src/test/compile-fail/simd-experimental.rs
Normal file
19
src/test/compile-fail/simd-experimental.rs
Normal file
@ -0,0 +1,19 @@
|
||||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// xfail-test FIXME #11741 tuple structs ignore stability attributes
|
||||
|
||||
#[deny(experimental)];
|
||||
|
||||
use std::unstable::simd;
|
||||
|
||||
fn main() {
|
||||
let _ = simd::i64x2(0, 0); //~ ERROR: experimental
|
||||
}
|
@ -1,3 +1,5 @@
|
||||
#[feature(simd)];
|
||||
|
||||
#[simd]
|
||||
struct vec4<T>(T, T, T, T); //~ ERROR SIMD vector cannot be generic
|
||||
|
||||
|
@ -8,6 +8,8 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#[allow(experimental)];
|
||||
|
||||
use std::unstable::simd::{i32x4, f32x4};
|
||||
|
||||
fn test_int(e: i32) -> i32 {
|
||||
|
@ -1,3 +1,7 @@
|
||||
// xfail-fast feature doesn't work
|
||||
|
||||
#[feature(simd)];
|
||||
|
||||
#[simd]
|
||||
struct RGBA {
|
||||
r: f32,
|
||||
|
Loading…
Reference in New Issue
Block a user