@@ -131,9 +131,17 @@ unsafe extern "unadjusted" {
131
131
#[ link_name = "llvm.s390.vfaeh" ] fn vfaeh ( a : vector_signed_short , b : vector_signed_short , c : i32 ) -> vector_signed_short ;
132
132
#[ link_name = "llvm.s390.vfaef" ] fn vfaef ( a : vector_signed_int , b : vector_signed_int , c : i32 ) -> vector_signed_int ;
133
133
134
+ #[ link_name = "llvm.s390.vfaezb" ] fn vfaezb ( a : vector_signed_char , b : vector_signed_char , c : i32 ) -> vector_signed_char ;
135
+ #[ link_name = "llvm.s390.vfaezh" ] fn vfaezh ( a : vector_signed_short , b : vector_signed_short , c : i32 ) -> vector_signed_short ;
136
+ #[ link_name = "llvm.s390.vfaezf" ] fn vfaezf ( a : vector_signed_int , b : vector_signed_int , c : i32 ) -> vector_signed_int ;
137
+
134
138
#[ link_name = "llvm.s390.vfaebs" ] fn vfaebs ( a : vector_signed_char , b : vector_signed_char , c : i32 ) -> PackedTuple < vector_signed_char , i32 > ;
135
139
#[ link_name = "llvm.s390.vfaehs" ] fn vfaehs ( a : vector_signed_short , b : vector_signed_short , c : i32 ) -> PackedTuple < vector_signed_short , i32 > ;
136
140
#[ link_name = "llvm.s390.vfaefs" ] fn vfaefs ( a : vector_signed_int , b : vector_signed_int , c : i32 ) -> PackedTuple < vector_signed_int , i32 > ;
141
+
142
+ #[ link_name = "llvm.s390.vfaezbs" ] fn vfaezbs ( a : vector_signed_char , b : vector_signed_char , c : i32 ) -> PackedTuple < vector_signed_char , i32 > ;
143
+ #[ link_name = "llvm.s390.vfaezhs" ] fn vfaezhs ( a : vector_signed_short , b : vector_signed_short , c : i32 ) -> PackedTuple < vector_signed_short , i32 > ;
144
+ #[ link_name = "llvm.s390.vfaezfs" ] fn vfaezfs ( a : vector_signed_int , b : vector_signed_int , c : i32 ) -> PackedTuple < vector_signed_int , i32 > ;
137
145
}
138
146
139
147
impl_from ! { i8x16, u8x16, i16x8, u16x8, i32x4, u32x4, i64x2, u64x2, f32x4, f64x2 }
@@ -1535,85 +1543,105 @@ mod sealed {
1535
1543
impl_vec_trait ! { [ VectorSqrt vec_sqrt] vec_sqrt_f32 ( vector_float) }
1536
1544
impl_vec_trait ! { [ VectorSqrt vec_sqrt] vec_sqrt_f64 ( vector_double) }
1537
1545
1538
- #[ inline]
1539
- #[ target_feature( enable = "vector" ) ]
1540
- #[ cfg_attr( test, assert_instr( vfaeb, IMM = 0 ) ) ]
1541
- unsafe fn vfaeb < const IMM : i32 > (
1542
- a : vector_signed_char ,
1543
- b : vector_signed_char ,
1544
- ) -> vector_signed_char {
1545
- super :: vfaeb ( a, b, IMM )
1546
- }
1547
- #[ inline]
1548
- #[ target_feature( enable = "vector" ) ]
1549
- #[ cfg_attr( test, assert_instr( vfaeh, IMM = 0 ) ) ]
1550
- unsafe fn vfaeh < const IMM : i32 > (
1551
- a : vector_signed_short ,
1552
- b : vector_signed_short ,
1553
- ) -> vector_signed_short {
1554
- super :: vfaeh ( a, b, IMM )
1555
- }
1556
- #[ inline]
1557
- #[ target_feature( enable = "vector" ) ]
1558
- #[ cfg_attr( test, assert_instr( vfaef, IMM = 0 ) ) ]
1559
- unsafe fn vfaef < const IMM : i32 > (
1560
- a : vector_signed_int ,
1561
- b : vector_signed_int ,
1562
- ) -> vector_signed_int {
1563
- super :: vfaef ( a, b, IMM )
1546
+ macro_rules! vfae_wrapper {
1547
+ ( $( $name: ident $ty: ident) * ) => {
1548
+ $(
1549
+ #[ inline]
1550
+ #[ target_feature( enable = "vector" ) ]
1551
+ #[ cfg_attr( test, assert_instr( $name, IMM = 0 ) ) ]
1552
+ unsafe fn $name<const IMM : i32 >(
1553
+ a: $ty,
1554
+ b: $ty,
1555
+ ) -> $ty {
1556
+ super :: $name( a, b, IMM )
1557
+ }
1558
+ ) *
1559
+ }
1560
+ }
1561
+
1562
+ vfae_wrapper ! {
1563
+ vfaeb vector_signed_char
1564
+ vfaeh vector_signed_short
1565
+ vfaef vector_signed_int
1566
+
1567
+ vfaezb vector_signed_char
1568
+ vfaezh vector_signed_short
1569
+ vfaezf vector_signed_int
1564
1570
}
1565
1571
1566
1572
macro_rules! impl_vfae {
1567
- ( [ cc $Trait: ident $m: ident] $imm: literal $( $fun: ident $ty: ident) * ) => {
1573
+ ( [ idx_cc $Trait: ident $m: ident] $imm: ident $( $fun: ident $ty: ident $r: ident) * ) => {
1574
+ $(
1575
+ #[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
1576
+ impl $Trait<Self > for $ty {
1577
+ type Result = $r;
1578
+ #[ inline]
1579
+ #[ target_feature( enable = "vector" ) ]
1580
+ unsafe fn $m( self , b: Self , c: * mut i32 ) -> Self :: Result {
1581
+ let PackedTuple { x, y } = $fun:: <{ FindImm :: $imm as i32 } >( transmute( self ) , transmute( b) ) ;
1582
+ c. write( y) ;
1583
+ transmute( x)
1584
+ }
1585
+ }
1586
+ ) *
1587
+ } ;
1588
+ ( [ cc $Trait: ident $m: ident] $imm: ident $( $fun: ident $ty: ident) * ) => {
1568
1589
$(
1569
1590
#[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
1570
1591
impl $Trait<Self > for $ty {
1571
1592
type Result = t_b!( $ty) ;
1572
1593
#[ inline]
1573
1594
#[ target_feature( enable = "vector" ) ]
1574
1595
unsafe fn $m( self , b: Self , c: * mut i32 ) -> Self :: Result {
1575
- let PackedTuple { x, y } = $fun:: <$imm>( transmute( self ) , transmute( b) ) ;
1596
+ let PackedTuple { x, y } = $fun:: <{ FindImm :: $imm as i32 } >( transmute( self ) , transmute( b) ) ;
1576
1597
c. write( y) ;
1577
1598
transmute( x)
1578
1599
}
1579
1600
}
1580
1601
) *
1581
1602
} ;
1582
- ( [ idx $Trait: ident $m: ident] $imm: literal $( $fun: ident $ty: ident $r: ident) * ) => {
1603
+ ( [ idx $Trait: ident $m: ident] $imm: ident $( $fun: ident $ty: ident $r: ident) * ) => {
1583
1604
$(
1584
1605
#[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
1585
1606
impl $Trait<Self > for $ty {
1586
1607
type Result = $r;
1587
1608
#[ inline]
1588
1609
#[ target_feature( enable = "vector" ) ]
1589
1610
unsafe fn $m( self , b: Self ) -> Self :: Result {
1590
- transmute( $fun:: <$imm>( transmute( self ) , transmute( b) ) )
1611
+ transmute( $fun:: <{ FindImm :: $imm as i32 } >( transmute( self ) , transmute( b) ) )
1591
1612
}
1592
1613
}
1593
1614
) *
1594
1615
} ;
1595
- ( [ $Trait: ident $m: ident] $imm: literal $( $fun: ident $ty: ident) * ) => {
1616
+ ( [ $Trait: ident $m: ident] $imm: ident $( $fun: ident $ty: ident) * ) => {
1596
1617
$(
1597
1618
#[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
1598
1619
impl $Trait<Self > for $ty {
1599
1620
type Result = t_b!( $ty) ;
1600
1621
#[ inline]
1601
1622
#[ target_feature( enable = "vector" ) ]
1602
1623
unsafe fn $m( self , b: Self ) -> Self :: Result {
1603
- transmute( $fun:: <$imm>( transmute( self ) , transmute( b) ) )
1624
+ transmute( $fun:: <{ FindImm :: $imm as i32 } >( transmute( self ) , transmute( b) ) )
1604
1625
}
1605
1626
}
1606
1627
) *
1607
1628
} ;
1608
1629
}
1609
1630
1631
+ enum FindImm {
1632
+ Eq = 4 ,
1633
+ Ne = 12 ,
1634
+ EqIdx = 0 ,
1635
+ NeIdx = 8 ,
1636
+ }
1637
+
1610
1638
#[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
1611
1639
pub trait VectorFindAnyEq < Other > {
1612
1640
type Result ;
1613
1641
unsafe fn vec_find_any_eq ( self , other : Other ) -> Self :: Result ;
1614
1642
}
1615
1643
1616
- impl_vfae ! { [ VectorFindAnyEq vec_find_any_eq] 4
1644
+ impl_vfae ! { [ VectorFindAnyEq vec_find_any_eq] Eq
1617
1645
vfaeb vector_signed_char
1618
1646
vfaeb vector_unsigned_char
1619
1647
vfaeb vector_bool_char
@@ -1633,7 +1661,7 @@ mod sealed {
1633
1661
unsafe fn vec_find_any_ne ( self , other : Other ) -> Self :: Result ;
1634
1662
}
1635
1663
1636
- impl_vfae ! { [ VectorFindAnyNe vec_find_any_ne] 12
1664
+ impl_vfae ! { [ VectorFindAnyNe vec_find_any_ne] Ne
1637
1665
vfaeb vector_signed_char
1638
1666
vfaeb vector_unsigned_char
1639
1667
vfaeb vector_bool_char
@@ -1647,13 +1675,53 @@ mod sealed {
1647
1675
vfaef vector_bool_int
1648
1676
}
1649
1677
1678
+ #[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
1679
+ pub trait VectorFindAnyEqOrZeroIdx < Other > {
1680
+ type Result ;
1681
+ unsafe fn vec_find_any_eq_or_0_idx ( self , other : Other ) -> Self :: Result ;
1682
+ }
1683
+
1684
+ impl_vfae ! { [ idx VectorFindAnyEqOrZeroIdx vec_find_any_eq_or_0_idx] Eq
1685
+ vfaezb vector_signed_char vector_signed_char
1686
+ vfaezb vector_unsigned_char vector_unsigned_char
1687
+ vfaezb vector_bool_char vector_unsigned_char
1688
+
1689
+ vfaezh vector_signed_short vector_signed_short
1690
+ vfaezh vector_unsigned_short vector_unsigned_short
1691
+ vfaezh vector_bool_short vector_unsigned_short
1692
+
1693
+ vfaezf vector_signed_int vector_signed_int
1694
+ vfaezf vector_unsigned_int vector_unsigned_int
1695
+ vfaezf vector_bool_int vector_unsigned_int
1696
+ }
1697
+
1698
+ #[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
1699
+ pub trait VectorFindAnyNeOrZeroIdx < Other > {
1700
+ type Result ;
1701
+ unsafe fn vec_find_any_ne_or_0_idx ( self , other : Other ) -> Self :: Result ;
1702
+ }
1703
+
1704
+ impl_vfae ! { [ idx VectorFindAnyNeOrZeroIdx vec_find_any_ne_or_0_idx] Ne
1705
+ vfaezb vector_signed_char vector_signed_char
1706
+ vfaezb vector_unsigned_char vector_unsigned_char
1707
+ vfaezb vector_bool_char vector_unsigned_char
1708
+
1709
+ vfaezh vector_signed_short vector_signed_short
1710
+ vfaezh vector_unsigned_short vector_unsigned_short
1711
+ vfaezh vector_bool_short vector_unsigned_short
1712
+
1713
+ vfaezf vector_signed_int vector_signed_int
1714
+ vfaezf vector_unsigned_int vector_unsigned_int
1715
+ vfaezf vector_bool_int vector_unsigned_int
1716
+ }
1717
+
1650
1718
#[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
1651
1719
pub trait VectorFindAnyEqIdx < Other > {
1652
1720
type Result ;
1653
1721
unsafe fn vec_find_any_eq_idx ( self , other : Other ) -> Self :: Result ;
1654
1722
}
1655
1723
1656
- impl_vfae ! { [ idx VectorFindAnyEqIdx vec_find_any_eq_idx] 0
1724
+ impl_vfae ! { [ idx VectorFindAnyEqIdx vec_find_any_eq_idx] EqIdx
1657
1725
vfaeb vector_signed_char vector_signed_char
1658
1726
vfaeb vector_unsigned_char vector_unsigned_char
1659
1727
vfaeb vector_bool_char vector_unsigned_char
@@ -1673,7 +1741,7 @@ mod sealed {
1673
1741
unsafe fn vec_find_any_ne_idx ( self , other : Other ) -> Self :: Result ;
1674
1742
}
1675
1743
1676
- impl_vfae ! { [ idx VectorFindAnyNeIdx vec_find_any_ne_idx] 8
1744
+ impl_vfae ! { [ idx VectorFindAnyNeIdx vec_find_any_ne_idx] NeIdx
1677
1745
vfaeb vector_signed_char vector_signed_char
1678
1746
vfaeb vector_unsigned_char vector_unsigned_char
1679
1747
vfaeb vector_bool_char vector_unsigned_char
@@ -1721,7 +1789,7 @@ mod sealed {
1721
1789
unsafe fn vec_find_any_eq_cc ( self , other : Other , c : * mut i32 ) -> Self :: Result ;
1722
1790
}
1723
1791
1724
- impl_vfae ! { [ cc VectorFindAnyEqCC vec_find_any_eq_cc] 4
1792
+ impl_vfae ! { [ cc VectorFindAnyEqCC vec_find_any_eq_cc] Eq
1725
1793
vfaebs vector_signed_char
1726
1794
vfaebs vector_unsigned_char
1727
1795
vfaebs vector_bool_char
@@ -1741,7 +1809,7 @@ mod sealed {
1741
1809
unsafe fn vec_find_any_ne_cc ( self , other : Other , c : * mut i32 ) -> Self :: Result ;
1742
1810
}
1743
1811
1744
- impl_vfae ! { [ cc VectorFindAnyNeCC vec_find_any_ne_cc] 12
1812
+ impl_vfae ! { [ cc VectorFindAnyNeCC vec_find_any_ne_cc] Ne
1745
1813
vfaebs vector_signed_char
1746
1814
vfaebs vector_unsigned_char
1747
1815
vfaebs vector_bool_char
@@ -1754,6 +1822,46 @@ mod sealed {
1754
1822
vfaefs vector_unsigned_int
1755
1823
vfaefs vector_bool_int
1756
1824
}
1825
+
1826
+ #[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
1827
+ pub trait VectorFindAnyEqIdxCC < Other > {
1828
+ type Result ;
1829
+ unsafe fn vec_find_any_eq_idx_cc ( self , other : Other , c : * mut i32 ) -> Self :: Result ;
1830
+ }
1831
+
1832
+ impl_vfae ! { [ idx_cc VectorFindAnyEqIdxCC vec_find_any_eq_idx_cc] EqIdx
1833
+ vfaebs vector_signed_char vector_signed_char
1834
+ vfaebs vector_unsigned_char vector_unsigned_char
1835
+ vfaebs vector_bool_char vector_unsigned_char
1836
+
1837
+ vfaehs vector_signed_short vector_signed_short
1838
+ vfaehs vector_unsigned_short vector_unsigned_short
1839
+ vfaehs vector_bool_short vector_unsigned_short
1840
+
1841
+ vfaefs vector_signed_int vector_signed_int
1842
+ vfaefs vector_unsigned_int vector_unsigned_int
1843
+ vfaefs vector_bool_int vector_unsigned_int
1844
+ }
1845
+
1846
+ #[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
1847
+ pub trait VectorFindAnyNeIdxCC < Other > {
1848
+ type Result ;
1849
+ unsafe fn vec_find_any_ne_idx_cc ( self , other : Other , c : * mut i32 ) -> Self :: Result ;
1850
+ }
1851
+
1852
+ impl_vfae ! { [ idx_cc VectorFindAnyNeIdxCC vec_find_any_ne_idx_cc] NeIdx
1853
+ vfaebs vector_signed_char vector_signed_char
1854
+ vfaebs vector_unsigned_char vector_unsigned_char
1855
+ vfaebs vector_bool_char vector_unsigned_char
1856
+
1857
+ vfaehs vector_signed_short vector_signed_short
1858
+ vfaehs vector_unsigned_short vector_unsigned_short
1859
+ vfaehs vector_bool_short vector_unsigned_short
1860
+
1861
+ vfaefs vector_signed_int vector_signed_int
1862
+ vfaefs vector_unsigned_int vector_unsigned_int
1863
+ vfaefs vector_bool_int vector_unsigned_int
1864
+ }
1757
1865
}
1758
1866
1759
1867
/// Vector element-wise addition.
0 commit comments