@@ -52,18 +52,18 @@ fn rotate() {
52
52
#[ cfg_attr( target_arch = "wasm32" , wasm_bindgen_test) ]
53
53
fn shift ( ) {
54
54
let a = Simd :: from_array ( [ 1 , 2 , 3 , 4 ] ) ;
55
- assert_eq ! ( a. shift_elements_left:: <0 >( ) . to_array( ) , [ 1 , 2 , 3 , 4 ] ) ;
56
- assert_eq ! ( a. shift_elements_left:: <1 >( ) . to_array( ) , [ 2 , 3 , 4 , 0 ] ) ;
57
- assert_eq ! ( a. shift_elements_left:: <2 >( ) . to_array( ) , [ 3 , 4 , 0 , 0 ] ) ;
58
- assert_eq ! ( a. shift_elements_left:: <3 >( ) . to_array( ) , [ 4 , 0 , 0 , 0 ] ) ;
59
- assert_eq ! ( a. shift_elements_left:: <4 >( ) . to_array( ) , [ 0 , 0 , 0 , 0 ] ) ;
60
- assert_eq ! ( a. shift_elements_left:: <5 >( ) . to_array( ) , [ 0 , 0 , 0 , 0 ] ) ;
61
- assert_eq ! ( a. shift_elements_right:: <0 >( ) . to_array( ) , [ 1 , 2 , 3 , 4 ] ) ;
62
- assert_eq ! ( a. shift_elements_right:: <1 >( ) . to_array( ) , [ 0 , 1 , 2 , 3 ] ) ;
63
- assert_eq ! ( a. shift_elements_right:: <2 >( ) . to_array( ) , [ 0 , 0 , 1 , 2 ] ) ;
64
- assert_eq ! ( a. shift_elements_right:: <3 >( ) . to_array( ) , [ 0 , 0 , 0 , 1 ] ) ;
65
- assert_eq ! ( a. shift_elements_right:: <4 >( ) . to_array( ) , [ 0 , 0 , 0 , 0 ] ) ;
66
- assert_eq ! ( a. shift_elements_right:: <5 >( ) . to_array( ) , [ 0 , 0 , 0 , 0 ] ) ;
55
+ assert_eq ! ( a. shift_elements_left:: <0 >( 0 ) . to_array( ) , [ 1 , 2 , 3 , 4 ] ) ;
56
+ assert_eq ! ( a. shift_elements_left:: <1 >( 0 ) . to_array( ) , [ 2 , 3 , 4 , 0 ] ) ;
57
+ assert_eq ! ( a. shift_elements_left:: <2 >( 9 ) . to_array( ) , [ 3 , 4 , 9 , 9 ] ) ;
58
+ assert_eq ! ( a. shift_elements_left:: <3 >( 8 ) . to_array( ) , [ 4 , 8 , 8 , 8 ] ) ;
59
+ assert_eq ! ( a. shift_elements_left:: <4 >( 7 ) . to_array( ) , [ 7 , 7 , 7 , 7 ] ) ;
60
+ assert_eq ! ( a. shift_elements_left:: <5 >( 6 ) . to_array( ) , [ 6 , 6 , 6 , 6 ] ) ;
61
+ assert_eq ! ( a. shift_elements_right:: <0 >( 0 ) . to_array( ) , [ 1 , 2 , 3 , 4 ] ) ;
62
+ assert_eq ! ( a. shift_elements_right:: <1 >( 0 ) . to_array( ) , [ 0 , 1 , 2 , 3 ] ) ;
63
+ assert_eq ! ( a. shift_elements_right:: <2 >( - 1 ) . to_array( ) , [ - 1 , - 1 , 1 , 2 ] ) ;
64
+ assert_eq ! ( a. shift_elements_right:: <3 >( - 2 ) . to_array( ) , [ - 2 , - 2 , - 2 , 1 ] ) ;
65
+ assert_eq ! ( a. shift_elements_right:: <4 >( - 3 ) . to_array( ) , [ - 3 , - 3 , - 3 , - 3 ] ) ;
66
+ assert_eq ! ( a. shift_elements_right:: <5 >( - 4 ) . to_array( ) , [ - 4 , - 4 , - 4 , - 4 ] ) ;
67
67
}
68
68
69
69
#[ test]
0 commit comments