]> git.lizzy.rs Git - rust.git/commitdiff
std: Move simd to core::simd and reexport. #1457
authorBrian Anderson <banderson@mozilla.com>
Wed, 21 May 2014 03:24:17 +0000 (20:24 -0700)
committerBrian Anderson <banderson@mozilla.com>
Fri, 23 May 2014 22:27:48 +0000 (15:27 -0700)
[breaking-change]

src/libcore/lib.rs
src/libcore/simd.rs [new file with mode: 0644]
src/libstd/lib.rs
src/libstd/unstable/mod.rs
src/libstd/unstable/simd.rs [deleted file]
src/test/bench/shootout-mandelbrot.rs
src/test/compile-fail/simd-binop.rs
src/test/compile-fail/simd-experimental.rs
src/test/debuginfo/simd.rs
src/test/run-pass/simd-binop.rs
src/test/run-pass/simd-issue-10604.rs

index 0ddd3d8fd56e51f6a758f60ad81c24713ff9d3a2..56cbe2e2a30d187ec32bea4f82fc34ed6f1febe0 100644 (file)
@@ -53,7 +53,7 @@
        html_root_url = "http://doc.rust-lang.org/")]
 
 #![no_std]
-#![feature(globs, macro_rules, managed_boxes, phase)]
+#![feature(globs, macro_rules, managed_boxes, phase, simd)]
 #![deny(missing_doc)]
 
 #[cfg(test)] extern crate realcore = "core";
 pub mod option;
 pub mod raw;
 pub mod result;
+pub mod simd;
 pub mod slice;
 pub mod str;
 pub mod tuple;
diff --git a/src/libcore/simd.rs b/src/libcore/simd.rs
new file mode 100644 (file)
index 0000000..c0825c3
--- /dev/null
@@ -0,0 +1,62 @@
+// Copyright 2013 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 vectors
+
+#![allow(non_camel_case_types)]
+#![allow(missing_doc)]
+
+#[experimental]
+#[simd]
+pub struct i8x16(pub i8, pub i8, pub i8, pub i8,
+                 pub i8, pub i8, pub i8, pub i8,
+                 pub i8, pub i8, pub i8, pub i8,
+                 pub i8, pub i8, pub i8, pub i8);
+
+#[experimental]
+#[simd]
+pub struct i16x8(pub i16, pub i16, pub i16, pub i16,
+                 pub i16, pub i16, pub i16, pub i16);
+
+#[experimental]
+#[simd]
+pub struct i32x4(pub i32, pub i32, pub i32, pub i32);
+
+#[experimental]
+#[simd]
+pub struct i64x2(pub i64, pub i64);
+
+#[experimental]
+#[simd]
+pub struct u8x16(pub u8, pub u8, pub u8, pub u8,
+                 pub u8, pub u8, pub u8, pub u8,
+                 pub u8, pub u8, pub u8, pub u8,
+                 pub u8, pub u8, pub u8, pub u8);
+
+#[experimental]
+#[simd]
+pub struct u16x8(pub u16, pub u16, pub u16, pub u16,
+                 pub u16, pub u16, pub u16, pub u16);
+
+#[experimental]
+#[simd]
+pub struct u32x4(pub u32, pub u32, pub u32, pub u32);
+
+#[experimental]
+#[simd]
+pub struct u64x2(pub u64, pub u64);
+
+#[experimental]
+#[simd]
+pub struct f32x4(pub f32, pub f32, pub f32, pub f32);
+
+#[experimental]
+#[simd]
+pub struct f64x2(pub f64, pub f64);
index 8a7d3f394725500339eb43ec02c2cbeb749493e9..bb6f93cf087fb0b67efe7be2fd59125406fc62e1 100644 (file)
        html_favicon_url = "http://www.rust-lang.org/favicon.ico",
        html_root_url = "http://doc.rust-lang.org/")]
 #![feature(macro_rules, globs, asm, managed_boxes, thread_local, link_args,
-           simd, linkage, default_type_params, phase, concat_idents, quad_precision_float)]
+           linkage, default_type_params, phase, concat_idents, quad_precision_float)]
 
 // Don't link to std. We are std.
 #![no_std]
 #[cfg(not(test))] pub use core::ops;
 pub use core::ptr;
 pub use core::raw;
+pub use core::simd;
 pub use core::tuple;
 #[cfg(not(test))] pub use core::ty;
 pub use core::result;
index b235ec4d8c8e2275e59308fd9bbe2581fb46c6e0..2e27f4d4488c579e8602bd82c2a7654cdc801487 100644 (file)
@@ -14,7 +14,6 @@
 
 pub mod dynamic_lib;
 
-pub mod simd;
 pub mod sync;
 pub mod mutex;
 
diff --git a/src/libstd/unstable/simd.rs b/src/libstd/unstable/simd.rs
deleted file mode 100644 (file)
index a7a314d..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright 2013 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 vectors
-
-#![allow(non_camel_case_types)]
-
-#[experimental]
-#[simd]
-pub struct i8x16(pub i8, pub i8, pub i8, pub i8,
-                 pub i8, pub i8, pub i8, pub i8,
-                 pub i8, pub i8, pub i8, pub i8,
-                 pub i8, pub i8, pub i8, pub i8);
-
-#[experimental]
-#[simd]
-pub struct i16x8(pub i16, pub i16, pub i16, pub i16,
-                 pub i16, pub i16, pub i16, pub i16);
-
-#[experimental]
-#[simd]
-pub struct i32x4(pub i32, pub i32, pub i32, pub i32);
-
-#[experimental]
-#[simd]
-pub struct i64x2(pub i64, pub i64);
-
-#[experimental]
-#[simd]
-pub struct u8x16(pub u8, pub u8, pub u8, pub u8,
-                 pub u8, pub u8, pub u8, pub u8,
-                 pub u8, pub u8, pub u8, pub u8,
-                 pub u8, pub u8, pub u8, pub u8);
-
-#[experimental]
-#[simd]
-pub struct u16x8(pub u16, pub u16, pub u16, pub u16,
-                 pub u16, pub u16, pub u16, pub u16);
-
-#[experimental]
-#[simd]
-pub struct u32x4(pub u32, pub u32, pub u32, pub u32);
-
-#[experimental]
-#[simd]
-pub struct u64x2(pub u64, pub u64);
-
-#[experimental]
-#[simd]
-pub struct f32x4(pub f32, pub f32, pub f32, pub f32);
-
-#[experimental]
-#[simd]
-pub struct f64x2(pub f64, pub f64);
index 6b3079b8fc8d1246761b77f490cea9609d707352..70abebd321a94862215e0bc867f8cb381751f610 100644 (file)
@@ -17,7 +17,7 @@
 
 use std::io;
 use std::os;
