This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][SVE] Guard svbfloat16_t with feature macro in ACLE
ClosedPublic

Authored by c-rhodes on Jun 19 2020, 5:23 AM.

Details

Summary

svbfloat16_t should only be defined if the __ARM_FEATURE_SVE_BF16
feature macro is enabled, similar to the scalar bfloat16_t type. Patch
also contains a fix for ld1ro intrinsic which should be guarded on
__ARM_FEATURE_SVE_BF16 rather than __ARM_FEATURE_BF16_SCALAR_ARITHMETIC.

Diff Detail

Event Timeline

c-rhodes created this revision.Jun 19 2020, 5:23 AM
Herald added a project: Restricted Project. · View Herald Transcript
sdesmalen added inline comments.Jun 19 2020, 5:48 AM
clang/utils/TableGen/SveEmitter.cpp
1094

Can you also add an error if __ARM_FEATURE_SVE_BF16 is defined, but __ARM_FEATURE_BF16_SCALAR_ARITHMETIC isn't?
something like:

#ifndef __ARM_FEATURE_BF16_SCALAR_ARITHMETIC
#error "__ARM_FEATURE_BF16_SCALAR_ARITHMETIC must be defined when __ARM_FEATURE_SVE_BF16 is defined"
#endif
c-rhodes updated this revision to Diff 272043.Jun 19 2020, 6:32 AM

Changes:

  • Error if __ARM_FEATURE_BF16_SCALAR_ARITHMETIC not defined when defining __ARM_FEATURE_SVE_BF16.
c-rhodes marked an inline comment as done.Jun 19 2020, 6:33 AM
fpetrogalli added inline comments.Jun 19 2020, 7:25 AM
clang/utils/TableGen/SveEmitter.cpp
1095

Does it make sense to add a regression test to make sure this error is raised?

c-rhodes updated this revision to Diff 272091.Jun 19 2020, 8:38 AM

Changes:

  • Include arm_bf16.h if __ARM_FEATURE_BF16_SCALAR_ARITHMETIC is defined.
fpetrogalli accepted this revision.Jun 22 2020, 9:01 AM

LGTM! Thanks.

clang/utils/TableGen/SveEmitter.cpp
1095

As discussed, this is not needed. The ACLE tests will catch this once we have set up the correct macros in the clang driver.

1104

nit: maybe add a comment specifying that this include is required in the ACLE specs.

This revision is now accepted and ready to land.Jun 22 2020, 9:01 AM

LGTM! Thanks.

Thanks for reviewing!

This revision was automatically updated to reflect the committed changes.