Skip to content

Commit 34f8fbd

Browse files
committed
[Clang][AArch64] svadda is not available in streaming mode
And Clang should give a diagnostic when it is used in a streaming context.
1 parent aa15421 commit 34f8fbd

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

clang/include/clang/Basic/arm_sve.td

+3-1
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,9 @@ def SVRSQRTS : SInst<"svrsqrts[_{d}]", "ddd", "hfd", MergeNone, "aarch64_sve_frs
880880
////////////////////////////////////////////////////////////////////////////////
881881
// Floating-point reductions
882882

883-
def SVFADDA : SInst<"svadda[_{d}]", "sPsd", "hfd", MergeNone, "aarch64_sve_fadda", [VerifyRuntimeMode]>;
883+
let SVETargetGuard = "sve", SMETargetGuard = InvalidMode in {
884+
def SVFADDA : SInst<"svadda[_{d}]", "sPsd", "hfd", MergeNone, "aarch64_sve_fadda">;
885+
}
884886
def SVFADDV : SInst<"svaddv[_{d}]", "sPd", "hfd", MergeNone, "aarch64_sve_faddv", [VerifyRuntimeMode]>;
885887
def SVFMAXV : SInst<"svmaxv[_{d}]", "sPd", "hfd", MergeNone, "aarch64_sve_fmaxv", [VerifyRuntimeMode]>;
886888
def SVFMAXNMV : SInst<"svmaxnmv[_{d}]", "sPd", "hfd", MergeNone, "aarch64_sve_fmaxnmv", [VerifyRuntimeMode]>;

clang/test/Sema/aarch64-incompat-sm-builtin-calls.c

+10
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@ void incompat_sme_smc(svbool_t pg, void const *ptr) __arm_streaming_compatible _
2828
return __builtin_sme_svld1_hor_za128(0, 0, pg, ptr);
2929
}
3030

31+
float incomp_sve_sm_fadda_sm(void) __arm_streaming {
32+
// expected-error@+1 {{builtin can only be called from a non-streaming function}}
33+
return svadda(svptrue_b32(), 0, svdup_f32(1));
34+
}
35+
36+
float incomp_sve_sm_fadda_smc(void) __arm_streaming_compatible {
37+
// expected-error@+1 {{builtin can only be called from a non-streaming function}}
38+
return svadda(svptrue_b32(), 0, svdup_f32(1));
39+
}
40+
3141
svuint32_t incompat_sve_sm(svbool_t pg, svuint32_t a, int16_t b) __arm_streaming {
3242
// expected-error@+1 {{builtin can only be called from a non-streaming function}}
3343
return __builtin_sve_svld1_gather_u32base_index_u32(pg, a, b);

0 commit comments

Comments
 (0)