[PATCH] D155147: [X86] Add SM3 instructions.

2023-07-19 Thread Freddy, Ye via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGc6f66de21af0: [X86] Add SM3 instructions. (authored by 
FreddyYe).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155147/new/

https://reviews.llvm.org/D155147

Files:
  clang/docs/ReleaseNotes.rst
  clang/include/clang/Basic/BuiltinsX86.def
  clang/include/clang/Driver/Options.td
  clang/lib/Basic/Targets/X86.cpp
  clang/lib/Basic/Targets/X86.h
  clang/lib/Headers/CMakeLists.txt
  clang/lib/Headers/immintrin.h
  clang/lib/Headers/sm3intrin.h
  clang/lib/Sema/SemaChecking.cpp
  clang/test/CodeGen/X86/sm3-builtins.c
  clang/test/CodeGen/X86/sm3-error.c
  clang/test/CodeGen/attr-target-x86.c
  clang/test/Driver/x86-target-features.c
  clang/test/Preprocessor/x86_target_features.c
  llvm/docs/ReleaseNotes.rst
  llvm/include/llvm/IR/IntrinsicsX86.td
  llvm/include/llvm/TargetParser/X86TargetParser.def
  llvm/lib/Target/X86/X86.td
  llvm/lib/Target/X86/X86InstrInfo.td
  llvm/lib/Target/X86/X86InstrSSE.td
  llvm/lib/TargetParser/Host.cpp
  llvm/lib/TargetParser/X86TargetParser.cpp
  llvm/test/CodeGen/X86/sm3-intrinsics.ll
  llvm/test/MC/Disassembler/X86/sm3-32.txt
  llvm/test/MC/Disassembler/X86/sm3-64.txt
  llvm/test/MC/X86/sm3-att-32.s
  llvm/test/MC/X86/sm3-att-64.s
  llvm/test/MC/X86/sm3-intel-32.s
  llvm/test/MC/X86/sm3-intel-64.s
  llvm/test/TableGen/x86-fold-tables.inc

Index: llvm/test/TableGen/x86-fold-tables.inc
===
--- llvm/test/TableGen/x86-fold-tables.inc
+++ llvm/test/TableGen/x86-fold-tables.inc
@@ -4800,6 +4800,9 @@
   {X86::VSHUFPSZ128rrikz, X86::VSHUFPSZ128rmikz, 0},
   {X86::VSHUFPSZ256rrikz, X86::VSHUFPSZ256rmikz, 0},
   {X86::VSHUFPSZrrikz, X86::VSHUFPSZrmikz, 0},
+  {X86::VSM3MSG1rr, X86::VSM3MSG1rm, 0},
+  {X86::VSM3MSG2rr, X86::VSM3MSG2rm, 0},
+  {X86::VSM3RNDS2rr, X86::VSM3RNDS2rm, 0},
   {X86::VSQRTPDZ128rk, X86::VSQRTPDZ128mk, 0},
   {X86::VSQRTPDZ256rk, X86::VSQRTPDZ256mk, 0},
   {X86::VSQRTPDZrk, X86::VSQRTPDZmk, 0},
Index: llvm/test/MC/X86/sm3-intel-64.s
===
--- /dev/null
+++ llvm/test/MC/X86/sm3-intel-64.s
@@ -0,0 +1,86 @@
+// RUN: llvm-mc -triple x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding %s | FileCheck %s
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmm4
+// CHECK: encoding: [0xc4,0x62,0x10,0xda,0xe4]
+  vsm3msg1 xmm12, xmm13, xmm4
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [rbp + 8*r14 + 268435456]
+// CHECK: encoding: [0xc4,0x22,0x10,0xda,0xa4,0xf5,0x00,0x00,0x00,0x10]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [rbp + 8*r14 + 268435456]
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [r8 + 4*rax + 291]
+// CHECK: encoding: [0xc4,0x42,0x10,0xda,0xa4,0x80,0x23,0x01,0x00,0x00]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [r8 + 4*rax + 291]
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [rip]
+// CHECK: encoding: [0xc4,0x62,0x10,0xda,0x25,0x00,0x00,0x00,0x00]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [rip]
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [2*rbp - 512]
+// CHECK: encoding: [0xc4,0x62,0x10,0xda,0x24,0x6d,0x00,0xfe,0xff,0xff]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [2*rbp - 512]
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [rcx + 2032]
+// CHECK: encoding: [0xc4,0x62,0x10,0xda,0xa1,0xf0,0x07,0x00,0x00]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [rcx + 2032]
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [rdx - 2048]
+// CHECK: encoding: [0xc4,0x62,0x10,0xda,0xa2,0x00,0xf8,0xff,0xff]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [rdx - 2048]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmm4
+// CHECK: encoding: [0xc4,0x62,0x11,0xda,0xe4]
+  vsm3msg2 xmm12, xmm13, xmm4
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [rbp + 8*r14 + 268435456]
+// CHECK: encoding: [0xc4,0x22,0x11,0xda,0xa4,0xf5,0x00,0x00,0x00,0x10]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [rbp + 8*r14 + 268435456]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [r8 + 4*rax + 291]
+// CHECK: encoding: [0xc4,0x42,0x11,0xda,0xa4,0x80,0x23,0x01,0x00,0x00]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [r8 + 4*rax + 291]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [rip]
+// CHECK: encoding: [0xc4,0x62,0x11,0xda,0x25,0x00,0x00,0x00,0x00]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [rip]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [2*rbp - 512]
+// CHECK: encoding: [0xc4,0x62,0x11,0xda,0x24,0x6d,0x00,0xfe,0xff,0xff]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [2*rbp - 512]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [rcx + 2032]
+// CHECK: encoding: [0xc4,0x62,0x11,0xda,0xa1,0xf0,0x07,0x00,0x00]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [rcx + 2032]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [rdx - 2048]
+// CHECK: encoding: [0xc4,0x62,0x11,0xda,0xa2,0x00,0xf8,0xff,0xff]
+  vsm3msg2 xmm12, xmm13, xmmword ptr 

[PATCH] D155147: [X86] Add SM3 instructions.

2023-07-19 Thread Freddy, Ye via Phabricator via cfe-commits
FreddyYe updated this revision to Diff 542274.
FreddyYe added a comment.

rebase and fix lit fail


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155147/new/

https://reviews.llvm.org/D155147

