#[macro_use]
mod private_macros;
#[cfg(not(any(
doc,
all(
target_arch = "x86_64",
target_feature = "avx2",
target_feature = "fma",
)
)))]
compile_error!(
"
This crate only works on x86_64 and requires the following extensions: AVX2 and FMA.
They can be enabled by adding this in `config.toml`:
[build]
rustflags = [\"-Ctarget-feature=+avx2,+fma\"]
"
);
mod traits;
pub use traits::{Mat4, Vec2, Vec4};
mod dvec2;
pub use dvec2::*;
mod dvec4;
pub use dvec4::*;
mod dmat4;
pub use dmat4::*;
mod fvec4;
pub use fvec4::*;
mod fvec2;
pub use fvec2::*;
mod fmat4;
pub use fmat4::*;
#[cfg(test)]
mod tests {
use super::*;
use core::mem::{align_of, size_of};
#[test]
fn sizes() {
assert_eq!(size_of::<Fvec2>(), 8);
assert_eq!(size_of::<Dvec2>(), 16);
assert_eq!(size_of::<Fvec4>(), 16);
assert_eq!(size_of::<Dvec4>(), 32);
assert_eq!(size_of::<Fmat4>(), 64);
assert_eq!(size_of::<Dmat4>(), 128);
}
#[test]
fn aligns() {
assert_eq!(align_of::<Fvec2>(), 4); assert_eq!(align_of::<Dvec2>(), 16);
assert_eq!(align_of::<Fvec4>(), 16);
assert_eq!(align_of::<Dvec4>(), 32);
assert_eq!(align_of::<Fmat4>(), 16);
assert_eq!(align_of::<Dmat4>(), 32);
}
}