Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions clang/include/clang/Basic/arm_sve.td
Original file line number Diff line number Diff line change
Expand Up @@ -980,8 +980,8 @@ defm SVCLASTA_N : SVEPerm<"svclasta[_n_{d}]", "sPsd", "aarch64_sve_clasta_n">;
defm SVCLASTB : SVEPerm<"svclastb[_{d}]", "dPdd", "aarch64_sve_clastb">;
defm SVCLASTB_N : SVEPerm<"svclastb[_n_{d}]", "sPsd", "aarch64_sve_clastb_n">;

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

// Note: svdup_lane is implemented using the intrinsic for TBL to represent a
Expand Down
18 changes: 18 additions & 0 deletions clang/test/Sema/aarch64-sve-intrinsics/acle_sve_compact.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve \
// RUN: -verify -verify-ignore-unexpected=error,note -emit-llvm -o - %s
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sme \
// RUN: -verify -verify-ignore-unexpected=error,note -emit-llvm -o - %s
// REQUIRES: aarch64-registered-target
// expected-no-diagnostics

#include <arm_sve.h>

__attribute__((target("sme2p2")))
void test_svcompact(svbool_t pg, svfloat32_t op) __arm_streaming{
svcompact(pg, op);
}

void test_svcompact_nofeature(svbool_t pg, svfloat32_t op) __arm_streaming{
// expected-error@+1 {{'svcompact' needs target feature (sve)|(sme, sme2p2)}}
svcompact(pg, op);
}