Files:
  clang/docs/ReleaseNotes.rst
  clang/include/clang/Basic/BuiltinsX86.def
  clang/include/clang/Driver/Options.td
  clang/lib/Basic/Targets/X86.cpp
  clang/lib/Basic/Targets/X86.h
  clang/lib/Headers/CMakeLists.txt
  clang/lib/Headers/immintrin.h
  clang/lib/Headers/sm3intrin.h
  clang/lib/Sema/SemaChecking.cpp
  clang/test/CodeGen/X86/sm3-builtins.c
  clang/test/CodeGen/X86/sm3-error.c
  clang/test/CodeGen/attr-target-x86.c
  clang/test/Driver/x86-target-features.c
  clang/test/Preprocessor/x86_target_features.c
  llvm/docs/ReleaseNotes.rst
  llvm/include/llvm/IR/IntrinsicsX86.td
  llvm/include/llvm/TargetParser/X86TargetParser.def
  llvm/lib/Target/X86/X86.td
  llvm/lib/Target/X86/X86InstrInfo.td
  llvm/lib/Target/X86/X86InstrSSE.td
  llvm/lib/TargetParser/Host.cpp
  llvm/lib/TargetParser/X86TargetParser.cpp
  llvm/test/CodeGen/X86/sm3-intrinsics.ll
  llvm/test/MC/Disassembler/X86/sm3-32.txt
  llvm/test/MC/Disassembler/X86/sm3-64.txt
  llvm/test/MC/X86/sm3-att-32.s
  llvm/test/MC/X86/sm3-att-64.s
  llvm/test/MC/X86/sm3-intel-32.s
  llvm/test/MC/X86/sm3-intel-64.s
  llvm/test/TableGen/x86-fold-tables.inc

Index: llvm/test/TableGen/x86-fold-tables.inc
===
--- llvm/test/TableGen/x86-fold-tables.inc
+++ llvm/test/TableGen/x86-fold-tables.inc
@@ -4800,6 +4800,9 @@
   {X86::VSHUFPSZ128rrikz, X86::VSHUFPSZ128rmikz, 0},
   {X86::VSHUFPSZ256rrikz, X86::VSHUFPSZ256rmikz, 0},
   {X86::VSHUFPSZrrikz, X86::VSHUFPSZrmikz, 0},
+  {X86::VSM3MSG1rr, X86::VSM3MSG1rm, 0},
+  {X86::VSM3MSG2rr, X86::VSM3MSG2rm, 0},
+  {X86::VSM3RNDS2rr, X86::VSM3RNDS2rm, 0},
   {X86::VSQRTPDZ128rk, X86::VSQRTPDZ128mk, 0},
   {X86::VSQRTPDZ256rk, X86::VSQRTPDZ256mk, 0},
   {X86::VSQRTPDZrk, X86::VSQRTPDZmk, 0},
Index: llvm/test/MC/X86/sm3-intel-64.s
===
--- /dev/null
+++ llvm/test/MC/X86/sm3-intel-64.s
@@ -0,0 +1,86 @@
+// RUN: llvm-mc -triple x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding %s | FileCheck %s
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmm4
+// CHECK: encoding: [0xc4,0x62,0x10,0xda,0xe4]
+  vsm3msg1 xmm12, xmm13, xmm4
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [rbp + 8*r14 + 268435456]
+// CHECK: encoding: [0xc4,0x22,0x10,0xda,0xa4,0xf5,0x00,0x00,0x00,0x10]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [rbp + 8*r14 + 268435456]
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [r8 + 4*rax + 291]
+// CHECK: encoding: [0xc4,0x42,0x10,0xda,0xa4,0x80,0x23,0x01,0x00,0x00]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [r8 + 4*rax + 291]
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [rip]
+// CHECK: encoding: [0xc4,0x62,0x10,0xda,0x25,0x00,0x00,0x00,0x00]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [rip]
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [2*rbp - 512]
+// CHECK: encoding: [0xc4,0x62,0x10,0xda,0x24,0x6d,0x00,0xfe,0xff,0xff]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [2*rbp - 512]
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [rcx + 2032]
+// CHECK: encoding: [0xc4,0x62,0x10,0xda,0xa1,0xf0,0x07,0x00,0x00]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [rcx + 2032]
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [rdx - 2048]
+// CHECK: encoding: [0xc4,0x62,0x10,0xda,0xa2,0x00,0xf8,0xff,0xff]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [rdx - 2048]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmm4
+// CHECK: encoding: [0xc4,0x62,0x11,0xda,0xe4]
+  vsm3msg2 xmm12, xmm13, xmm4
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [rbp + 8*r14 + 268435456]
+// CHECK: encoding: [0xc4,0x22,0x11,0xda,0xa4,0xf5,0x00,0x00,0x00,0x10]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [rbp + 8*r14 + 268435456]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [r8 + 4*rax + 291]
+// CHECK: encoding: [0xc4,0x42,0x11,0xda,0xa4,0x80,0x23,0x01,0x00,0x00]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [r8 + 4*rax + 291]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [rip]
+// CHECK: encoding: [0xc4,0x62,0x11,0xda,0x25,0x00,0x00,0x00,0x00]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [rip]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [2*rbp - 512]
+// CHECK: encoding: [0xc4,0x62,0x11,0xda,0x24,0x6d,0x00,0xfe,0xff,0xff]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [2*rbp - 512]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [rcx + 2032]
+// CHECK: encoding: [0xc4,0x62,0x11,0xda,0xa1,0xf0,0x07,0x00,0x00]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [rcx + 2032]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [rdx - 2048]
+// CHECK: encoding: [0xc4,0x62,0x11,0xda,0xa2,0x00,0xf8,0xff,0xff]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [rdx - 2048]
+
+// CHECK: vsm3rnds2 xmm12, xmm13, xmm4, 123
+// CHECK: encoding: [0xc4,0x63,0x11,0xde,0xe4,0x7b]
+ 

[PATCH] D155147: [X86] Add SM3 instructions.

2023-07-18 Thread Freddy, Ye via Phabricator via cfe-commits
FreddyYe updated this revision to Diff 541824.
FreddyYe marked an inline comment as done.
FreddyYe added a comment.

Address comments.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155147/new/

https://reviews.llvm.org/D155147

Files:
  clang/docs/ReleaseNotes.rst
  clang/include/clang/Basic/BuiltinsX86.def
  clang/include/clang/Driver/Options.td
  clang/lib/Basic/Targets/X86.cpp
  clang/lib/Basic/Targets/X86.h
  clang/lib/Headers/CMakeLists.txt
  clang/lib/Headers/immintrin.h
  clang/lib/Headers/sm3intrin.h
  clang/lib/Sema/SemaChecking.cpp
  clang/test/CodeGen/X86/sm3-builtins.c
  clang/test/CodeGen/X86/sm3-error.c
  clang/test/CodeGen/attr-target-x86.c
  clang/test/Driver/x86-target-features.c
  clang/test/Preprocessor/x86_target_features.c
  llvm/docs/ReleaseNotes.rst
  llvm/include/llvm/IR/IntrinsicsX86.td
  llvm/include/llvm/TargetParser/X86TargetParser.def
  llvm/lib/Target/X86/X86.td
  llvm/lib/Target/X86/X86InstrInfo.td
  llvm/lib/Target/X86/X86InstrSSE.td
  llvm/lib/TargetParser/Host.cpp
  llvm/lib/TargetParser/X86TargetParser.cpp
  llvm/test/CodeGen/X86/sm3-intrinsics.ll
  llvm/test/MC/Disassembler/X86/sm3-32.txt
  llvm/test/MC/Disassembler/X86/sm3-64.txt
  llvm/test/MC/X86/sm3-att-32.s
  llvm/test/MC/X86/sm3-att-64.s
  llvm/test/MC/X86/sm3-intel-32.s
  llvm/test/MC/X86/sm3-intel-64.s

