This is an archive of the discontinued LLVM Phabricator instance.

[sve][acle] Enable feature macros for SVE ACLE extensions.
ClosedPublic

Authored by fpetrogalli on Jun 25 2020, 8:19 PM.

Details

Summary

The following feature macros have been added:

__ARM_FEATURE_SVE_BF16

__ARM_FEATURE_SVE_MATMUL_INT8

__ARM_FEATURE_SVE_MATMUL_FP32

__ARM_FEATURE_SVE_MATMUL_FP64

The driver has been updated to enable them accordingly to the value of
the target feature passed at command line.

The SVE ACLE tests using the macros have been modified to work with
the target feature instead of passing the macro at command line.

Diff Detail

Event Timeline

fpetrogalli created this revision.Jun 25 2020, 8:19 PM
Herald added a project: Restricted Project. · View Herald Transcript

Reviewers, I have added 2 parent revision with the last two set of intrinsics that are enabled by the macro introduced in this patch. I will update those tests in this patch once the patches are in. Meanwhile, please double check that my interpretation of the feature macros and relative target feature flags is correct.

Grazie,

Francesco

Hi @fpetrogalli , I see the patch is still missing a few tests to clang/test/Preprocessor/aarch64-target-features.c.

Not specifically to be done in this patch, but we'll also needs changes to make sure that the bfloat macros are set for armv8.6 (e.g. -march=armv8.6-a+sve*).
See DecodeAArch64Features in clang/lib/Driver/ToolChains/Arch/AArch64.

clang/lib/Basic/Targets/AArch64.cpp
316

Should __ARM_FEATURE_BF16_SCALAR_ARITHMETIC not be defined under HasBFloat16?

clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_whilewr-bfloat.c
14 ↗(On Diff #273583)

unrelated change?

fpetrogalli marked 2 inline comments as done.

Update patch with all remaining C tests modifications.

sdesmalen accepted this revision.Jun 30 2020, 10:41 AM

LGTM with comment addressed.

clang/lib/Basic/Targets/AArch64.cpp
325

It seems HasMatmulInt8 is the same as HasMatMul, please reuse that instead.

This revision is now accepted and ready to land.Jun 30 2020, 10:41 AM

Thank you @sdesmalen, I have updated the patch for submitting it into master.

Francesco

This revision was automatically updated to reflect the committed changes.