Skip to content

Commit e01d9a3

Browse files
committed
[AArch64] Updated predication of SVE Compact intrinsic to be available in streaming mode. Included Sema test acle_sve_compact.cpp.
- Updated Sema test - Removed run line from sve-intrinsics-perm-select.ll - Removed rogue newline - Removed changes to ll tests
1 parent d10dc67 commit e01d9a3

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

clang/include/clang/Basic/arm_sve.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -980,8 +980,8 @@ defm SVCLASTA_N : SVEPerm<"svclasta[_n_{d}]", "sPsd", "aarch64_sve_clasta_n">;
980980
defm SVCLASTB : SVEPerm<"svclastb[_{d}]", "dPdd", "aarch64_sve_clastb">;
981981
defm SVCLASTB_N : SVEPerm<"svclastb[_n_{d}]", "sPsd", "aarch64_sve_clastb_n">;
982982

983-
let SVETargetGuard = "sve", SMETargetGuard = InvalidMode in {
984-
def SVCOMPACT : SInst<"svcompact[_{d}]", "dPd", "ilUiUlfd", MergeNone, "aarch64_sve_compact">;
983+
let SVETargetGuard = "sve", SMETargetGuard = "sme2p2" in {
984+
def SVCOMPACT : SInst<"svcompact[_{d}]", "dPd", "ilUiUlfd", MergeNone, "aarch64_sve_compact", [VerifyRuntimeMode]>;
985985
}
986986

987987
// Note: svdup_lane is implemented using the intrinsic for TBL to represent a
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve \
2+
// RUN: -verify -verify-ignore-unexpected=error,note -emit-llvm -o - %s
3+
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sme \
4+
// RUN: -verify -verify-ignore-unexpected=error,note -emit-llvm -o - %s
5+
// REQUIRES: aarch64-registered-target
6+
// expected-no-diagnostics
7+
8+
#include <arm_sve.h>
9+
10+
__attribute__((target("sme2p2")))
11+
void test_svcompact(svbool_t pg, svfloat32_t op) __arm_streaming{
12+
svcompact(pg, op);
13+
}
14+
15+
void test_svcompact_nofeature(svbool_t pg, svfloat32_t op) __arm_streaming{
16+
// expected-error@+1 {{'svcompact' needs target feature (sve)|(sme, sme2p2)}}
17+
svcompact(pg, op);
18+
}

0 commit comments

Comments
 (0)