Index: llvm/test/MC/X86/sm3-intel-64.s
===
--- /dev/null
+++ llvm/test/MC/X86/sm3-intel-64.s
@@ -0,0 +1,86 @@
+// RUN: llvm-mc -triple x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding %s | FileCheck %s
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmm4
+// CHECK: encoding: [0xc4,0x62,0x10,0xda,0xe4]
+  vsm3msg1 xmm12, xmm13, xmm4
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [rbp + 8*r14 + 268435456]
+// CHECK: encoding: [0xc4,0x22,0x10,0xda,0xa4,0xf5,0x00,0x00,0x00,0x10]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [rbp + 8*r14 + 268435456]
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [r8 + 4*rax + 291]
+// CHECK: encoding: [0xc4,0x42,0x10,0xda,0xa4,0x80,0x23,0x01,0x00,0x00]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [r8 + 4*rax + 291]
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [rip]
+// CHECK: encoding: [0xc4,0x62,0x10,0xda,0x25,0x00,0x00,0x00,0x00]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [rip]
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [2*rbp - 512]
+// CHECK: encoding: [0xc4,0x62,0x10,0xda,0x24,0x6d,0x00,0xfe,0xff,0xff]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [2*rbp - 512]
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [rcx + 2032]
+// CHECK: encoding: [0xc4,0x62,0x10,0xda,0xa1,0xf0,0x07,0x00,0x00]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [rcx + 2032]
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [rdx - 2048]
+// CHECK: encoding: [0xc4,0x62,0x10,0xda,0xa2,0x00,0xf8,0xff,0xff]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [rdx - 2048]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmm4
+// CHECK: encoding: [0xc4,0x62,0x11,0xda,0xe4]
+  vsm3msg2 xmm12, xmm13, xmm4
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [rbp + 8*r14 + 268435456]
+// CHECK: encoding: [0xc4,0x22,0x11,0xda,0xa4,0xf5,0x00,0x00,0x00,0x10]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [rbp + 8*r14 + 268435456]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [r8 + 4*rax + 291]
+// CHECK: encoding: [0xc4,0x42,0x11,0xda,0xa4,0x80,0x23,0x01,0x00,0x00]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [r8 + 4*rax + 291]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [rip]
+// CHECK: encoding: [0xc4,0x62,0x11,0xda,0x25,0x00,0x00,0x00,0x00]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [rip]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [2*rbp - 512]
+// CHECK: encoding: [0xc4,0x62,0x11,0xda,0x24,0x6d,0x00,0xfe,0xff,0xff]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [2*rbp - 512]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [rcx + 2032]
+// CHECK: encoding: [0xc4,0x62,0x11,0xda,0xa1,0xf0,0x07,0x00,0x00]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [rcx + 2032]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [rdx - 2048]
+// CHECK: encoding: [0xc4,0x62,0x11,0xda,0xa2,0x00,0xf8,0xff,0xff]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [rdx - 2048]
+
+// CHECK: vsm3rnds2 xmm12, xmm13, xmm4, 123
+// CHECK: encoding: [0xc4,0x63,0x11,0xde,0xe4,0x7b]
+  vsm3rnds2 xmm12, xmm13, xmm4, 123
+
+// CHECK: vsm3rnds2 xmm12, xmm13, xmmword ptr [rbp + 8*r14 + 268435456], 123
+// CHECK: encoding: [0xc4,0x23,0x11,0xde,0xa4,0xf5,0x00,0x00,0x00,0x10,0x7b]
+  vsm3rnds2 xmm12, xmm13, xmmword ptr [rbp + 8*r14 + 268435456], 123
+
+// CHECK: vsm3rnds2 xmm12, xmm13, xmmword ptr [r8 + 4*rax + 291], 123
+// CHECK: encoding: [0xc4,0x43,0x11,0xde,0xa4,0x80,0x23,0x01,0x00,0x00,0x7b]
+  vsm3rnds2 xmm12, xmm13, xmmword ptr [r8 + 4*rax + 291], 123
+
+// CHECK: vsm3rnds2 xmm12, xmm13, xmmword ptr [rip], 123
+// CHECK: encoding: [0xc4,0x63,0x11,0xde,0x25,0x00,0x00,0x00,0x00,0x7b]
+  

[PATCH] D155147: [X86] Add SM3 instructions.

2023-07-18 Thread Phoebe Wang via Phabricator via cfe-commits
pengfei added inline comments.



Comment at: clang/lib/Headers/sm3intrin.h:162
+/// \param imm8
+///A 128-bit vector of [4 x int].
+/// \returns

This is `int`


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155147/new/

https://reviews.llvm.org/D155147

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D155147: [X86] Add SM3 instructions.

2023-07-18 Thread Freddy, Ye via Phabricator via cfe-commits
FreddyYe updated this revision to Diff 541815.
FreddyYe marked an inline comment as done.
FreddyYe added a comment.

Address comment.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155147/new/

https://reviews.llvm.org/D155147

Files:
  clang/docs/ReleaseNotes.rst
  clang/include/clang/Basic/BuiltinsX86.def
  clang/include/clang/Driver/Options.td
  clang/lib/Basic/Targets/X86.cpp
  clang/lib/Basic/Targets/X86.h
  clang/lib/Headers/CMakeLists.txt
  clang/lib/Headers/immintrin.h
  clang/lib/Headers/sm3intrin.h
  clang/lib/Sema/SemaChecking.cpp
  clang/test/CodeGen/X86/sm3-builtins.c
  clang/test/CodeGen/X86/sm3-error.c
  clang/test/CodeGen/attr-target-x86.c
  clang/test/Driver/x86-target-features.c
  clang/test/Preprocessor/x86_target_features.c
  llvm/docs/ReleaseNotes.rst
  llvm/include/llvm/IR/IntrinsicsX86.td
  llvm/include/llvm/TargetParser/X86TargetParser.def
  llvm/lib/Target/X86/X86.td
  llvm/lib/Target/X86/X86InstrInfo.td
  llvm/lib/Target/X86/X86InstrSSE.td
  llvm/lib/TargetParser/Host.cpp
  llvm/lib/TargetParser/X86TargetParser.cpp
  llvm/test/CodeGen/X86/sm3-intrinsics.ll
  llvm/test/MC/Disassembler/X86/sm3-32.txt
  llvm/test/MC/Disassembler/X86/sm3-64.txt
  llvm/test/MC/X86/sm3-att-32.s
  llvm/test/MC/X86/sm3-att-64.s
  llvm/test/MC/X86/sm3-intel-32.s
  llvm/test/MC/X86/sm3-intel-64.s

