@@ -1418,7 +1418,7 @@ AArch64TargetLowering::AArch64TargetLowering(const TargetMachine &TM,
1418
1418
}
1419
1419
}
1420
1420
1421
- if (Subtarget->hasSVEorSME ()) {
1421
+ if (Subtarget->isSVEorStreamingSVEAvailable ()) {
1422
1422
for (auto VT : {MVT::nxv16i8, MVT::nxv8i16, MVT::nxv4i32, MVT::nxv2i64}) {
1423
1423
setOperationAction(ISD::BITREVERSE, VT, Custom);
1424
1424
setOperationAction(ISD::BSWAP, VT, Custom);
@@ -1430,8 +1430,6 @@ AArch64TargetLowering::AArch64TargetLowering(const TargetMachine &TM,
1430
1430
setOperationAction(ISD::SINT_TO_FP, VT, Custom);
1431
1431
setOperationAction(ISD::FP_TO_UINT, VT, Custom);
1432
1432
setOperationAction(ISD::FP_TO_SINT, VT, Custom);
1433
- setOperationAction(ISD::MGATHER, VT, Custom);
1434
- setOperationAction(ISD::MSCATTER, VT, Custom);
1435
1433
setOperationAction(ISD::MLOAD, VT, Custom);
1436
1434
setOperationAction(ISD::MUL, VT, Custom);
1437
1435
setOperationAction(ISD::MULHS, VT, Custom);
@@ -1528,14 +1526,13 @@ AArch64TargetLowering::AArch64TargetLowering(const TargetMachine &TM,
1528
1526
}
1529
1527
}
1530
1528
1531
- // NEON doesn't support masked loads/stores/gathers/scatters, but SVE does
1532
- for (auto VT : {MVT::v4f16, MVT::v8f16, MVT::v2f32, MVT::v4f32, MVT::v1f64,
1533
- MVT::v2f64, MVT::v8i8, MVT::v16i8, MVT::v4i16, MVT::v8i16,
1534
- MVT::v2i32, MVT::v4i32, MVT::v1i64, MVT::v2i64}) {
1529
+ // NEON doesn't support masked loads/stores, but SME and SVE do.
1530
+ for (auto VT :
1531
+ {MVT::v4f16, MVT::v8f16, MVT::v2f32, MVT::v4f32, MVT::v1f64,
1532
+ MVT::v2f64, MVT::v8i8, MVT::v16i8, MVT::v4i16, MVT::v8i16,
1533
+ MVT::v2i32, MVT::v4i32, MVT::v1i64, MVT::v2i64}) {
1535
1534
setOperationAction(ISD::MLOAD, VT, Custom);
1536
1535
setOperationAction(ISD::MSTORE, VT, Custom);
1537
- setOperationAction(ISD::MGATHER, VT, Custom);
1538
- setOperationAction(ISD::MSCATTER, VT, Custom);
1539
1536
}
1540
1537
1541
1538
// Firstly, exclude all scalable vector extending loads/truncating stores,
@@ -1576,8 +1573,6 @@ AArch64TargetLowering::AArch64TargetLowering(const TargetMachine &TM,
1576
1573
MVT::nxv4f32, MVT::nxv2f64}) {
1577
1574
setOperationAction(ISD::CONCAT_VECTORS, VT, Custom);
1578
1575
setOperationAction(ISD::INSERT_SUBVECTOR, VT, Custom);
1579
- setOperationAction(ISD::MGATHER, VT, Custom);
1580
- setOperationAction(ISD::MSCATTER, VT, Custom);
1581
1576
setOperationAction(ISD::MLOAD, VT, Custom);
1582
1577
setOperationAction(ISD::SPLAT_VECTOR, VT, Legal);
1583
1578
setOperationAction(ISD::SELECT, VT, Custom);
@@ -1611,8 +1606,6 @@ AArch64TargetLowering::AArch64TargetLowering(const TargetMachine &TM,
1611
1606
setOperationAction(ISD::VECREDUCE_FMIN, VT, Custom);
1612
1607
setOperationAction(ISD::VECREDUCE_FMAXIMUM, VT, Custom);
1613
1608
setOperationAction(ISD::VECREDUCE_FMINIMUM, VT, Custom);
1614
- if (Subtarget->isSVEAvailable())
1615
- setOperationAction(ISD::VECREDUCE_SEQ_FADD, VT, Custom);
1616
1609
setOperationAction(ISD::VECTOR_SPLICE, VT, Custom);
1617
1610
setOperationAction(ISD::VECTOR_DEINTERLEAVE, VT, Custom);
1618
1611
setOperationAction(ISD::VECTOR_INTERLEAVE, VT, Custom);
@@ -1650,8 +1643,6 @@ AArch64TargetLowering::AArch64TargetLowering(const TargetMachine &TM,
1650
1643
1651
1644
for (auto VT : {MVT::nxv2bf16, MVT::nxv4bf16, MVT::nxv8bf16}) {
1652
1645
setOperationAction(ISD::CONCAT_VECTORS, VT, Custom);
1653
- setOperationAction(ISD::MGATHER, VT, Custom);
1654
- setOperationAction(ISD::MSCATTER, VT, Custom);
1655
1646
setOperationAction(ISD::MLOAD, VT, Custom);
1656
1647
setOperationAction(ISD::INSERT_SUBVECTOR, VT, Custom);
1657
1648
setOperationAction(ISD::SPLAT_VECTOR, VT, Legal);
@@ -1675,18 +1666,6 @@ AArch64TargetLowering::AArch64TargetLowering(const TargetMachine &TM,
1675
1666
setOperationAction(ISD::MUL, MVT::v1i64, Custom);
1676
1667
setOperationAction(ISD::MUL, MVT::v2i64, Custom);
1677
1668
1678
- if (Subtarget->isSVEAvailable()) {
1679
- // NEON doesn't support across-vector reductions, but SVE does.
1680
- for (auto VT :
1681
- {MVT::v4f16, MVT::v8f16, MVT::v2f32, MVT::v4f32, MVT::v2f64})
1682
- setOperationAction(ISD::VECREDUCE_SEQ_FADD, VT, Custom);
1683
- }
1684
-
1685
- // Histcnt is SVE2 only
1686
- if (Subtarget->hasSVE2() && Subtarget->isSVEAvailable())
1687
- setOperationAction(ISD::EXPERIMENTAL_VECTOR_HISTOGRAM, MVT::Other,
1688
- Custom);
1689
-
1690
1669
// NOTE: Currently this has to happen after computeRegisterProperties rather
1691
1670
// than the preferred option of combining it with the addRegisterClass call.
1692
1671
if (Subtarget->useSVEForFixedLengthVectors()) {
@@ -1762,6 +1741,31 @@ AArch64TargetLowering::AArch64TargetLowering(const TargetMachine &TM,
1762
1741
setOperationAction(ISD::INTRINSIC_WO_CHAIN, VT, Custom);
1763
1742
}
1764
1743
1744
+ // Handle operations that are only available in non-streaming SVE mode.
1745
+ if (Subtarget->isSVEAvailable()) {
1746
+ for (auto VT : {MVT::nxv16i8, MVT::nxv8i16, MVT::nxv4i32, MVT::nxv2i64,
1747
+ MVT::nxv2f16, MVT::nxv4f16, MVT::nxv8f16, MVT::nxv2f32,
1748
+ MVT::nxv4f32, MVT::nxv2f64, MVT::nxv2bf16, MVT::nxv4bf16,
1749
+ MVT::nxv8bf16, MVT::v4f16, MVT::v8f16, MVT::v2f32,
1750
+ MVT::v4f32, MVT::v1f64, MVT::v2f64, MVT::v8i8,
1751
+ MVT::v16i8, MVT::v4i16, MVT::v8i16, MVT::v2i32,
1752
+ MVT::v4i32, MVT::v1i64, MVT::v2i64}) {
1753
+ setOperationAction(ISD::MGATHER, VT, Custom);
1754
+ setOperationAction(ISD::MSCATTER, VT, Custom);
1755
+ }
1756
+
1757
+ for (auto VT : {MVT::nxv2f16, MVT::nxv4f16, MVT::nxv8f16, MVT::nxv2f32,
1758
+ MVT::nxv4f32, MVT::nxv2f64, MVT::v4f16, MVT::v8f16,
1759
+ MVT::v2f32, MVT::v4f32, MVT::v2f64})
1760
+ setOperationAction(ISD::VECREDUCE_SEQ_FADD, VT, Custom);
1761
+
1762
+ // Histcnt is SVE2 only
1763
+ if (Subtarget->hasSVE2())
1764
+ setOperationAction(ISD::EXPERIMENTAL_VECTOR_HISTOGRAM, MVT::Other,
1765
+ Custom);
1766
+ }
1767
+
1768
+
1765
1769
if (Subtarget->hasMOPS() && Subtarget->hasMTE()) {
1766
1770
// Only required for llvm.aarch64.mops.memset.tag
1767
1771
setOperationAction(ISD::INTRINSIC_W_CHAIN, MVT::i8, Custom);
@@ -6986,7 +6990,7 @@ bool AArch64TargetLowering::useSVEForFixedLengthVectorVT(
6986
6990
6987
6991
// NEON-sized vectors can be emulated using SVE instructions.
6988
6992
if (OverrideNEON && (VT.is128BitVector() || VT.is64BitVector()))
6989
- return Subtarget->hasSVEorSME ();
6993
+ return Subtarget->isSVEorStreamingSVEAvailable ();
6990
6994
6991
6995
// Ensure NEON MVTs only belong to a single register class.
6992
6996
if (VT.getFixedSizeInBits() <= 128)
0 commit comments