@@ -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 }
@@ -1539,85 +1547,105 @@ mod sealed {
1539
1547
impl_vec_trait ! { [ VectorSqrt vec_sqrt] vec_sqrt_f32 ( vector_float) }
1540
1548
impl_vec_trait ! { [ VectorSqrt vec_sqrt] vec_sqrt_f64 ( vector_double) }
1541
1549
1542
- #[ inline]
1543
- #[ target_feature( enable = "vector" ) ]
1544
- #[ cfg_attr( test, assert_instr( vfaeb, IMM = 0 ) ) ]
1545
- unsafe fn vfaeb < const IMM : i32 > (
1546
- a : vector_signed_char ,
1547
- b : vector_signed_char ,
1548
- ) -> vector_signed_char {
1549
- super :: vfaeb ( a, b, IMM )
1550
- }
1551
- #[ inline]
1552
- #[ target_feature( enable = "vector" ) ]
1553
- #[ cfg_attr( test, assert_instr( vfaeh, IMM = 0 ) ) ]
1554
- unsafe fn vfaeh < const IMM : i32 > (
1555
- a : vector_signed_short ,
1556
- b : vector_signed_short ,
1557
- ) -> vector_signed_short {
1558
- super :: vfaeh ( a, b, IMM )
1559
- }
1560
- #[ inline]
1561
- #[ target_feature( enable = "vector" ) ]
1562
- #[ cfg_attr( test, assert_instr( vfaef, IMM = 0 ) ) ]
1563
- unsafe fn vfaef < const IMM : i32 > (
1564
- a : vector_signed_int ,
1565
- b : vector_signed_int ,
1566
- ) -> vector_signed_int {
1567
- super :: vfaef ( a, b, IMM )
1550
+ macro_rules! vfae_wrapper {
1551
+ ( $( $name: ident $ty: ident) * ) => {
1552
+ $(
1553
+ #[ inline]
1554
+ #[ target_feature( enable = "vector" ) ]
1555
+ #[ cfg_attr( test, assert_instr( $name, IMM = 0 ) ) ]
1556
+ unsafe fn $name<const IMM : i32 >(
1557
+ a: $ty,
1558
+ b: $ty,
1559
+ ) -> $ty {
1560
+ super :: $name( a, b, IMM )
1561
+ }
1562
+ ) *
1563
+ }
1564
+ }
1565
+
1566
+ vfae_wrapper ! {
1567
+ vfaeb vector_signed_char
1568
+ vfaeh vector_signed_short
1569
+ vfaef vector_signed_int
1570
+
1571
+ vfaezb vector_signed_char
1572
+ vfaezh vector_signed_short
1573
+ vfaezf vector_signed_int
1568
1574
}
1569
1575
1570
1576
macro_rules! impl_vfae {
1571
- ( [ cc $Trait: ident $m: ident] $imm: literal $( $fun: ident $ty: ident) * ) => {
1577
+ ( [ idx_cc $Trait: ident $m: ident] $imm: ident $( $fun: ident $ty: ident $r: ident) * ) => {
1578
+ $(
1579
+ #[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
1580
+ impl $Trait<Self > for $ty {
1581
+ type Result = $r;
1582
+ #[ inline]
1583
+ #[ target_feature( enable = "vector" ) ]
1584
+ unsafe fn $m( self , b: Self , c: * mut i32 ) -> Self :: Result {
1585
+ let PackedTuple { x, y } = $fun:: <{ FindImm :: $imm as i32 } >( transmute( self ) , transmute( b) ) ;
1586
+ c. write( y) ;
1587
+ transmute( x)
1588
+ }
1589
+ }
1590
+ ) *
1591
+ } ;
1592
+ ( [ cc $Trait: ident $m: ident] $imm: ident $( $fun: ident $ty: ident) * ) => {
1572
1593
$(
1573
1594
#[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
1574
1595
impl $Trait<Self > for $ty {
1575
1596
type Result = t_b!( $ty) ;
1576
1597
#[ inline]
1577
1598
#[ target_feature( enable = "vector" ) ]
1578
1599
unsafe fn $m( self , b: Self , c: * mut i32 ) -> Self :: Result {
1579
- let PackedTuple { x, y } = $fun:: <$imm>( transmute( self ) , transmute( b) ) ;
1600
+ let PackedTuple { x, y } = $fun:: <{ FindImm :: $imm as i32 } >( transmute( self ) , transmute( b) ) ;
1580
1601
c. write( y) ;
1581
1602
transmute( x)
1582
1603
}
1583
1604
}
1584
1605
) *
1585
1606
} ;
1586
- ( [ idx $Trait: ident $m: ident] $imm: literal $( $fun: ident $ty: ident $r: ident) * ) => {
1607
+ ( [ idx $Trait: ident $m: ident] $imm: ident $( $fun: ident $ty: ident $r: ident) * ) => {
1587
1608
$(
1588
1609
#[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
1589
1610
impl $Trait<Self > for $ty {
1590
1611
type Result = $r;
1591
1612
#[ inline]
1592
1613
#[ target_feature( enable = "vector" ) ]
1593
1614
unsafe fn $m( self , b: Self ) -> Self :: Result {
1594
- transmute( $fun:: <$imm>( transmute( self ) , transmute( b) ) )
1615
+ transmute( $fun:: <{ FindImm :: $imm as i32 } >( transmute( self ) , transmute( b) ) )
1595
1616
}
1596
1617
}
1597
1618
) *
1598
1619
} ;
1599
- ( [ $Trait: ident $m: ident] $imm: literal $( $fun: ident $ty: ident) * ) => {
1620
+ ( [ $Trait: ident $m: ident] $imm: ident $( $fun: ident $ty: ident) * ) => {
1600
1621
$(
1601
1622
#[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
1602
1623
impl $Trait<Self > for $ty {
1603
1624
type Result = t_b!( $ty) ;
1604
1625
#[ inline]
1605
1626
#[ target_feature( enable = "vector" ) ]
1606
1627
unsafe fn $m( self , b: Self ) -> Self :: Result {
1607
- transmute( $fun:: <$imm>( transmute( self ) , transmute( b) ) )
1628
+ transmute( $fun:: <{ FindImm :: $imm as i32 } >( transmute( self ) , transmute( b) ) )
1608
1629
}
1609
1630
}
1610
1631
) *
1611
1632
} ;
1612
1633
}
1613
1634
1635
+ enum FindImm {
1636
+ Eq = 4 ,
1637
+ Ne = 12 ,
1638
+ EqIdx = 0 ,
1639
+ NeIdx = 8 ,
1640
+ }
1641
+
1614
1642
#[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
1615
1643
pub trait VectorFindAnyEq < Other > {
1616
1644
type Result ;
1617
1645
unsafe fn vec_find_any_eq ( self , other : Other ) -> Self :: Result ;
1618
1646
}
1619
1647
1620
- impl_vfae ! { [ VectorFindAnyEq vec_find_any_eq] 4
1648
+ impl_vfae ! { [ VectorFindAnyEq vec_find_any_eq] Eq
1621
1649
vfaeb vector_signed_char
1622
1650
vfaeb vector_unsigned_char
1623
1651
vfaeb vector_bool_char
@@ -1637,7 +1665,7 @@ mod sealed {
1637
1665
unsafe fn vec_find_any_ne ( self , other : Other ) -> Self :: Result ;
1638
1666
}
1639
1667
1640
- impl_vfae ! { [ VectorFindAnyNe vec_find_any_ne] 12
1668
+ impl_vfae ! { [ VectorFindAnyNe vec_find_any_ne] Ne
1641
1669
vfaeb vector_signed_char
1642
1670
vfaeb vector_unsigned_char
1643
1671
vfaeb vector_bool_char
@@ -1651,13 +1679,53 @@ mod sealed {
1651
1679
vfaef vector_bool_int
1652
1680
}
1653
1681
1682
+ #[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
1683
+ pub trait VectorFindAnyEqOrZeroIdx < Other > {
1684
+ type Result ;
1685
+ unsafe fn vec_find_any_eq_or_0_idx ( self , other : Other ) -> Self :: Result ;
1686
+ }
1687
+
1688
+ impl_vfae ! { [ idx VectorFindAnyEqOrZeroIdx vec_find_any_eq_or_0_idx] Eq
1689
+ vfaezb vector_signed_char vector_signed_char
1690
+ vfaezb vector_unsigned_char vector_unsigned_char
1691
+ vfaezb vector_bool_char vector_unsigned_char
1692
+
1693
+ vfaezh vector_signed_short vector_signed_short
1694
+ vfaezh vector_unsigned_short vector_unsigned_short
1695
+ vfaezh vector_bool_short vector_unsigned_short
1696
+
1697
+ vfaezf vector_signed_int vector_signed_int
1698
+ vfaezf vector_unsigned_int vector_unsigned_int
1699
+ vfaezf vector_bool_int vector_unsigned_int
1700
+ }
1701
+
1702
+ #[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
1703
+ pub trait VectorFindAnyNeOrZeroIdx < Other > {
1704
+ type Result ;
1705
+ unsafe fn vec_find_any_ne_or_0_idx ( self , other : Other ) -> Self :: Result ;
1706
+ }
1707
+
1708
+ impl_vfae ! { [ idx VectorFindAnyNeOrZeroIdx vec_find_any_ne_or_0_idx] Ne
1709
+ vfaezb vector_signed_char vector_signed_char
1710
+ vfaezb vector_unsigned_char vector_unsigned_char
1711
+ vfaezb vector_bool_char vector_unsigned_char
1712
+
1713
+ vfaezh vector_signed_short vector_signed_short
1714
+ vfaezh vector_unsigned_short vector_unsigned_short
1715
+ vfaezh vector_bool_short vector_unsigned_short
1716
+
1717
+ vfaezf vector_signed_int vector_signed_int
1718
+ vfaezf vector_unsigned_int vector_unsigned_int
1719
+ vfaezf vector_bool_int vector_unsigned_int
1720
+ }
1721
+
1654
1722
#[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
1655
1723
pub trait VectorFindAnyEqIdx < Other > {
1656
1724
type Result ;
1657
1725
unsafe fn vec_find_any_eq_idx ( self , other : Other ) -> Self :: Result ;
1658
1726
}
1659
1727
1660
- impl_vfae ! { [ idx VectorFindAnyEqIdx vec_find_any_eq_idx] 0
1728
+ impl_vfae ! { [ idx VectorFindAnyEqIdx vec_find_any_eq_idx] EqIdx
1661
1729
vfaeb vector_signed_char vector_signed_char
1662
1730
vfaeb vector_unsigned_char vector_unsigned_char
1663
1731
vfaeb vector_bool_char vector_unsigned_char
@@ -1677,7 +1745,7 @@ mod sealed {
1677
1745
unsafe fn vec_find_any_ne_idx ( self , other : Other ) -> Self :: Result ;
1678
1746
}
1679
1747
1680
- impl_vfae ! { [ idx VectorFindAnyNeIdx vec_find_any_ne_idx] 8
1748
+ impl_vfae ! { [ idx VectorFindAnyNeIdx vec_find_any_ne_idx] NeIdx
1681
1749
vfaeb vector_signed_char vector_signed_char
1682
1750
vfaeb vector_unsigned_char vector_unsigned_char
1683
1751
vfaeb vector_bool_char vector_unsigned_char
@@ -1725,7 +1793,7 @@ mod sealed {
1725
1793
unsafe fn vec_find_any_eq_cc ( self , other : Other , c : * mut i32 ) -> Self :: Result ;
1726
1794
}
1727
1795
1728
- impl_vfae ! { [ cc VectorFindAnyEqCC vec_find_any_eq_cc] 4
1796
+ impl_vfae ! { [ cc VectorFindAnyEqCC vec_find_any_eq_cc] Eq
1729
1797
vfaebs vector_signed_char
1730
1798
vfaebs vector_unsigned_char
1731
1799
vfaebs vector_bool_char
@@ -1745,7 +1813,7 @@ mod sealed {
1745
1813
unsafe fn vec_find_any_ne_cc ( self , other : Other , c : * mut i32 ) -> Self :: Result ;
1746
1814
}
1747
1815
1748
- impl_vfae ! { [ cc VectorFindAnyNeCC vec_find_any_ne_cc] 12
1816
+ impl_vfae ! { [ cc VectorFindAnyNeCC vec_find_any_ne_cc] Ne
1749
1817
vfaebs vector_signed_char
1750
1818
vfaebs vector_unsigned_char
1751
1819
vfaebs vector_bool_char
@@ -1758,6 +1826,46 @@ mod sealed {
1758
1826
vfaefs vector_unsigned_int
1759
1827
vfaefs vector_bool_int
1760
1828
}
1829
+
1830
+ #[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
1831
+ pub trait VectorFindAnyEqIdxCC < Other > {
1832
+ type Result ;
1833
+ unsafe fn vec_find_any_eq_idx_cc ( self , other : Other , c : * mut i32 ) -> Self :: Result ;
1834
+ }
1835
+
1836
+ impl_vfae ! { [ idx_cc VectorFindAnyEqIdxCC vec_find_any_eq_idx_cc] EqIdx
1837
+ vfaebs vector_signed_char vector_signed_char
1838
+ vfaebs vector_unsigned_char vector_unsigned_char
1839
+ vfaebs vector_bool_char vector_unsigned_char
1840
+
1841
+ vfaehs vector_signed_short vector_signed_short
1842
+ vfaehs vector_unsigned_short vector_unsigned_short
1843
+ vfaehs vector_bool_short vector_unsigned_short
1844
+
1845
+ vfaefs vector_signed_int vector_signed_int
1846
+ vfaefs vector_unsigned_int vector_unsigned_int
1847
+ vfaefs vector_bool_int vector_unsigned_int
1848
+ }
1849
+
1850
+ #[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
1851
+ pub trait VectorFindAnyNeIdxCC < Other > {
1852
+ type Result ;
1853
+ unsafe fn vec_find_any_ne_idx_cc ( self , other : Other , c : * mut i32 ) -> Self :: Result ;
1854
+ }
1855
+
1856
+ impl_vfae ! { [ idx_cc VectorFindAnyNeIdxCC vec_find_any_ne_idx_cc] NeIdx
1857
+ vfaebs vector_signed_char vector_signed_char
1858
+ vfaebs vector_unsigned_char vector_unsigned_char
1859
+ vfaebs vector_bool_char vector_unsigned_char
1860
+
1861
+ vfaehs vector_signed_short vector_signed_short
1862
+ vfaehs vector_unsigned_short vector_unsigned_short
1863
+ vfaehs vector_bool_short vector_unsigned_short
1864
+
1865
+ vfaefs vector_signed_int vector_signed_int
1866
+ vfaefs vector_unsigned_int vector_unsigned_int
1867
+ vfaefs vector_bool_int vector_unsigned_int
1868
+ }
1761
1869
}
1762
1870
1763
1871
/// Vector element-wise addition.
0 commit comments