Index: llvm/test/MC/X86/sm3-intel-64.s
===
--- /dev/null
+++ llvm/test/MC/X86/sm3-intel-64.s
@@ -0,0 +1,86 @@
+// RUN: llvm-mc -triple x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding %s | FileCheck %s
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmm4
+// CHECK: encoding: [0xc4,0x62,0x10,0xda,0xe4]
+  vsm3msg1 xmm12, xmm13, xmm4
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [rbp + 8*r14 + 268435456]
+// CHECK: encoding: [0xc4,0x22,0x10,0xda,0xa4,0xf5,0x00,0x00,0x00,0x10]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [rbp + 8*r14 + 268435456]
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [r8 + 4*rax + 291]
+// CHECK: encoding: [0xc4,0x42,0x10,0xda,0xa4,0x80,0x23,0x01,0x00,0x00]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [r8 + 4*rax + 291]
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [rip]
+// CHECK: encoding: [0xc4,0x62,0x10,0xda,0x25,0x00,0x00,0x00,0x00]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [rip]
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [2*rbp - 512]
+// CHECK: encoding: [0xc4,0x62,0x10,0xda,0x24,0x6d,0x00,0xfe,0xff,0xff]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [2*rbp - 512]
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [rcx + 2032]
+// CHECK: encoding: [0xc4,0x62,0x10,0xda,0xa1,0xf0,0x07,0x00,0x00]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [rcx + 2032]
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [rdx - 2048]
+// CHECK: encoding: [0xc4,0x62,0x10,0xda,0xa2,0x00,0xf8,0xff,0xff]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [rdx - 2048]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmm4
+// CHECK: encoding: [0xc4,0x62,0x11,0xda,0xe4]
+  vsm3msg2 xmm12, xmm13, xmm4
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [rbp + 8*r14 + 268435456]
+// CHECK: encoding: [0xc4,0x22,0x11,0xda,0xa4,0xf5,0x00,0x00,0x00,0x10]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [rbp + 8*r14 + 268435456]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [r8 + 4*rax + 291]
+// CHECK: encoding: [0xc4,0x42,0x11,0xda,0xa4,0x80,0x23,0x01,0x00,0x00]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [r8 + 4*rax + 291]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [rip]
+// CHECK: encoding: [0xc4,0x62,0x11,0xda,0x25,0x00,0x00,0x00,0x00]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [rip]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [2*rbp - 512]
+// CHECK: encoding: [0xc4,0x62,0x11,0xda,0x24,0x6d,0x00,0xfe,0xff,0xff]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [2*rbp - 512]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [rcx + 2032]
+// CHECK: encoding: [0xc4,0x62,0x11,0xda,0xa1,0xf0,0x07,0x00,0x00]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [rcx + 2032]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [rdx - 2048]
+// CHECK: encoding: [0xc4,0x62,0x11,0xda,0xa2,0x00,0xf8,0xff,0xff]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [rdx - 2048]
+
+// CHECK: vsm3rnds2 xmm12, xmm13, xmm4, 123
+// CHECK: encoding: [0xc4,0x63,0x11,0xde,0xe4,0x7b]
+  vsm3rnds2 xmm12, xmm13, xmm4, 123
+
+// CHECK: vsm3rnds2 xmm12, xmm13, xmmword ptr [rbp + 8*r14 + 268435456], 123
+// CHECK: encoding: [0xc4,0x23,0x11,0xde,0xa4,0xf5,0x00,0x00,0x00,0x10,0x7b]
+  vsm3rnds2 xmm12, xmm13, xmmword ptr [rbp + 8*r14 + 268435456], 123
+
+// CHECK: vsm3rnds2 xmm12, xmm13, xmmword ptr [r8 + 4*rax + 291], 123
+// CHECK: encoding: [0xc4,0x43,0x11,0xde,0xa4,0x80,0x23,0x01,0x00,0x00,0x7b]
+  vsm3rnds2 xmm12, xmm13, xmmword ptr [r8 + 4*rax + 291], 123
+
+// CHECK: vsm3rnds2 xmm12, xmm13, xmmword ptr [rip], 123
+// CHECK: encoding: [0xc4,0x63,0x11,0xde,0x25,0x00,0x00,0x00,0x00,0x7b]
+  

[PATCH] D155147: [X86] Add SM3 instructions.

2023-07-18 Thread Phoebe Wang via Phabricator via cfe-commits
pengfei added inline comments.



Comment at: clang/lib/Headers/sm3intrin.h:161-164
+/// \param imm8
+///A 128-bit vector of [4 x int].
+/// \returns
+///A 32-bit int.

The description should invert


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155147/new/

https://reviews.llvm.org/D155147

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D155147: [X86] Add SM3 instructions.

2023-07-18 Thread Phoebe Wang via Phabricator via cfe-commits
pengfei accepted this revision.
pengfei added a comment.
This revision is now accepted and ready to land.

LGTM.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155147/new/

https://reviews.llvm.org/D155147

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D155147: [X86] Add SM3 instructions.

2023-07-18 Thread Freddy, Ye via Phabricator via cfe-commits
FreddyYe added inline comments.



Comment at: clang/lib/Headers/sm3intrin.h:230
+/// \endcode
+#define _mm_sm3rnds2_epi32(A, B, C, D) 
\
+  (__m128i) __builtin_ia32_vsm3rnds2((__v4su)A, (__v4su)B, (__v4su)C, (int)D)

pengfei wrote:
> Missing `__` for variables.
MACROs prefer no __ for prefix and the operation defines A, B, C, ... So I used 
another naming convention in doxygen for parameters.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155147/new/

https://reviews.llvm.org/D155147

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D155147: [X86] Add SM3 instructions.

2023-07-18 Thread Freddy, Ye via Phabricator via cfe-commits
FreddyYe updated this revision to Diff 541792.
FreddyYe marked 5 inline comments as done.
FreddyYe added a comment.

Address comments.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155147/new/

https://reviews.llvm.org/D155147

