1#![allow(non_camel_case_types)]
17
18mod f32x16_t;
19mod f32x4_t;
20mod f32x8_t;
21mod i32x4_t;
22mod i32x8_t;
23mod u16x16_t;
24mod u32x4_t;
25mod u32x8_t;
26
27pub use f32x16_t::f32x16;
28pub use f32x4_t::f32x4;
29pub use f32x8_t::f32x8;
30pub use i32x4_t::i32x4;
31pub use i32x8_t::i32x8;
32pub use tiny_skia_path::f32x2;
33pub use u16x16_t::u16x16;
34pub use u32x4_t::u32x4;
35pub use u32x8_t::u32x8;
36
37#[allow(dead_code)]
38#[inline]
39pub fn generic_bit_blend<T>(mask: T, y: T, n: T) -> T
40where
41 T: Copy + core::ops::BitXor<Output = T> + core::ops::BitAnd<Output = T>,
42{
43 n ^ ((n ^ y) & mask)
44}
45
46#[allow(dead_code)]
50pub trait FasterMinMax {
51 fn faster_min(self, rhs: f32) -> f32;
52 fn faster_max(self, rhs: f32) -> f32;
53}
54
55#[allow(dead_code)]
56impl FasterMinMax for f32 {
57 fn faster_min(self, rhs: f32) -> f32 {
58 if rhs < self {
59 rhs
60 } else {
61 self
62 }
63 }
64
65 fn faster_max(self, rhs: f32) -> f32 {
66 if self < rhs {
67 rhs
68 } else {
69 self
70 }
71 }
72}