Skip to content

Commit

Permalink
[Clang][AArch64] svadda is not available in streaming mode
Browse files Browse the repository at this point in the history
And Clang should give a diagnostic when it is used in a streaming
context.
  • Loading branch information
sdesmalen-arm committed Nov 11, 2024
1 parent aa15421 commit 34f8fbd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
4 changes: 3 additions & 1 deletion clang/include/clang/Basic/arm_sve.td
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,9 @@ def SVRSQRTS : SInst<"svrsqrts[_{d}]", "ddd", "hfd", MergeNone, "aarch64_sve_frs
////////////////////////////////////////////////////////////////////////////////
// Floating-point reductions

def SVFADDA : SInst<"svadda[_{d}]", "sPsd", "hfd", MergeNone, "aarch64_sve_fadda", [VerifyRuntimeMode]>;
let SVETargetGuard = "sve", SMETargetGuard = InvalidMode in {
def SVFADDA : SInst<"svadda[_{d}]", "sPsd", "hfd", MergeNone, "aarch64_sve_fadda">;
}
def SVFADDV : SInst<"svaddv[_{d}]", "sPd", "hfd", MergeNone, "aarch64_sve_faddv", [VerifyRuntimeMode]>;
def SVFMAXV : SInst<"svmaxv[_{d}]", "sPd", "hfd", MergeNone, "aarch64_sve_fmaxv", [VerifyRuntimeMode]>;
def SVFMAXNMV : SInst<"svmaxnmv[_{d}]", "sPd", "hfd", MergeNone, "aarch64_sve_fmaxnmv", [VerifyRuntimeMode]>;
Expand Down
10 changes: 10 additions & 0 deletions clang/test/Sema/aarch64-incompat-sm-builtin-calls.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ void incompat_sme_smc(svbool_t pg, void const *ptr) __arm_streaming_compatible _
return __builtin_sme_svld1_hor_za128(0, 0, pg, ptr);
}

float incomp_sve_sm_fadda_sm(void) __arm_streaming {
// expected-error@+1 {{builtin can only be called from a non-streaming function}}
return svadda(svptrue_b32(), 0, svdup_f32(1));
}

float incomp_sve_sm_fadda_smc(void) __arm_streaming_compatible {
// expected-error@+1 {{builtin can only be called from a non-streaming function}}
return svadda(svptrue_b32(), 0, svdup_f32(1));
}

svuint32_t incompat_sve_sm(svbool_t pg, svuint32_t a, int16_t b) __arm_streaming {
// expected-error@+1 {{builtin can only be called from a non-streaming function}}
return __builtin_sve_svld1_gather_u32base_index_u32(pg, a, b);
Expand Down

0 comments on commit 34f8fbd

Please sign in to comment.