Files:
  clang/docs/ReleaseNotes.rst
  clang/include/clang/Basic/BuiltinsX86.def
  clang/include/clang/Driver/Options.td
  clang/lib/Basic/Targets/X86.cpp
  clang/lib/Basic/Targets/X86.h
  clang/lib/Headers/CMakeLists.txt
  clang/lib/Headers/immintrin.h
  clang/lib/Headers/sm3intrin.h
  clang/lib/Sema/SemaChecking.cpp
  clang/test/CodeGen/X86/sm3-builtins.c
  clang/test/CodeGen/X86/sm3-error.c
  clang/test/CodeGen/attr-target-x86.c
  clang/test/Driver/x86-target-features.c
  clang/test/Preprocessor/x86_target_features.c
  llvm/docs/ReleaseNotes.rst
  llvm/include/llvm/IR/IntrinsicsX86.td
  llvm/include/llvm/TargetParser/X86TargetParser.def
  llvm/lib/Target/X86/X86.td
  llvm/lib/Target/X86/X86InstrInfo.td
  llvm/lib/Target/X86/X86InstrSSE.td
  llvm/lib/TargetParser/Host.cpp
  llvm/lib/TargetParser/X86TargetParser.cpp
  llvm/test/CodeGen/X86/sm3-intrinsics.ll
  llvm/test/MC/Disassembler/X86/sm3-32.txt
  llvm/test/MC/Disassembler/X86/sm3-64.txt
  llvm/test/MC/X86/sm3-att-32.s
  llvm/test/MC/X86/sm3-att-64.s
  llvm/test/MC/X86/sm3-intel-32.s
  llvm/test/MC/X86/sm3-intel-64.s

Index: llvm/test/MC/X86/sm3-intel-64.s
===
--- /dev/null
+++ llvm/test/MC/X86/sm3-intel-64.s
@@ -0,0 +1,86 @@
+// RUN: llvm-mc -triple x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding %s | FileCheck %s
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmm4
+// CHECK: encoding: [0xc4,0x62,0x10,0xda,0xe4]
+  vsm3msg1 xmm12, xmm13, xmm4
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [rbp + 8*r14 + 268435456]
+// CHECK: encoding: [0xc4,0x22,0x10,0xda,0xa4,0xf5,0x00,0x00,0x00,0x10]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [rbp + 8*r14 + 268435456]
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [r8 + 4*rax + 291]
+// CHECK: encoding: [0xc4,0x42,0x10,0xda,0xa4,0x80,0x23,0x01,0x00,0x00]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [r8 + 4*rax + 291]
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [rip]
+// CHECK: encoding: [0xc4,0x62,0x10,0xda,0x25,0x00,0x00,0x00,0x00]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [rip]
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [2*rbp - 512]
+// CHECK: encoding: [0xc4,0x62,0x10,0xda,0x24,0x6d,0x00,0xfe,0xff,0xff]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [2*rbp - 512]
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [rcx + 2032]
+// CHECK: encoding: [0xc4,0x62,0x10,0xda,0xa1,0xf0,0x07,0x00,0x00]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [rcx + 2032]
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [rdx - 2048]
+// CHECK: encoding: [0xc4,0x62,0x10,0xda,0xa2,0x00,0xf8,0xff,0xff]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [rdx - 2048]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmm4
+// CHECK: encoding: [0xc4,0x62,0x11,0xda,0xe4]
+  vsm3msg2 xmm12, xmm13, xmm4
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [rbp + 8*r14 + 268435456]
+// CHECK: encoding: [0xc4,0x22,0x11,0xda,0xa4,0xf5,0x00,0x00,0x00,0x10]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [rbp + 8*r14 + 268435456]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [r8 + 4*rax + 291]
+// CHECK: encoding: [0xc4,0x42,0x11,0xda,0xa4,0x80,0x23,0x01,0x00,0x00]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [r8 + 4*rax + 291]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [rip]
+// CHECK: encoding: [0xc4,0x62,0x11,0xda,0x25,0x00,0x00,0x00,0x00]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [rip]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [2*rbp - 512]
+// CHECK: encoding: [0xc4,0x62,0x11,0xda,0x24,0x6d,0x00,0xfe,0xff,0xff]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [2*rbp - 512]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [rcx + 2032]
+// CHECK: encoding: [0xc4,0x62,0x11,0xda,0xa1,0xf0,0x07,0x00,0x00]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [rcx + 2032]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [rdx - 2048]
+// CHECK: encoding: [0xc4,0x62,0x11,0xda,0xa2,0x00,0xf8,0xff,0xff]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [rdx - 2048]
+
+// CHECK: vsm3rnds2 xmm12, xmm13, xmm4, 123
+// CHECK: encoding: [0xc4,0x63,0x11,0xde,0xe4,0x7b]
+  vsm3rnds2 xmm12, xmm13, xmm4, 123
+
+// CHECK: vsm3rnds2 xmm12, xmm13, xmmword ptr [rbp + 8*r14 + 268435456], 123
+// CHECK: encoding: [0xc4,0x23,0x11,0xde,0xa4,0xf5,0x00,0x00,0x00,0x10,0x7b]
+  vsm3rnds2 xmm12, xmm13, xmmword ptr [rbp + 8*r14 + 268435456], 123
+
+// CHECK: vsm3rnds2 xmm12, xmm13, xmmword ptr [r8 + 4*rax + 291], 123
+// CHECK: encoding: [0xc4,0x43,0x11,0xde,0xa4,0x80,0x23,0x01,0x00,0x00,0x7b]
+  vsm3rnds2 xmm12, xmm13, xmmword ptr [r8 + 4*rax + 291], 123
+
+// CHECK: vsm3rnds2 xmm12, xmm13, xmmword ptr [rip], 123
+// CHECK: encoding: [0xc4,0x63,0x11,0xde,0x25,0x00,0x00,0x00,0x00,0x7b]
+  

[PATCH] D155147: [X86] Add SM3 instructions.

2023-07-18 Thread Phoebe Wang via Phabricator via cfe-commits
pengfei added inline comments.



Comment at: clang/lib/Headers/sm3intrin.h:69
+/// dst.dword[2] := P1(TMP2)
+/// dst.dword[3] := P1(TMP3)
+/// \endcode

`DEST[MAX:128] := 0` the same to below.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155147/new/

https://reviews.llvm.org/D155147

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D155147: [X86] Add SM3 instructions.

2023-07-18 Thread Phoebe Wang via Phabricator via cfe-commits
pengfei added inline comments.



Comment at: clang/lib/Headers/sm3intrin.h:28
+/// \code
+/// _mm_sm3msg1_epi32(__m128i __A, __m128i __B, __m128i __C)
+/// \endcode

Add return type too.



Comment at: clang/lib/Headers/sm3intrin.h:85
+/// \code
+/// _mm_sm3msg2_epi32(__m128i __A, __m128i __B, __m128i __C)
+/// \endcode

ditto.



