add "simd" test with nightly-2019-01-01 toolchain and get it working

This commit is contained in:
Norbert Nemec 2019-09-01 22:56:26 +02:00
parent 153754eb38
commit 5c6c378128
6 changed files with 27 additions and 8 deletions

View file

@ -17,6 +17,9 @@ matrix:
env: CARGO_FEATURES="simd"
- rust: nightly
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:
- rust: nightly

View file

@ -26,8 +26,8 @@ mint = { version = "0.5", optional = true }
num-traits = "0.2"
rand = { version = "0.7", 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]
glium = "0.23"
# glium = "0.23" # causes problems with nightly-2019-01-01 needed for testing "simd"
serde_json = "1.0"

View file

@ -4,7 +4,8 @@
//! 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!
//!
//! ```rust
//! --- Doc-test disabled because glium causes problems with nightly-2019-01-01 needed for "simd"
//! ` ` `rust
//! #[macro_use]
//! extern crate glium;
//! extern crate cgmath;
@ -22,11 +23,12 @@
//! // Yuck!! (ノಥ益ಥ)ノ ┻━┻
//! };
//! # }
//! ```
//! ` ` `
//!
//! 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]
//! extern crate glium;
//! extern crate cgmath;
@ -45,7 +47,7 @@
//! // ┬─┬ノ( º _ ºノ)
//! };
//! # }
//! ```
//! ` ` `
/// Force a conversion into a 2-element array.
#[inline]

View file

@ -17,12 +17,12 @@
#![macro_use]
#[cfg(feature = "specialization")]
#[cfg(feature = "simd")]
macro_rules! default_fn {
{ $($tt:tt)* } => { default fn $( $tt )* };
}
#[cfg(not(feature = "specialization"))]
#[cfg(not(feature = "simd"))]
macro_rules! default_fn {
{ $($tt:tt)* } => { fn $( $tt )* };
}

View file

@ -13,6 +13,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use quaternion::*;
use structure::*;
use std::mem;
use std::ops::*;
use simd::f32x4 as Simdf32x4;
impl From<Simdf32x4> for Quaternion<f32> {

View file

@ -13,6 +13,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use vector::*;
use structure::*;
use std::mem;
use std::ops::*;
use simd::f32x4 as Simdf32x4;
use simd::i32x4 as Simdi32x4;
use simd::u32x4 as Simdu32x4;