This is an archive of the discontinued LLVM Phabricator instance.

[Clang][X86] Mark some VAES builtins as conditionally defined
AbandonedPublic

Authored by LemonBoy on Mar 28 2021, 3:28 AM.

Details

Reviewers
craig.topper
Summary

AMD Zen3 architecture supports the VAES instruction set but not the 512bit variants, add a feature gate on AVX512F to avoid raising a compile error (due to __m512i being undefined) whenever a user imports the intrinsic module.

Diff Detail

Event Timeline

LemonBoy requested review of this revision.Mar 28 2021, 3:28 AM
LemonBoy created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptMar 28 2021, 3:28 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
craig.topper added a comment.EditedMar 28 2021, 11:02 AM

We can't use preprocessor defines in the intrinsic header files. It prevents being able to use the intrinsics with attribute(target("avx512f,vaes")). What's preventing __m512i from being defined?

Are you compiling in MSVC compatibility mode?

We can't use preprocessor defines in the intrinsic header files. It prevents being able to use the intrinsics with attribute(target("avx512f,vaes")). What's preventing __m512i from being defined?

__VAES__ is defined but __AVX512F__ is not hence avx512fintrin.h is never included in immintrin.h.

I think I've fixed this in 3fb40ce167ff5f05afadf8f525ff9e17350d6d7f. We need to use the preprocessor define that says avx512fintrin.h was included rather than the feature define. We already did a similar thing in gfniintrin.h.

LemonBoy abandoned this revision.Mar 28 2021, 11:37 AM