Comment at: clang/lib/Headers/sm3intrin.h:148
+/// \code
+/// _mm_sm3rnds2_epi32(__m128i __A, __m128i __B, __m128i __C, const int imm8)
+/// \endcode

ditto.



Comment at: clang/lib/Headers/sm3intrin.h:230
+/// \endcode
+#define _mm_sm3rnds2_epi32(A, B, C, D) 
\
+  (__m128i) __builtin_ia32_vsm3rnds2((__v4su)A, (__v4su)B, (__v4su)C, (int)D)

Missing `__` for variables.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155147/new/

https://reviews.llvm.org/D155147

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D155147: [X86] Add SM3 instructions.

2023-07-18 Thread Simon Pilgrim via Phabricator via cfe-commits
RKSimon added a comment.

@pengfei Are you happy with the intrinsics doxygen descriptions?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155147/new/

https://reviews.llvm.org/D155147

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D155147: [X86] Add SM3 instructions.

2023-07-18 Thread Freddy, Ye via Phabricator via cfe-commits
FreddyYe updated this revision to Diff 541495.
FreddyYe marked an inline comment as done.
FreddyYe added a comment.

Address comments.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155147/new/

https://reviews.llvm.org/D155147

Files:
  clang/docs/ReleaseNotes.rst
  clang/include/clang/Basic/BuiltinsX86.def
  clang/include/clang/Driver/Options.td
  clang/lib/Basic/Targets/X86.cpp
  clang/lib/Basic/Targets/X86.h
  clang/lib/Headers/CMakeLists.txt
  clang/lib/Headers/immintrin.h
  clang/lib/Headers/sm3intrin.h
  clang/lib/Sema/SemaChecking.cpp
  clang/test/CodeGen/X86/sm3-builtins.c
  clang/test/CodeGen/X86/sm3-error.c
  clang/test/CodeGen/attr-target-x86.c
  clang/test/Driver/x86-target-features.c
  clang/test/Preprocessor/x86_target_features.c
  llvm/docs/ReleaseNotes.rst
  llvm/include/llvm/IR/IntrinsicsX86.td
  llvm/include/llvm/TargetParser/X86TargetParser.def
  llvm/lib/Target/X86/X86.td
  llvm/lib/Target/X86/X86InstrInfo.td
  llvm/lib/Target/X86/X86InstrSSE.td
  llvm/lib/TargetParser/Host.cpp
  llvm/lib/TargetParser/X86TargetParser.cpp
  llvm/test/CodeGen/X86/sm3-intrinsics.ll
  llvm/test/MC/Disassembler/X86/sm3-32.txt
  llvm/test/MC/Disassembler/X86/sm3-64.txt
  llvm/test/MC/X86/sm3-att-32.s
  llvm/test/MC/X86/sm3-att-64.s
  llvm/test/MC/X86/sm3-intel-32.s
  llvm/test/MC/X86/sm3-intel-64.s

Index: llvm/test/MC/X86/sm3-intel-64.s
===
--- /dev/null
+++ llvm/test/MC/X86/sm3-intel-64.s
@@ -0,0 +1,86 @@
+// RUN: llvm-mc -triple x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding %s | FileCheck %s
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmm4
+// CHECK: encoding: [0xc4,0x62,0x10,0xda,0xe4]
+  vsm3msg1 xmm12, xmm13, xmm4
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [rbp + 8*r14 + 268435456]
+// CHECK: encoding: [0xc4,0x22,0x10,0xda,0xa4,0xf5,0x00,0x00,0x00,0x10]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [rbp + 8*r14 + 268435456]
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [r8 + 4*rax + 291]
+// CHECK: encoding: [0xc4,0x42,0x10,0xda,0xa4,0x80,0x23,0x01,0x00,0x00]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [r8 + 4*rax + 291]
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [rip]
+// CHECK: encoding: [0xc4,0x62,0x10,0xda,0x25,0x00,0x00,0x00,0x00]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [rip]
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [2*rbp - 512]
+// CHECK: encoding: [0xc4,0x62,0x10,0xda,0x24,0x6d,0x00,0xfe,0xff,0xff]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [2*rbp - 512]
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [rcx + 2032]
+// CHECK: encoding: [0xc4,0x62,0x10,0xda,0xa1,0xf0,0x07,0x00,0x00]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [rcx + 2032]
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [rdx - 2048]
+// CHECK: encoding: [0xc4,0x62,0x10,0xda,0xa2,0x00,0xf8,0xff,0xff]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [rdx - 2048]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmm4
+// CHECK: encoding: [0xc4,0x62,0x11,0xda,0xe4]
+  vsm3msg2 xmm12, xmm13, xmm4
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [rbp + 8*r14 + 268435456]
+// CHECK: encoding: [0xc4,0x22,0x11,0xda,0xa4,0xf5,0x00,0x00,0x00,0x10]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [rbp + 8*r14 + 268435456]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [r8 + 4*rax + 291]
+// CHECK: encoding: [0xc4,0x42,0x11,0xda,0xa4,0x80,0x23,0x01,0x00,0x00]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [r8 + 4*rax + 291]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [rip]
+// CHECK: encoding: [0xc4,0x62,0x11,0xda,0x25,0x00,0x00,0x00,0x00]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [rip]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [2*rbp - 512]
+// CHECK: encoding: [0xc4,0x62,0x11,0xda,0x24,0x6d,0x00,0xfe,0xff,0xff]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [2*rbp - 512]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [rcx + 2032]
+// CHECK: encoding: [0xc4,0x62,0x11,0xda,0xa1,0xf0,0x07,0x00,0x00]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [rcx + 2032]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [rdx - 2048]
+// CHECK: encoding: [0xc4,0x62,0x11,0xda,0xa2,0x00,0xf8,0xff,0xff]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [rdx - 2048]
+
+// CHECK: vsm3rnds2 xmm12, xmm13, xmm4, 123
+// CHECK: encoding: [0xc4,0x63,0x11,0xde,0xe4,0x7b]
+  vsm3rnds2 xmm12, xmm13, xmm4, 123
+
+// CHECK: vsm3rnds2 xmm12, xmm13, xmmword ptr [rbp + 8*r14 + 268435456], 123
+// CHECK: encoding: [0xc4,0x23,0x11,0xde,0xa4,0xf5,0x00,0x00,0x00,0x10,0x7b]
+  vsm3rnds2 xmm12, xmm13, xmmword ptr [rbp + 8*r14 + 268435456], 123
+
+// CHECK: vsm3rnds2 xmm12, xmm13, xmmword ptr [r8 + 4*rax + 291], 123
+// CHECK: encoding: [0xc4,0x43,0x11,0xde,0xa4,0x80,0x23,0x01,0x00,0x00,0x7b]
+  vsm3rnds2 xmm12, xmm13, xmmword ptr [r8 + 4*rax + 291], 123
+
+// CHECK: vsm3rnds2 xmm12, xmm13, xmmword ptr [rip], 123
+// CHECK: encoding: [0xc4,0x63,0x11,0xde,0x25,0x00,0x00,0x00,0x00,0x7b]
+  

