This is an archive of the discontinued LLVM Phabricator instance.

[X86] Promote VAES, SHA512, SM4 implied feature to AVX2
ClosedPublic

Authored by FreddyYe on Jul 18 2023, 5:20 PM.

Diff Detail

Event Timeline

FreddyYe created this revision.Jul 18 2023, 5:20 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 18 2023, 5:20 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
FreddyYe requested review of this revision.Jul 18 2023, 5:20 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 18 2023, 5:20 PM

As we noticed in SHA512's spec, it mentions AVX in "CPUID Feature Flag" only, but from software view, we can promote it to AVX2 as all machines having SHA512 have AVX2. Just like VAES here.

skan added inline comments.Jul 18 2023, 7:33 PM
llvm/lib/TargetParser/X86TargetParser.cpp
624

If so ,shouldn't we update X86.td too?

FreddyYe updated this revision to Diff 541816.Jul 18 2023, 7:39 PM
FreddyYe marked an inline comment as done.

Address comment.

llvm/lib/TargetParser/X86TargetParser.cpp
624

Oh yes! Forgot!

skan added a comment.Jul 19 2023, 1:21 AM

As we noticed in SHA512's spec, it mentions AVX in "CPUID Feature Flag" only, but from software view, we can promote it to AVX2 as all machines having SHA512 have AVX2. Just like VAES here.

Is it a good justification? Any pros from software view?

As we noticed in SHA512's spec, it mentions AVX in "CPUID Feature Flag" only, but from software view, we can promote it to AVX2 as all machines having SHA512 have AVX2. Just like VAES here.

Is it a good justification? Any pros from software view?

Like we did before for AVXNECONVERT, AVXIFMA, AVXVNNI. These ISA supports %ymm and operates on integers. And AVX2 is the first ISA is capable of that.

skan accepted this revision.Jul 19 2023, 1:40 AM

LGTM

This revision is now accepted and ready to land.Jul 19 2023, 1:40 AM
FreddyYe updated this revision to Diff 544651.Jul 27 2023, 1:37 AM

rebase and promote SHA512, SM4 as well.

FreddyYe requested review of this revision.Jul 27 2023, 1:44 AM
FreddyYe retitled this revision from [X86] Promote VAES implied feature to AVX2 to [X86] Promote VAES, SHA512, SM4 implied feature to AVX2.
skan accepted this revision.Jul 27 2023, 2:24 AM
This revision is now accepted and ready to land.Jul 27 2023, 2:24 AM
This revision was landed with ongoing or failed builds.Aug 3 2023, 7:43 PM
This revision was automatically updated to reflect the committed changes.