-use std::unstable::simd::f64x2;
+use std::simd::f64x2;
 use sync::Future;
 use sync::Arc;
 
index 281e879592dde592a5b5ce0ba4e1c87cc4a6dd86..9fbb7364054d51c6b0d13020c1a7c6f8a7b38a37 100644 (file)
 
 #![allow(experimental)]
 
-use std::unstable::simd::f32x4;
+use std::simd::f32x4;
 
 fn main() {
 
     let _ = f32x4(0.0, 0.0, 0.0, 0.0) == f32x4(0.0, 0.0, 0.0, 0.0);
-    //~^ ERROR binary comparison operation `==` not supported for floating point SIMD vector `std::unstable::simd::f32x4`
+    //~^ ERROR binary comparison operation `==` not supported for floating point SIMD vector `core::simd::f32x4`
 
     let _ = f32x4(0.0, 0.0, 0.0, 0.0) != f32x4(0.0, 0.0, 0.0, 0.0);
-    //~^ ERROR binary comparison operation `!=` not supported for floating point SIMD vector `std::unstable::simd::f32x4`
+    //~^ ERROR binary comparison operation `!=` not supported for floating point SIMD vector `core::simd::f32x4`
 
     let _ = f32x4(0.0, 0.0, 0.0, 0.0) < f32x4(0.0, 0.0, 0.0, 0.0);
-    //~^ ERROR binary comparison operation `<` not supported for floating point SIMD vector `std::unstable::simd::f32x4`
+    //~^ ERROR binary comparison operation `<` not supported for floating point SIMD vector `core::simd::f32x4`
 
     let _ = f32x4(0.0, 0.0, 0.0, 0.0) <= f32x4(0.0, 0.0, 0.0, 0.0);
-    //~^ ERROR binary comparison operation `<=` not supported for floating point SIMD vector `std::unstable::simd::f32x4`
+    //~^ ERROR binary comparison operation `<=` not supported for floating point SIMD vector `core::simd::f32x4`
 
     let _ = f32x4(0.0, 0.0, 0.0, 0.0) >= f32x4(0.0, 0.0, 0.0, 0.0);
-    //~^ ERROR binary comparison operation `>=` not supported for floating point SIMD vector `std::unstable::simd::f32x4`
+    //~^ ERROR binary comparison operation `>=` not supported for floating point SIMD vector `core::simd::f32x4`
 
     let _ = f32x4(0.0, 0.0, 0.0, 0.0) > f32x4(0.0, 0.0, 0.0, 0.0);
-    //~^ ERROR binary comparison operation `>` not supported for floating point SIMD vector `std::unstable::simd::f32x4`
+    //~^ ERROR binary comparison operation `>` not supported for floating point SIMD vector `core::simd::f32x4`
 
 }
index f9cc4d0d8c372f1658dc1eed65a325e1d07c3e91..5f9f56bf3c0f4800e52d8ed641a87a445d127a6d 100644 (file)
@@ -10,7 +10,7 @@
 
 #![deny(experimental)]
 
-use std::unstable::simd;
+use std::simd;
 
 fn main() {
     let _ = simd::i64x2(0, 0); //~ ERROR: experimental
index ff9618aa1f1eb08a6fc363e96ba133e525b4a73a..b84405ee7270e76271bd289cb26dfc27cedd923c 100644 (file)
@@ -43,7 +43,7 @@
 #![allow(experimental)]
 #![allow(unused_variable)]
 
-use std::unstable::simd::{i8x16, i16x8,i32x4,i64x2,u8x16,u16x8,u32x4,u64x2,f32x4,f64x2};
+use std::simd::{i8x16, i16x8,i32x4,i64x2,u8x16,u16x8,u32x4,u64x2,f32x4,f64x2};
 
 fn main() {
 
index efcd99a04cedd86534ddb475e9dee433b831cc9a..7f9be78d5832db8aac58f5f06f2c57aa029a1e6a 100644 (file)
@@ -10,7 +10,7 @@
 
 #![allow(experimental)]
 
-use std::unstable::simd::{i32x4, f32x4, u32x4};
+use std::simd::{i32x4, f32x4, u32x4};
 
 fn eq_u32x4(u32x4(x0, x1, x2, x3): u32x4, u32x4(y0, y1, y2, y3): u32x4) -> bool {
     (x0 == y0) && (x1 == y1) && (x2 == y2) && (x3 == y3)
index 2e533e3b263a0186ad3815941464b2c23c0568ee..966db25a128a797849065b9f8a3d8350ac3cfc3b 100644 (file)
@@ -13,5 +13,5 @@
 #![feature(simd)]
 
 pub fn main() {
-    let _o = None::<std::unstable::simd::i32x4>;
+    let _o = None::<std::simd::i32x4>;
 }