[PATCH] D155147: [X86] Add SM3 instructions.

2023-07-18 Thread Simon Pilgrim via Phabricator via cfe-commits
RKSimon added inline comments.



Comment at: clang/lib/Headers/sm3intrin.h:31
+///
+/// This intrinsic corresponds to the \c VPDPBSSD instruction.
+///

VPDPBSSD ?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155147/new/

https://reviews.llvm.org/D155147

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D155147: [X86] Add SM3 instructions.

2023-07-18 Thread Freddy, Ye via Phabricator via cfe-commits
FreddyYe updated this revision to Diff 541343.
FreddyYe added a comment.

Refine doxygen


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155147/new/

https://reviews.llvm.org/D155147

Files:
  clang/docs/ReleaseNotes.rst
  clang/include/clang/Basic/BuiltinsX86.def
  clang/include/clang/Driver/Options.td
  clang/lib/Basic/Targets/X86.cpp
  clang/lib/Basic/Targets/X86.h
  clang/lib/Headers/CMakeLists.txt
  clang/lib/Headers/immintrin.h
  clang/lib/Headers/sm3intrin.h
  clang/lib/Sema/SemaChecking.cpp
  clang/test/CodeGen/X86/sm3-builtins.c
  clang/test/CodeGen/X86/sm3-error.c
  clang/test/CodeGen/attr-target-x86.c
  clang/test/Driver/x86-target-features.c
  clang/test/Preprocessor/x86_target_features.c
  llvm/docs/ReleaseNotes.rst
  llvm/include/llvm/IR/IntrinsicsX86.td
  llvm/include/llvm/TargetParser/X86TargetParser.def
  llvm/lib/Target/X86/X86.td
  llvm/lib/Target/X86/X86InstrInfo.td
  llvm/lib/Target/X86/X86InstrSSE.td
  llvm/lib/TargetParser/Host.cpp
  llvm/lib/TargetParser/X86TargetParser.cpp
  llvm/test/CodeGen/X86/sm3-intrinsics.ll
  llvm/test/MC/Disassembler/X86/sm3-32.txt
  llvm/test/MC/Disassembler/X86/sm3-64.txt
  llvm/test/MC/X86/sm3-att-32.s
  llvm/test/MC/X86/sm3-att-64.s
  llvm/test/MC/X86/sm3-intel-32.s
  llvm/test/MC/X86/sm3-intel-64.s

Index: llvm/test/MC/X86/sm3-intel-64.s
===
--- /dev/null
+++ llvm/test/MC/X86/sm3-intel-64.s
@@ -0,0 +1,86 @@
+// RUN: llvm-mc -triple x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding %s | FileCheck %s
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmm4
+// CHECK: encoding: [0xc4,0x62,0x10,0xda,0xe4]
+  vsm3msg1 xmm12, xmm13, xmm4
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [rbp + 8*r14 + 268435456]
+// CHECK: encoding: [0xc4,0x22,0x10,0xda,0xa4,0xf5,0x00,0x00,0x00,0x10]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [rbp + 8*r14 + 268435456]
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [r8 + 4*rax + 291]
+// CHECK: encoding: [0xc4,0x42,0x10,0xda,0xa4,0x80,0x23,0x01,0x00,0x00]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [r8 + 4*rax + 291]
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [rip]
+// CHECK: encoding: [0xc4,0x62,0x10,0xda,0x25,0x00,0x00,0x00,0x00]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [rip]
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [2*rbp - 512]
+// CHECK: encoding: [0xc4,0x62,0x10,0xda,0x24,0x6d,0x00,0xfe,0xff,0xff]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [2*rbp - 512]
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [rcx + 2032]
+// CHECK: encoding: [0xc4,0x62,0x10,0xda,0xa1,0xf0,0x07,0x00,0x00]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [rcx + 2032]
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [rdx - 2048]
+// CHECK: encoding: [0xc4,0x62,0x10,0xda,0xa2,0x00,0xf8,0xff,0xff]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [rdx - 2048]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmm4
+// CHECK: encoding: [0xc4,0x62,0x11,0xda,0xe4]
+  vsm3msg2 xmm12, xmm13, xmm4
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [rbp + 8*r14 + 268435456]
+// CHECK: encoding: [0xc4,0x22,0x11,0xda,0xa4,0xf5,0x00,0x00,0x00,0x10]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [rbp + 8*r14 + 268435456]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [r8 + 4*rax + 291]
+// CHECK: encoding: [0xc4,0x42,0x11,0xda,0xa4,0x80,0x23,0x01,0x00,0x00]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [r8 + 4*rax + 291]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [rip]
+// CHECK: encoding: [0xc4,0x62,0x11,0xda,0x25,0x00,0x00,0x00,0x00]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [rip]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [2*rbp - 512]
+// CHECK: encoding: [0xc4,0x62,0x11,0xda,0x24,0x6d,0x00,0xfe,0xff,0xff]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [2*rbp - 512]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [rcx + 2032]
+// CHECK: encoding: [0xc4,0x62,0x11,0xda,0xa1,0xf0,0x07,0x00,0x00]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [rcx + 2032]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [rdx - 2048]
+// CHECK: encoding: [0xc4,0x62,0x11,0xda,0xa2,0x00,0xf8,0xff,0xff]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [rdx - 2048]
+
+// CHECK: vsm3rnds2 xmm12, xmm13, xmm4, 123
+// CHECK: encoding: [0xc4,0x63,0x11,0xde,0xe4,0x7b]
+  vsm3rnds2 xmm12, xmm13, xmm4, 123
+
+// CHECK: vsm3rnds2 xmm12, xmm13, xmmword ptr [rbp + 8*r14 + 268435456], 123
+// CHECK: encoding: [0xc4,0x23,0x11,0xde,0xa4,0xf5,0x00,0x00,0x00,0x10,0x7b]
+  vsm3rnds2 xmm12, xmm13, xmmword ptr [rbp + 8*r14 + 268435456], 123
+
+// CHECK: vsm3rnds2 xmm12, xmm13, xmmword ptr [r8 + 4*rax + 291], 123
+// CHECK: encoding: [0xc4,0x43,0x11,0xde,0xa4,0x80,0x23,0x01,0x00,0x00,0x7b]
+  vsm3rnds2 xmm12, xmm13, xmmword ptr [r8 + 4*rax + 291], 123
+
+// CHECK: vsm3rnds2 xmm12, xmm13, xmmword ptr [rip], 123
+// CHECK: encoding: [0xc4,0x63,0x11,0xde,0x25,0x00,0x00,0x00,0x00,0x7b]
+  vsm3rnds2 xmm12, xmm13, xmmword ptr [rip], 123
+
+// 

