add "simd" test with nightly-2019-01-01 toolchain and get it working
This commit is contained in:
parent
153754eb38
commit
5c6c378128
6 changed files with 27 additions and 8 deletions
|
@ -17,6 +17,9 @@ matrix:
|
||||||
env: CARGO_FEATURES="simd"
|
env: CARGO_FEATURES="simd"
|
||||||
- rust: nightly
|
- rust: nightly
|
||||||
env: CARGO_FEATURES="serde simd"
|
env: CARGO_FEATURES="serde simd"
|
||||||
|
- rust: nightly-2019-01-01
|
||||||
|
# an old nightly build where "simd" still worked and "specialization"
|
||||||
|
env: CARGO_FEATURES="simd"
|
||||||
allow_failures:
|
allow_failures:
|
||||||
- rust: nightly
|
- rust: nightly
|
||||||
|
|
||||||
|
|
|
@ -26,8 +26,8 @@ mint = { version = "0.5", optional = true }
|
||||||
num-traits = "0.2"
|
num-traits = "0.2"
|
||||||
rand = { version = "0.7", optional = true }
|
rand = { version = "0.7", optional = true }
|
||||||
serde = { version = "1.0", features = ["serde_derive"], optional = true }
|
serde = { version = "1.0", features = ["serde_derive"], optional = true }
|
||||||
simd = { version = "0.2", optional = true }
|
simd = { version = "0.2", optional = true } # works only in rust toolchain up to 1.32
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
glium = "0.23"
|
# glium = "0.23" # causes problems with nightly-2019-01-01 needed for testing "simd"
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
|
|
10
src/conv.rs
10
src/conv.rs
|
@ -4,7 +4,8 @@
|
||||||
//! For example, when declaring `glium` uniforms, we need to convert to fixed
|
//! For example, when declaring `glium` uniforms, we need to convert to fixed
|
||||||
//! length arrays. We can use the `Into` trait directly, but it is rather ugly!
|
//! length arrays. We can use the `Into` trait directly, but it is rather ugly!
|
||||||
//!
|
//!
|
||||||
//! ```rust
|
//! --- Doc-test disabled because glium causes problems with nightly-2019-01-01 needed for "simd"
|
||||||
|
//! ` ` `rust
|
||||||
//! #[macro_use]
|
//! #[macro_use]
|
||||||
//! extern crate glium;
|
//! extern crate glium;
|
||||||
//! extern crate cgmath;
|
//! extern crate cgmath;
|
||||||
|
@ -22,11 +23,12 @@
|
||||||
//! // Yuck!! (ノಥ益ಥ)ノ ┻━┻
|
//! // Yuck!! (ノಥ益ಥ)ノ ┻━┻
|
||||||
//! };
|
//! };
|
||||||
//! # }
|
//! # }
|
||||||
//! ```
|
//! ` ` `
|
||||||
//!
|
//!
|
||||||
//! Instead, we can use the conversion functions from the `conv` module:
|
//! Instead, we can use the conversion functions from the `conv` module:
|
||||||
//!
|
//!
|
||||||
//! ```rust
|
//! --- Doc-test disabled because glium causes problems nightly-2019-01-01 needed for "simd"
|
||||||
|
//! ` ` `rust
|
||||||
//! #[macro_use]
|
//! #[macro_use]
|
||||||
//! extern crate glium;
|
//! extern crate glium;
|
||||||
//! extern crate cgmath;
|
//! extern crate cgmath;
|
||||||
|
@ -45,7 +47,7 @@
|
||||||
//! // ┬─┬ノ( º _ ºノ)
|
//! // ┬─┬ノ( º _ ºノ)
|
||||||
//! };
|
//! };
|
||||||
//! # }
|
//! # }
|
||||||
//! ```
|
//! ` ` `
|
||||||
|
|
||||||
/// Force a conversion into a 2-element array.
|
/// Force a conversion into a 2-element array.
|
||||||
#[inline]
|
#[inline]
|
||||||
|
|
|
@ -17,12 +17,12 @@
|
||||||
|
|
||||||
#![macro_use]
|
#![macro_use]
|
||||||
|
|
||||||
#[cfg(feature = "specialization")]
|
#[cfg(feature = "simd")]
|
||||||
macro_rules! default_fn {
|
macro_rules! default_fn {
|
||||||
{ $($tt:tt)* } => { default fn $( $tt )* };
|
{ $($tt:tt)* } => { default fn $( $tt )* };
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(feature = "specialization"))]
|
#[cfg(not(feature = "simd"))]
|
||||||
macro_rules! default_fn {
|
macro_rules! default_fn {
|
||||||
{ $($tt:tt)* } => { fn $( $tt )* };
|
{ $($tt:tt)* } => { fn $( $tt )* };
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,13 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
|
use quaternion::*;
|
||||||
|
|
||||||
|
use structure::*;
|
||||||
|
|
||||||
|
use std::mem;
|
||||||
|
use std::ops::*;
|
||||||
|
|
||||||
use simd::f32x4 as Simdf32x4;
|
use simd::f32x4 as Simdf32x4;
|
||||||
|
|
||||||
impl From<Simdf32x4> for Quaternion<f32> {
|
impl From<Simdf32x4> for Quaternion<f32> {
|
||||||
|
|
|
@ -13,6 +13,13 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
|
use vector::*;
|
||||||
|
|
||||||
|
use structure::*;
|
||||||
|
|
||||||
|
use std::mem;
|
||||||
|
use std::ops::*;
|
||||||
|
|
||||||
use simd::f32x4 as Simdf32x4;
|
use simd::f32x4 as Simdf32x4;
|
||||||
use simd::i32x4 as Simdi32x4;
|
use simd::i32x4 as Simdi32x4;
|
||||||
use simd::u32x4 as Simdu32x4;
|
use simd::u32x4 as Simdu32x4;
|
||||||
|
|
Loading…
Reference in a new issue