This is an archive of the discontinued LLVM Phabricator instance.

[X86] Add helper enum for ternary intrinsics
ClosedPublic

Authored by pengfei on Feb 22 2022, 12:52 AM.

Diff Detail

Event Timeline

pengfei requested review of this revision.Feb 22 2022, 12:52 AM
pengfei created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 22 2022, 12:52 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

Are similar macros used by any other compilers at all?

clang/lib/Headers/avx512fintrin.h
5932

Add a doxygen comment for these?

clang/test/CodeGen/X86/avx512f-builtins.c
6010

check the immediate value?

pengfei updated this revision to Diff 410520.Feb 22 2022, 6:37 AM
pengfei marked 2 inline comments as done.

Are similar macros used by any other compilers at all?

Not so far. GCC folks agreed to add them. I'll add them to intrinsic guide as well.

pengfei retitled this revision from [X86] Add helper macros for ternary intrinsics to [X86] Add helper enum for ternary intrinsics.Feb 22 2022, 6:38 AM
craig.topper added inline comments.Feb 22 2022, 10:59 AM
clang/lib/Headers/avx512fintrin.h
5944

Why do we need to change the type on imm here? The builtin takes an int, and the enum you created defaults to int. Is this so we truncate ~ to 8-bits?

pengfei added inline comments.Feb 22 2022, 6:42 PM
clang/lib/Headers/avx512fintrin.h
5944

Yes. By the way, ICC and MSVC don't error out for it. https://godbolt.org/z/s1bG1sq9q

Herald added a project: Restricted Project. · View Herald TranscriptMar 6 2022, 9:27 PM
LuoYuanke accepted this revision.Mar 6 2022, 11:32 PM

LGTM, but pls wait for 1 or 2 days to see if there are any comments from others.

This revision is now accepted and ready to land.Mar 6 2022, 11:32 PM
RKSimon accepted this revision.Mar 7 2022, 1:29 AM

LGTM

This revision was landed with ongoing or failed builds.Mar 7 2022, 8:18 PM
This revision was automatically updated to reflect the committed changes.