[PATCH] D155147: [X86] Add SM3 instructions.

2023-07-18 Thread Freddy, Ye via Phabricator via cfe-commits
FreddyYe updated this revision to Diff 541340.
FreddyYe marked 2 inline comments as done.
FreddyYe added a comment.

Address commments.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155147/new/

https://reviews.llvm.org/D155147

Files:
  clang/docs/ReleaseNotes.rst
  clang/include/clang/Basic/BuiltinsX86.def
  clang/include/clang/Driver/Options.td
  clang/lib/Basic/Targets/X86.cpp
  clang/lib/Basic/Targets/X86.h
  clang/lib/Headers/CMakeLists.txt
  clang/lib/Headers/immintrin.h
  clang/lib/Headers/sm3intrin.h
  clang/lib/Sema/SemaChecking.cpp
  clang/test/CodeGen/X86/sm3-builtins.c
  clang/test/CodeGen/X86/sm3-error.c
  clang/test/CodeGen/attr-target-x86.c
  clang/test/Driver/x86-target-features.c
  clang/test/Preprocessor/x86_target_features.c
  llvm/docs/ReleaseNotes.rst
  llvm/include/llvm/IR/IntrinsicsX86.td
  llvm/include/llvm/TargetParser/X86TargetParser.def
  llvm/lib/Target/X86/X86.td
  llvm/lib/Target/X86/X86InstrInfo.td
  llvm/lib/Target/X86/X86InstrSSE.td
  llvm/lib/TargetParser/Host.cpp
  llvm/lib/TargetParser/X86TargetParser.cpp
  llvm/test/CodeGen/X86/sm3-intrinsics.ll
  llvm/test/MC/Disassembler/X86/sm3-32.txt
  llvm/test/MC/Disassembler/X86/sm3-64.txt
  llvm/test/MC/X86/sm3-att-32.s
  llvm/test/MC/X86/sm3-att-64.s
  llvm/test/MC/X86/sm3-intel-32.s
  llvm/test/MC/X86/sm3-intel-64.s

Index: llvm/test/MC/X86/sm3-intel-64.s
===
--- /dev/null
+++ llvm/test/MC/X86/sm3-intel-64.s
@@ -0,0 +1,86 @@
+// RUN: llvm-mc -triple x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding %s | FileCheck %s
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmm4
+// CHECK: encoding: [0xc4,0x62,0x10,0xda,0xe4]
+  vsm3msg1 xmm12, xmm13, xmm4
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [rbp + 8*r14 + 268435456]
+// CHECK: encoding: [0xc4,0x22,0x10,0xda,0xa4,0xf5,0x00,0x00,0x00,0x10]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [rbp + 8*r14 + 268435456]
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [r8 + 4*rax + 291]
+// CHECK: encoding: [0xc4,0x42,0x10,0xda,0xa4,0x80,0x23,0x01,0x00,0x00]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [r8 + 4*rax + 291]
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [rip]
+// CHECK: encoding: [0xc4,0x62,0x10,0xda,0x25,0x00,0x00,0x00,0x00]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [rip]
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [2*rbp - 512]
+// CHECK: encoding: [0xc4,0x62,0x10,0xda,0x24,0x6d,0x00,0xfe,0xff,0xff]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [2*rbp - 512]
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [rcx + 2032]
+// CHECK: encoding: [0xc4,0x62,0x10,0xda,0xa1,0xf0,0x07,0x00,0x00]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [rcx + 2032]
+
+// CHECK: vsm3msg1 xmm12, xmm13, xmmword ptr [rdx - 2048]
+// CHECK: encoding: [0xc4,0x62,0x10,0xda,0xa2,0x00,0xf8,0xff,0xff]
+  vsm3msg1 xmm12, xmm13, xmmword ptr [rdx - 2048]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmm4
+// CHECK: encoding: [0xc4,0x62,0x11,0xda,0xe4]
+  vsm3msg2 xmm12, xmm13, xmm4
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [rbp + 8*r14 + 268435456]
+// CHECK: encoding: [0xc4,0x22,0x11,0xda,0xa4,0xf5,0x00,0x00,0x00,0x10]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [rbp + 8*r14 + 268435456]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [r8 + 4*rax + 291]
+// CHECK: encoding: [0xc4,0x42,0x11,0xda,0xa4,0x80,0x23,0x01,0x00,0x00]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [r8 + 4*rax + 291]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [rip]
+// CHECK: encoding: [0xc4,0x62,0x11,0xda,0x25,0x00,0x00,0x00,0x00]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [rip]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [2*rbp - 512]
+// CHECK: encoding: [0xc4,0x62,0x11,0xda,0x24,0x6d,0x00,0xfe,0xff,0xff]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [2*rbp - 512]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [rcx + 2032]
+// CHECK: encoding: [0xc4,0x62,0x11,0xda,0xa1,0xf0,0x07,0x00,0x00]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [rcx + 2032]
+
+// CHECK: vsm3msg2 xmm12, xmm13, xmmword ptr [rdx - 2048]
+// CHECK: encoding: [0xc4,0x62,0x11,0xda,0xa2,0x00,0xf8,0xff,0xff]
+  vsm3msg2 xmm12, xmm13, xmmword ptr [rdx - 2048]
+
+// CHECK: vsm3rnds2 xmm12, xmm13, xmm4, 123
+// CHECK: encoding: [0xc4,0x63,0x11,0xde,0xe4,0x7b]
+  vsm3rnds2 xmm12, xmm13, xmm4, 123
+
+// CHECK: vsm3rnds2 xmm12, xmm13, xmmword ptr [rbp + 8*r14 + 268435456], 123
+// CHECK: encoding: [0xc4,0x23,0x11,0xde,0xa4,0xf5,0x00,0x00,0x00,0x10,0x7b]
+  vsm3rnds2 xmm12, xmm13, xmmword ptr [rbp + 8*r14 + 268435456], 123
+
+// CHECK: vsm3rnds2 xmm12, xmm13, xmmword ptr [r8 + 4*rax + 291], 123
+// CHECK: encoding: [0xc4,0x43,0x11,0xde,0xa4,0x80,0x23,0x01,0x00,0x00,0x7b]
+  vsm3rnds2 xmm12, xmm13, xmmword ptr [r8 + 4*rax + 291], 123
+
+// CHECK: vsm3rnds2 xmm12, xmm13, xmmword ptr [rip], 123
+// CHECK: encoding: [0xc4,0x63,0x11,0xde,0x25,0x00,0x00,0x00,0x00,0x7b]
+