This is an archive of the discontinued LLVM Phabricator instance.

[X86] Add SM4 instructions.
ClosedPublic

Authored by FreddyYe on Jul 12 2023, 7:27 PM.

Diff Detail

Event Timeline

FreddyYe created this revision.Jul 12 2023, 7:27 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 12 2023, 7:27 PM
FreddyYe requested review of this revision.Jul 12 2023, 7:27 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJul 12 2023, 7:27 PM
pengfei added inline comments.Jul 13 2023, 5:59 AM
llvm/test/MC/Disassembler/X86/sm4-64.txt
4–5

Merge 64-bit tests.

pengfei added inline comments.Jul 13 2023, 6:02 AM
llvm/test/CodeGen/X86/sm4-intrinsics.ll
3

Remove O0.

4

ditto.

skan added inline comments.Jul 13 2023, 6:47 AM
llvm/lib/Target/X86/X86InstrSSE.td
8308

From the description, it seems that WriteVecIMul is not the right schedule?

llvm/test/MC/Disassembler/X86/sm4-64.txt
5

Remove -x86-asm-syntax=intel

FreddyYe marked 4 inline comments as done.Jul 17 2023, 1:25 AM
FreddyYe added inline comments.
llvm/lib/Target/X86/X86InstrSSE.td
8308

Added FIXME.

FreddyYe updated this revision to Diff 540900.Jul 17 2023, 1:25 AM
FreddyYe marked an inline comment as done.

Address comments.

RKSimon added inline comments.Jul 17 2023, 2:01 AM
clang/lib/Headers/sm4intrin.h
18

doxygen descriptions?

clang/test/CodeGen/X86/sm4-builtins.c
6

what is stddef.h needed for?

llvm/test/MC/Disassembler/X86/sm4-64.txt
5

As with sm3 - keep the 64-bit tests but make sure we have at least some test coverage with x86_64 specific registers (ymm8..ymm15 / r8..r15 etc.)

FreddyYe updated this revision to Diff 540950.Jul 17 2023, 4:32 AM
FreddyYe marked an inline comment as done.

Remove #include <stddef.h>

FreddyYe added inline comments.Jul 17 2023, 4:36 AM
clang/test/CodeGen/X86/sm4-builtins.c
6

Good catch! probably be copy paste error.

FreddyYe retitled this revision from Add SM4 instructions. to [X86] Add SM4 instructions..Jul 17 2023, 4:43 AM
FreddyYe updated this revision to Diff 541373.Jul 18 2023, 12:55 AM
FreddyYe marked 3 inline comments as done.

Address comments.

RKSimon added inline comments.Jul 18 2023, 2:36 AM
clang/lib/Headers/sm4intrin.h
27

VPDPBSSD ?

FreddyYe updated this revision to Diff 541496.Jul 18 2023, 6:17 AM
FreddyYe marked an inline comment as done.

Address comments.

@pengfei Are you happy with the intrinsics doxygen descriptions?

pengfei accepted this revision.Jul 18 2023, 7:09 AM

@pengfei Are you happy with the intrinsics doxygen descriptions?

LGTM except for one comment.

clang/lib/Headers/sm4intrin.h
24

Missing return type here. The same for below.

This revision is now accepted and ready to land.Jul 18 2023, 7:09 AM
FreddyYe updated this revision to Diff 541787.Jul 18 2023, 4:58 PM
FreddyYe marked an inline comment as done.

Address comment.

skan accepted this revision.Jul 18 2023, 7:07 PM

LGTM

FreddyYe updated this revision to Diff 542305.Jul 19 2023, 10:34 PM

rebase and fix lit fail

This revision was landed with ongoing or failed builds.Jul 19 2023, 10:35 PM
This revision was automatically updated to reflect the committed changes.