• Home
  • Raw
  • Download

Lines Matching +full:- +full:w

1 //! Implement 256- and 512- bit in terms of 128-bit, for machines without native wide SIMD.
10 pub struct x2<W, G>(pub [W; 2], PhantomData<G>);
11 impl<W, G> x2<W, G> {
13 pub fn new(xs: [W; 2]) -> Self { in new()
19 impl<W: $trait + Copy, G> $trait for x2<W, G> {
20 type Output = x2<W::Output, G>;
22 fn $fn(self, rhs: Self) -> Self::Output {
30 impl<W: $trait + Copy, G> $trait for x2<W, G> {
42 fn $fn(self) -> Self {
47 impl<W, G> RotateEachWord32 for x2<W, G>
49 W: Copy + RotateEachWord32,
60 impl<W, G> RotateEachWord64 for x2<W, G>
62 W: Copy + RotateEachWord64,
66 impl<W, G> RotateEachWord128 for x2<W, G> where W: RotateEachWord128 {}
67 impl<W, G> BitOps0 for x2<W, G>
69 W: BitOps0,
73 impl<W, G> BitOps32 for x2<W, G>
75 W: BitOps32 + BitOps0,
79 impl<W, G> BitOps64 for x2<W, G>
81 W: BitOps64 + BitOps0,
85 impl<W, G> BitOps128 for x2<W, G>
87 W: BitOps128 + BitOps0,
98 impl<W, G> ArithOps for x2<W, G>
100 W: ArithOps,
106 impl<W: Not + Copy, G> Not for x2<W, G> {
107 type Output = x2<W::Output, G>;
109 fn not(self) -> Self::Output { in not()
113 impl<W, G> UnsafeFrom<[W; 2]> for x2<W, G> {
115 unsafe fn unsafe_from(xs: [W; 2]) -> Self { in unsafe_from()
119 impl<W: Copy, G> Vec2<W> for x2<W, G> {
121 fn extract(self, i: u32) -> W { in extract() argument
125 fn insert(mut self, w: W, i: u32) -> Self { in insert() argument
126 self.0[i as usize] = w; in insert()
130 impl<W: Copy + Store<vec128_storage>, G> Store<vec256_storage> for x2<W, G> {
132 unsafe fn unpack(p: vec256_storage) -> Self { in unpack()
134 x2::new([W::unpack(p[0]), W::unpack(p[1])]) in unpack()
137 impl<W, G> From<x2<W, G>> for vec256_storage
139 W: Copy,
140 vec128_storage: From<W>,
143 fn from(x: x2<W, G>) -> Self { in from() argument
147 impl<W, G> Swap64 for x2<W, G>
149 W: Swap64 + Copy,
159 impl<W: Copy, G> MultiLane<[W; 2]> for x2<W, G> {
161 fn to_lanes(self) -> [W; 2] { in to_lanes()
165 fn from_lanes(lanes: [W; 2]) -> Self { in from_lanes()
169 impl<W: BSwap + Copy, G> BSwap for x2<W, G> {
171 fn bswap(self) -> Self { in bswap()
175 impl<W: StoreBytes + BSwap + Copy, G> StoreBytes for x2<W, G> {
177 unsafe fn unsafe_read_le(input: &[u8]) -> Self { in unsafe_read_le()
179 x2::new([W::unsafe_read_le(input.0), W::unsafe_read_le(input.1)]) in unsafe_read_le()
182 unsafe fn unsafe_read_be(input: &[u8]) -> Self { in unsafe_read_be()
184 x2::new([W::unsafe_read_be(input.0), W::unsafe_read_be(input.1)]) in unsafe_read_be()
199 impl<W: Copy + LaneWords4, G: Copy> LaneWords4 for x2<W, G> {
201 fn shuffle_lane_words2301(self) -> Self { in shuffle_lane_words2301()
208 fn shuffle_lane_words1230(self) -> Self { in shuffle_lane_words1230()
215 fn shuffle_lane_words3012(self) -> Self { in shuffle_lane_words3012()
225 pub struct x4<W>(pub [W; 4]);
226 impl<W> x4<W> {
228 pub fn new(xs: [W; 4]) -> Self { in new()
234 impl<W: $trait + Copy> $trait for x4<W> {
235 type Output = x4<W::Output>;
237 fn $fn(self, rhs: Self) -> Self::Output {
250 impl<W: $trait + Copy> $trait for x4<W> {
264 fn $fn(self) -> Self {
274 impl<W> RotateEachWord32 for x4<W>
276 W: Copy + RotateEachWord32,
287 impl<W> RotateEachWord64 for x4<W>
289 W: Copy + RotateEachWord64,
293 impl<W> RotateEachWord128 for x4<W> where W: RotateEachWord128 {}
294 impl<W> BitOps0 for x4<W> where W: BitOps0 {}
295 impl<W> BitOps32 for x4<W> where W: BitOps32 + BitOps0 {}
296 impl<W> BitOps64 for x4<W> where W: BitOps64 + BitOps0 {}
297 impl<W> BitOps128 for x4<W> where W: BitOps128 + BitOps0 {}
305 impl<W> ArithOps for x4<W> where W: ArithOps {}
308 impl<W: Not + Copy> Not for x4<W> {
309 type Output = x4<W::Output>;
311 fn not(self) -> Self::Output { in not()
320 impl<W> UnsafeFrom<[W; 4]> for x4<W> {
322 unsafe fn unsafe_from(xs: [W; 4]) -> Self { in unsafe_from()
326 impl<W: Copy> Vec4<W> for x4<W> {
328 fn extract(self, i: u32) -> W { in extract() argument
332 fn insert(mut self, w: W, i: u32) -> Self { in insert() argument
333 self.0[i as usize] = w; in insert()
337 impl<W: Copy> Vec4Ext<W> for x4<W> {
339 fn transpose4(a: Self, b: Self, c: Self, d: Self) -> (Self, Self, Self, Self) in transpose4()
351 impl<W: Copy + Store<vec128_storage>> Store<vec512_storage> for x4<W> {
353 unsafe fn unpack(p: vec512_storage) -> Self { in unpack()
356 W::unpack(p[0]), in unpack()
357 W::unpack(p[1]), in unpack()
358 W::unpack(p[2]), in unpack()
359 W::unpack(p[3]), in unpack()
363 impl<W> From<x4<W>> for vec512_storage
365 W: Copy,
366 vec128_storage: From<W>,
369 fn from(x: x4<W>) -> Self { in from()
373 impl<W> Swap64 for x4<W>
375 W: Swap64 + Copy,
385 impl<W: Copy> MultiLane<[W; 4]> for x4<W> {
387 fn to_lanes(self) -> [W; 4] { in to_lanes()
391 fn from_lanes(lanes: [W; 4]) -> Self { in from_lanes()
395 impl<W: BSwap + Copy> BSwap for x4<W> {
397 fn bswap(self) -> Self { in bswap()
406 impl<W: StoreBytes + BSwap + Copy> StoreBytes for x4<W> {
408 unsafe fn unsafe_read_le(input: &[u8]) -> Self { in unsafe_read_le()
411 W::unsafe_read_le(&input[..n]), in unsafe_read_le()
412 W::unsafe_read_le(&input[n..n * 2]), in unsafe_read_le()
413 W::unsafe_read_le(&input[n * 2..n * 3]), in unsafe_read_le()
414 W::unsafe_read_le(&input[n * 3..]), in unsafe_read_le()
418 unsafe fn unsafe_read_be(input: &[u8]) -> Self { in unsafe_read_be()
421 W::unsafe_read_be(&input[..n]), in unsafe_read_be()
422 W::unsafe_read_be(&input[n..n * 2]), in unsafe_read_be()
423 W::unsafe_read_be(&input[n * 2..n * 3]), in unsafe_read_be()
424 W::unsafe_read_be(&input[n * 3..]), in unsafe_read_be()
444 impl<W: Copy + LaneWords4> LaneWords4 for x4<W> {
446 fn shuffle_lane_words2301(self) -> Self { in shuffle_lane_words2301()
455 fn shuffle_lane_words1230(self) -> Self { in shuffle_lane_words1230()
464 fn shuffle_lane_words3012(self) -> Self { in shuffle_lane_words3012()