1 #![allow(unknown_lints)]
2 #![allow(unused_macros)]
3 
4 use enc::{v8, s8};
5 use enc::util::FastLog2;
6 pub type Mem256f = v8;
7 pub type Mem256i = s8;
8 pub type v256 = v8;
9 pub type v256i = s8;
sum8(x: v256) -> f3210 pub fn sum8(x: v256) -> f32 {
11     x.extract(0) + x.extract(1) + x.extract(2) + x.extract(3) +
12         x.extract(4) + x.extract(5) + x.extract(6) + x.extract(7)
13 }
14 
sum8i(x: v256i) -> i3215 pub fn sum8i(x: v256i) -> i32 {
16     x.extract(0).wrapping_add(x.extract(1)).wrapping_add( x.extract(2)).wrapping_add( x.extract(3)).wrapping_add(
17         x.extract(4)).wrapping_add( x.extract(5)).wrapping_add( x.extract(6)).wrapping_add(x.extract(7))
18 }
19 
log2i(x: v256i) -> v25620 pub fn log2i(x: v256i) -> v256 {
21     v256::new(FastLog2(x.extract(0) as u64),
22               FastLog2(x.extract(1) as u64),
23               FastLog2(x.extract(2) as u64),
24               FastLog2(x.extract(3) as u64),
25               FastLog2(x.extract(4) as u64),
26               FastLog2(x.extract(5) as u64),
27               FastLog2(x.extract(6) as u64),
28               FastLog2(x.extract(7) as u64))
29 }
cast_i32_to_f32(x: v256i) -> v25630 pub fn cast_i32_to_f32(x: v256i) -> v256 {
31     v256::new(x.extract(0) as f32,
32               x.extract(1) as f32,
33               x.extract(2) as f32,
34               x.extract(3) as f32,
35               x.extract(4) as f32,
36               x.extract(5) as f32,
37               x.extract(6) as f32,
38               x.extract(7) as f32)
39 }
cast_f32_to_i32(x: v256) -> v256i40 pub fn cast_f32_to_i32(x: v256) -> v256i {
41     v256i::new(x.extract(0) as i32,
42               x.extract(1) as i32,
43               x.extract(2) as i32,
44               x.extract(3) as i32,
45               x.extract(4) as i32,
46               x.extract(5) as i32,
47               x.extract(6) as i32,
48               x.extract(7) as i32)
49 }
50