@@ -1623,16 +1623,70 @@ pub unsafe fn vextq_s8(a: int8x16_t, b: int8x16_t, n: i32) -> int8x16_t {
1623
1623
}
1624
1624
}
1625
1625
1626
+ //uint8x16_t vshrq_n_u8 (uint8x16_t a, const int n)
1627
+ #[ inline]
1628
+ #[ target_feature( enable = "neon" ) ]
1629
+ #[ cfg_attr( target_arch = "arm" , target_feature( enable = "v7" ) ) ]
1630
+ #[ cfg_attr( test, assert_instr( ushr) ) ]
1631
+ pub unsafe fn vshrq_n_u8 ( a : uint8x16_t , n : i32 ) -> uint8x16_t {
1632
+ uint8x16_t (
1633
+ a. 0 >> n, a. 1 >> n, a. 2 >> n, a. 3 >> n,
1634
+ a. 4 >> n, a. 5 >> n, a. 6 >> n, a. 7 >> n,
1635
+ a. 8 >> n, a. 9 >> n, a. 10 >> n, a. 11 >> n,
1636
+ a. 12 >> n, a. 13 >> n, a. 14 >> n, a. 15 >> n
1637
+ )
1638
+ }
1626
1639
1627
1640
1641
+ //uint8x16_t vshlq_n_u8 (uint8x16_t a, const int n)
1642
+ #[ inline]
1643
+ #[ target_feature( enable = "neon" ) ]
1644
+ #[ cfg_attr( target_arch = "arm" , target_feature( enable = "v7" ) ) ]
1645
+ #[ cfg_attr( test, assert_instr( ushl) ) ]
1646
+ pub unsafe fn vshlq_n_u8 ( a : uint8x16_t , n : i32 ) -> uint8x16_t {
1647
+ uint8x16_t (
1648
+ a. 0 << n, a. 1 << n, a. 2 << n, a. 3 << n,
1649
+ a. 4 << n, a. 5 << n, a. 6 << n, a. 7 << n,
1650
+ a. 8 << n, a. 9 << n, a. 10 << n, a. 11 << n,
1651
+ a. 12 << n, a. 13 << n, a. 14 << n, a. 15 << n
1652
+ )
1653
+ }
1654
+
1628
1655
#[ cfg( test) ]
1629
1656
mod tests {
1630
1657
use crate :: core_arch:: { arm:: * , simd:: * } ;
1631
1658
use std:: { i16, i32, i8, mem:: transmute, u16, u32, u8} ;
1632
1659
use stdarch_test:: simd_test;
1633
1660
1661
+ #[ simd_test( enable = "neon" ) ]
1662
+ unsafe fn test_vshrq_n_u8 ( ) {
1663
+ let a = u8x16:: new (
1664
+ 1 , 2 , 3 , 4 ,
1665
+ 5 , 6 , 7 , 8 ,
1666
+ 9 , 10 , 11 , 12 ,
1667
+ 13 , 14 , 15 , 16
1668
+ ) ;
1669
+ let e = u8x16:: new (
1670
+ 0 , 0 , 0 , 1 , 1 , 1 , 1 , 2 , 2 , 2 , 2 , 3 , 3 , 3 , 3 , 4
1671
+ ) ;
1672
+ let r: u8x16 = transmute ( vshrq_n_u8 ( transmute ( a) , 2 ) ) ;
1673
+ assert_eq ! ( r, e) ;
1674
+ }
1634
1675
1635
- //uint8x16_t vqsubq_u8 (uint8x16_t a, uint8x16_t b)
1676
+ #[ simd_test( enable = "neon" ) ]
1677
+ unsafe fn test_vshlq_n_u8 ( ) {
1678
+ let a = u8x16:: new (
1679
+ 1 , 2 , 3 , 4 ,
1680
+ 5 , 6 , 7 , 8 ,
1681
+ 9 , 10 , 11 , 12 ,
1682
+ 13 , 14 , 15 , 16
1683
+ ) ;
1684
+ let e = u8x16:: new (
1685
+ 4 , 8 , 12 , 16 , 20 , 24 , 28 , 32 , 36 , 40 , 44 , 48 , 52 , 56 , 60 , 64
1686
+ ) ;
1687
+ let r: u8x16 = transmute ( vshlq_n_u8 ( transmute ( a) , 2 ) ) ;
1688
+ assert_eq ! ( r, e) ;
1689
+ }
1636
1690
1637
1691
#[ simd_test( enable = "neon" ) ]
1638
1692
unsafe fn test_vqsubq_u8 ( ) {
@@ -1657,6 +1711,7 @@ mod tests {
1657
1711
let r: u8x16 = transmute ( vqsubq_u8 ( transmute ( a) , transmute ( b) ) ) ;
1658
1712
assert_eq ! ( r, e) ;
1659
1713
}
1714
+
1660
1715
#[ simd_test( enable = "neon" ) ]
1661
1716
unsafe fn test_vqmovn_u64 ( ) {
1662
1717
let a = u64x2:: new ( 1 , 2 ) ;
@@ -3107,7 +3162,6 @@ mod tests {
3107
3162
assert_eq ! ( r, c) ;
3108
3163
}
3109
3164
3110
-
3111
3165
#[ simd_test( enable = "neon" ) ]
3112
3166
unsafe fn test_vcle_f32 ( ) {
3113
3167
let a = f32x2:: new ( 0.1 , 2.3 ) ;
0 commit comments