Skip to content

Commit 768f316

Browse files
committed
Update SVPTRUE_COUNT to use IsStreamingCompatible, delete new file added
1 parent 78f60b7 commit 768f316

File tree

5 files changed

+33
-55
lines changed

5 files changed

+33
-55
lines changed

clang/include/clang/Basic/arm_sve.td

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2044,11 +2044,28 @@ defm SVREVD : SInstZPZ<"svrevd", "csilUcUsUiUl", "aarch64_sve_revd">;
20442044
}
20452045

20462046
let TargetGuard = "sve2p1|sme2" in {
2047-
def SVPTRUE_COUNT : SInst<"svptrue_{d}", "}v", "QcQsQiQl", MergeNone, "aarch64_sve_ptrue_{d}", [IsOverloadNone, IsStreaming], []>;
2047+
//FIXME: Replace IsStreamingCompatible with IsStreamingOrHasSVE2p1 when available
2048+
def SVPTRUE_COUNT : SInst<"svptrue_{d}", "}v", "QcQsQiQl", MergeNone, "aarch64_sve_ptrue_{d}", [IsOverloadNone, IsStreamingCompatible], []>;
2049+
20482050
def SVPFALSE_COUNT_ALIAS : SInst<"svpfalse_c", "}v", "", MergeNone, "", [IsOverloadNone, IsStreamingCompatible]>;
20492051
}
20502052

2051-
////////////////////////////////////////////////////////////////////////////////
2053+
let TargetGuard = "sve2p1,b16b16" in {
2054+
defm SVMUL_BF : SInstZPZZ<"svmul", "b", "aarch64_sve_fmul", "aarch64_sve_fmul_u">;
2055+
defm SVADD_BF : SInstZPZZ<"svadd", "b", "aarch64_sve_fadd", "aarch64_sve_fadd_u">;
2056+
defm SVSUB_BF : SInstZPZZ<"svsub", "b", "aarch64_sve_fsub", "aarch64_sve_fsub_u">;
2057+
defm SVMAXNM_BF : SInstZPZZ<"svmaxnm","b", "aarch64_sve_fmaxnm", "aarch64_sve_fmaxnm_u">;
2058+
defm SVMINNM_BF : SInstZPZZ<"svminnm","b", "aarch64_sve_fminnm", "aarch64_sve_fminnm_u">;
2059+
defm SVMAX_BF : SInstZPZZ<"svmax", "b", "aarch64_sve_fmax", "aarch64_sve_fmax_u">;
2060+
defm SVMIN_BF : SInstZPZZ<"svmin", "b", "aarch64_sve_fmin", "aarch64_sve_fmin_u">;
2061+
defm SVMLA_BF : SInstZPZZZ<"svmla", "b", "aarch64_sve_fmla", "aarch64_sve_fmla_u", []>;
2062+
defm SVMLS_BF : SInstZPZZZ<"svmls", "b", "aarch64_sve_fmls", "aarch64_sve_fmls_u", []>;
2063+
def SVMLA_LANE_BF : SInst<"svmla_lane[_{d}]", "ddddi", "b", MergeNone, "aarch64_sve_fmla_lane", [], [ImmCheck<3, ImmCheckLaneIndex, 2>]>;
2064+
def SVMLS_LANE_BF : SInst<"svmls_lane[_{d}]", "ddddi", "b", MergeNone, "aarch64_sve_fmls_lane", [], [ImmCheck<3, ImmCheckLaneIndex, 2>]>;
2065+
def SVMUL_LANE_BF : SInst<"svmul_lane[_{d}]", "dddi", "b", MergeNone, "aarch64_sve_fmul_lane", [], [ImmCheck<2, ImmCheckLaneIndex, 1>]>;
2066+
def SVFCLAMP_BF : SInst<"svclamp[_{d}]", "dddd", "b", MergeNone, "aarch64_sve_fclamp", [], []>;
2067+
} //sve2p1,b16b16
2068+
20522069
// SME2
20532070

20542071
// SME intrinsics which operate only on vectors and do not require ZA should be added here,

clang/lib/Sema/Sema.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2084,9 +2084,8 @@ void Sema::checkTypeSupport(QualType Ty, SourceLocation Loc, ValueDecl *D) {
20842084
if (Ty->isSVESizelessBuiltinType() && FD && FD->hasBody()) {
20852085
llvm::StringMap<bool> CallerFeatureMap;
20862086
Context.getFunctionFeatureMap(CallerFeatureMap, FD);
2087-
if (!Builtin::evaluateRequiredTargetFeatures(
2088-
"sve", CallerFeatureMap) && !Builtin::evaluateRequiredTargetFeatures(
2089-
"sme", CallerFeatureMap))
2087+
if (!Builtin::evaluateRequiredTargetFeatures("sve", CallerFeatureMap) &&
2088+
!Builtin::evaluateRequiredTargetFeatures("sme", CallerFeatureMap))
20902089
Diag(D->getLocation(), diag::err_sve_vector_in_non_sve_target) << Ty;
20912090
}
20922091
};

