diff --git a/Cargo.toml b/Cargo.toml index 63ac7b2..0c54031 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,3 +13,4 @@ license = "MIT" [dependencies] rand = "0.5" rand_core = "0.2" +packed_simd = "0.1" diff --git a/README.md b/README.md index 1082b27..000be02 100644 --- a/README.md +++ b/README.md @@ -5,10 +5,11 @@ sfmt [![docs.rs](https://docs.rs/sfmt/badge.svg)](https://docs.rs/sfmt) [![Build Status](https://travis-ci.org/termoshtt/rust-sfmt.svg?branch=master)](https://travis-ci.org/termoshtt/rust-sfmt) -Rust implementation of [SIMD-oriented Fast Mersenne Twister (SFMT)] using [stable SIMD] +Rust implementation of [SIMD-oriented Fast Mersenne Twister (SFMT)] [SIMD-oriented Fast Mersenne Twister (SFMT)]: http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/ -[stable SIMD]: https://github.com/rust-lang/rfcs/blob/master/text/2325-stable-simd.md + +Be sure that this crate works only on nightly due to [packed_simd](https://github.com/rust-lang-nursery/packed_simd). License -------- diff --git a/src/lib.rs b/src/lib.rs index efa8f2d..7063645 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -12,16 +12,15 @@ //! println!("random u32 number = {}", r); //! ``` -#![feature(stdsimd)] - +extern crate packed_simd; extern crate rand; extern crate rand_core; mod sfmt; mod thread_rng; +use packed_simd::*; use rand_core::{impls, Error, RngCore, SeedableRng}; -use std::simd::*; pub use thread_rng::{thread_rng, ThreadRng}; diff --git a/src/sfmt.rs b/src/sfmt.rs index 088b6d5..4cdaeeb 100644 --- a/src/sfmt.rs +++ b/src/sfmt.rs @@ -1,6 +1,6 @@ //! Rust re-implementation of SFMT -use std::simd::{i32x4, u32x4}; +use packed_simd::{i32x4, u32x4}; use super::SFMT;