clang/test/CodeGen/aarch64-sme2-intrinsics/acle_sme2_ptrue_pfalse_attr.c

Lines changed: 0 additions & 35 deletions
This file was deleted.
Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
11
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
22
// REQUIRES: aarch64-registered-target
33
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s
4+
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sme2 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s
45
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK
5-
// RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2p1 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s
6-
// RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2p1 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK
6+
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sme2 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK
77
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -S -disable-O0-optnone -Werror -Wall -o /dev/null %s
8-
#include <arm_sve.h>
8+
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sme2 -S -disable-O0-optnone -Werror -Wall -o /dev/null %s
99

10-
#ifdef SVE_OVERLOADED_FORMS
11-
// A simple used,unused... macro, long enough to represent any SVE builtin.
12-
#define SVE_ACLE_FUNC(A1,A2_UNUSED,A3,A4_UNUSED) A1##A3
13-
#else
14-
#define SVE_ACLE_FUNC(A1,A2,A3,A4) A1##A2##A3##A4
15-
#endif
10+
#include <arm_sve.h>
1611

1712
// CHECK-LABEL: @test_svpfalse_c(
1813
// CHECK-NEXT: entry:
@@ -24,7 +19,7 @@
2419
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call target("aarch64.svcount") @llvm.aarch64.sve.convert.from.svbool.taarch64.svcountt(<vscale x 16 x i1> zeroinitializer)
2520
// CPP-CHECK-NEXT: ret target("aarch64.svcount") [[TMP0]]
2621
//
27-
svcount_t test_svpfalse_c()
22+
svcount_t test_svpfalse_c(void) __arm_streaming_compatible
2823
{
29-
return SVE_ACLE_FUNC(svpfalse_c,,,)();
24+
return svpfalse_c();
3025
}

clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_ptrue.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
22
// REQUIRES: aarch64-registered-target
33
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -S -O1 -Werror -emit-llvm -o - %s | FileCheck %s
4+
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sme2 -S -O1 -Werror -emit-llvm -o - %s | FileCheck %s
45
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -S -O1 -Werror -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK
6+
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sme2 -S -O1 -Werror -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK
57

68
#include <arm_sve.h>
79

@@ -15,7 +17,7 @@
1517
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call target("aarch64.svcount") @llvm.aarch64.sve.ptrue.c8()
1618
// CPP-CHECK-NEXT: ret target("aarch64.svcount") [[TMP0]]
1719
//
18-
svcount_t test_svptrue_c8(void) {
20+
svcount_t test_svptrue_c8(void) __arm_streaming_compatible {
1921
return svptrue_c8();
2022
}
2123

@@ -29,7 +31,7 @@ svcount_t test_svptrue_c8(void) {
2931
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call target("aarch64.svcount") @llvm.aarch64.sve.ptrue.c16()
3032
// CPP-CHECK-NEXT: ret target("aarch64.svcount") [[TMP0]]
3133
//
32-
svcount_t test_svptrue_c16(void) {
34+
svcount_t test_svptrue_c16(void) __arm_streaming_compatible {
3335
return svptrue_c16();
3436
}
3537

@@ -43,7 +45,7 @@ svcount_t test_svptrue_c16(void) {
4345
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call target("aarch64.svcount") @llvm.aarch64.sve.ptrue.c32()
4446
// CPP-CHECK-NEXT: ret target("aarch64.svcount") [[TMP0]]
4547
//
46-
svcount_t test_svptrue_c32(void) {
48+
svcount_t test_svptrue_c32(void) __arm_streaming_compatible {
4749
return svptrue_c32();
4850
}
4951

@@ -57,6 +59,6 @@ svcount_t test_svptrue_c32(void) {
5759
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call target("aarch64.svcount") @llvm.aarch64.sve.ptrue.c64()
5860
// CPP-CHECK-NEXT: ret target("aarch64.svcount") [[TMP0]]
5961
//
60-
svcount_t test_svptrue_c64(void) {
62+
svcount_t test_svptrue_c64(void) __arm_streaming_compatible {
6163
return svptrue_c64();
6264
}

0 commit comments

Comments
 (0)