1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 12:12:47 +01:00
llvm-mirror/test/MC/X86/SHA-64.s
Gadi Haber 98d9000b4b [X86][MC]: Adding test coverage of MC encoding for several small extensions.<NFC>
NFC.
 Adding MC regressions tests to cover several small x86 extensions as follows:
 CLWB, CLZERO, F16C, INVPCID, PKU, POPCNT, RTM, SGX, SHA, SVM, VMFUNC, VTX

This patch is part of a larger task to cover MC encoding of all X86 isa sets started in revision: https://reviews.llvm.org/D39952

Reviewers: RKSimon, craig.topper, zvi, AndreiGrischenko
Differential Revision: https://reviews.llvm.org/D41388

Change-Id: I254508cd17faca00b780be0fc2abf6c71b61faab
llvm-svn: 324595
2018-02-08 11:16:02 +00:00

395 lines
13 KiB
ArmAsm

// RUN: llvm-mc -triple x86_64-unknown-unknown --show-encoding %s | FileCheck %s
// CHECK: sha1msg1 485498096, %xmm15
// CHECK: encoding: [0x44,0x0f,0x38,0xc9,0x3c,0x25,0xf0,0x1c,0xf0,0x1c]
sha1msg1 485498096, %xmm15
// CHECK: sha1msg1 485498096, %xmm6
// CHECK: encoding: [0x0f,0x38,0xc9,0x34,0x25,0xf0,0x1c,0xf0,0x1c]
sha1msg1 485498096, %xmm6
// CHECK: sha1msg1 64(%rdx,%rax,4), %xmm15
// CHECK: encoding: [0x44,0x0f,0x38,0xc9,0x7c,0x82,0x40]
sha1msg1 64(%rdx,%rax,4), %xmm15
// CHECK: sha1msg1 -64(%rdx,%rax,4), %xmm15
// CHECK: encoding: [0x44,0x0f,0x38,0xc9,0x7c,0x82,0xc0]
sha1msg1 -64(%rdx,%rax,4), %xmm15
// CHECK: sha1msg1 64(%rdx,%rax,4), %xmm6
// CHECK: encoding: [0x0f,0x38,0xc9,0x74,0x82,0x40]
sha1msg1 64(%rdx,%rax,4), %xmm6
// CHECK: sha1msg1 -64(%rdx,%rax,4), %xmm6
// CHECK: encoding: [0x0f,0x38,0xc9,0x74,0x82,0xc0]
sha1msg1 -64(%rdx,%rax,4), %xmm6
// CHECK: sha1msg1 64(%rdx,%rax), %xmm15
// CHECK: encoding: [0x44,0x0f,0x38,0xc9,0x7c,0x02,0x40]
sha1msg1 64(%rdx,%rax), %xmm15
// CHECK: sha1msg1 64(%rdx,%rax), %xmm6
// CHECK: encoding: [0x0f,0x38,0xc9,0x74,0x02,0x40]
sha1msg1 64(%rdx,%rax), %xmm6
// CHECK: sha1msg1 64(%rdx), %xmm15
// CHECK: encoding: [0x44,0x0f,0x38,0xc9,0x7a,0x40]
sha1msg1 64(%rdx), %xmm15
// CHECK: sha1msg1 64(%rdx), %xmm6
// CHECK: encoding: [0x0f,0x38,0xc9,0x72,0x40]
sha1msg1 64(%rdx), %xmm6
// CHECK: sha1msg1 (%rdx), %xmm15
// CHECK: encoding: [0x44,0x0f,0x38,0xc9,0x3a]
sha1msg1 (%rdx), %xmm15
// CHECK: sha1msg1 (%rdx), %xmm6
// CHECK: encoding: [0x0f,0x38,0xc9,0x32]
sha1msg1 (%rdx), %xmm6
// CHECK: sha1msg1 %xmm15, %xmm15
// CHECK: encoding: [0x45,0x0f,0x38,0xc9,0xff]
sha1msg1 %xmm15, %xmm15
// CHECK: sha1msg1 %xmm6, %xmm6
// CHECK: encoding: [0x0f,0x38,0xc9,0xf6]
sha1msg1 %xmm6, %xmm6
// CHECK: sha1msg2 485498096, %xmm15
// CHECK: encoding: [0x44,0x0f,0x38,0xca,0x3c,0x25,0xf0,0x1c,0xf0,0x1c]
sha1msg2 485498096, %xmm15
// CHECK: sha1msg2 485498096, %xmm6
// CHECK: encoding: [0x0f,0x38,0xca,0x34,0x25,0xf0,0x1c,0xf0,0x1c]
sha1msg2 485498096, %xmm6
// CHECK: sha1msg2 64(%rdx,%rax,4), %xmm15
// CHECK: encoding: [0x44,0x0f,0x38,0xca,0x7c,0x82,0x40]
sha1msg2 64(%rdx,%rax,4), %xmm15
// CHECK: sha1msg2 -64(%rdx,%rax,4), %xmm15
// CHECK: encoding: [0x44,0x0f,0x38,0xca,0x7c,0x82,0xc0]
sha1msg2 -64(%rdx,%rax,4), %xmm15
// CHECK: sha1msg2 64(%rdx,%rax,4), %xmm6
// CHECK: encoding: [0x0f,0x38,0xca,0x74,0x82,0x40]
sha1msg2 64(%rdx,%rax,4), %xmm6
// CHECK: sha1msg2 -64(%rdx,%rax,4), %xmm6
// CHECK: encoding: [0x0f,0x38,0xca,0x74,0x82,0xc0]
sha1msg2 -64(%rdx,%rax,4), %xmm6
// CHECK: sha1msg2 64(%rdx,%rax), %xmm15
// CHECK: encoding: [0x44,0x0f,0x38,0xca,0x7c,0x02,0x40]
sha1msg2 64(%rdx,%rax), %xmm15
// CHECK: sha1msg2 64(%rdx,%rax), %xmm6
// CHECK: encoding: [0x0f,0x38,0xca,0x74,0x02,0x40]
sha1msg2 64(%rdx,%rax), %xmm6
// CHECK: sha1msg2 64(%rdx), %xmm15
// CHECK: encoding: [0x44,0x0f,0x38,0xca,0x7a,0x40]
sha1msg2 64(%rdx), %xmm15
// CHECK: sha1msg2 64(%rdx), %xmm6
// CHECK: encoding: [0x0f,0x38,0xca,0x72,0x40]
sha1msg2 64(%rdx), %xmm6
// CHECK: sha1msg2 (%rdx), %xmm15
// CHECK: encoding: [0x44,0x0f,0x38,0xca,0x3a]
sha1msg2 (%rdx), %xmm15
// CHECK: sha1msg2 (%rdx), %xmm6
// CHECK: encoding: [0x0f,0x38,0xca,0x32]
sha1msg2 (%rdx), %xmm6
// CHECK: sha1msg2 %xmm15, %xmm15
// CHECK: encoding: [0x45,0x0f,0x38,0xca,0xff]
sha1msg2 %xmm15, %xmm15
// CHECK: sha1msg2 %xmm6, %xmm6
// CHECK: encoding: [0x0f,0x38,0xca,0xf6]
sha1msg2 %xmm6, %xmm6
// CHECK: sha1nexte 485498096, %xmm15
// CHECK: encoding: [0x44,0x0f,0x38,0xc8,0x3c,0x25,0xf0,0x1c,0xf0,0x1c]
sha1nexte 485498096, %xmm15
// CHECK: sha1nexte 485498096, %xmm6
// CHECK: encoding: [0x0f,0x38,0xc8,0x34,0x25,0xf0,0x1c,0xf0,0x1c]
sha1nexte 485498096, %xmm6
// CHECK: sha1nexte 64(%rdx,%rax,4), %xmm15
// CHECK: encoding: [0x44,0x0f,0x38,0xc8,0x7c,0x82,0x40]
sha1nexte 64(%rdx,%rax,4), %xmm15
// CHECK: sha1nexte -64(%rdx,%rax,4), %xmm15
// CHECK: encoding: [0x44,0x0f,0x38,0xc8,0x7c,0x82,0xc0]
sha1nexte -64(%rdx,%rax,4), %xmm15
// CHECK: sha1nexte 64(%rdx,%rax,4), %xmm6
// CHECK: encoding: [0x0f,0x38,0xc8,0x74,0x82,0x40]
sha1nexte 64(%rdx,%rax,4), %xmm6
// CHECK: sha1nexte -64(%rdx,%rax,4), %xmm6
// CHECK: encoding: [0x0f,0x38,0xc8,0x74,0x82,0xc0]
sha1nexte -64(%rdx,%rax,4), %xmm6
// CHECK: sha1nexte 64(%rdx,%rax), %xmm15
// CHECK: encoding: [0x44,0x0f,0x38,0xc8,0x7c,0x02,0x40]
sha1nexte 64(%rdx,%rax), %xmm15
// CHECK: sha1nexte 64(%rdx,%rax), %xmm6
// CHECK: encoding: [0x0f,0x38,0xc8,0x74,0x02,0x40]
sha1nexte 64(%rdx,%rax), %xmm6
// CHECK: sha1nexte 64(%rdx), %xmm15
// CHECK: encoding: [0x44,0x0f,0x38,0xc8,0x7a,0x40]
sha1nexte 64(%rdx), %xmm15
// CHECK: sha1nexte 64(%rdx), %xmm6
// CHECK: encoding: [0x0f,0x38,0xc8,0x72,0x40]
sha1nexte 64(%rdx), %xmm6
// CHECK: sha1nexte (%rdx), %xmm15
// CHECK: encoding: [0x44,0x0f,0x38,0xc8,0x3a]
sha1nexte (%rdx), %xmm15
// CHECK: sha1nexte (%rdx), %xmm6
// CHECK: encoding: [0x0f,0x38,0xc8,0x32]
sha1nexte (%rdx), %xmm6
// CHECK: sha1nexte %xmm15, %xmm15
// CHECK: encoding: [0x45,0x0f,0x38,0xc8,0xff]
sha1nexte %xmm15, %xmm15
// CHECK: sha1nexte %xmm6, %xmm6
// CHECK: encoding: [0x0f,0x38,0xc8,0xf6]
sha1nexte %xmm6, %xmm6
// CHECK: sha1rnds4 $0, 485498096, %xmm15
// CHECK: encoding: [0x44,0x0f,0x3a,0xcc,0x3c,0x25,0xf0,0x1c,0xf0,0x1c,0x00]
sha1rnds4 $0, 485498096, %xmm15
// CHECK: sha1rnds4 $0, 485498096, %xmm6
// CHECK: encoding: [0x0f,0x3a,0xcc,0x34,0x25,0xf0,0x1c,0xf0,0x1c,0x00]
sha1rnds4 $0, 485498096, %xmm6
// CHECK: sha1rnds4 $0, 64(%rdx,%rax,4), %xmm15
// CHECK: encoding: [0x44,0x0f,0x3a,0xcc,0x7c,0x82,0x40,0x00]
sha1rnds4 $0, 64(%rdx,%rax,4), %xmm15
// CHECK: sha1rnds4 $0, -64(%rdx,%rax,4), %xmm15
// CHECK: encoding: [0x44,0x0f,0x3a,0xcc,0x7c,0x82,0xc0,0x00]
sha1rnds4 $0, -64(%rdx,%rax,4), %xmm15
// CHECK: sha1rnds4 $0, 64(%rdx,%rax,4), %xmm6
// CHECK: encoding: [0x0f,0x3a,0xcc,0x74,0x82,0x40,0x00]
sha1rnds4 $0, 64(%rdx,%rax,4), %xmm6
// CHECK: sha1rnds4 $0, -64(%rdx,%rax,4), %xmm6
// CHECK: encoding: [0x0f,0x3a,0xcc,0x74,0x82,0xc0,0x00]
sha1rnds4 $0, -64(%rdx,%rax,4), %xmm6
// CHECK: sha1rnds4 $0, 64(%rdx,%rax), %xmm15
// CHECK: encoding: [0x44,0x0f,0x3a,0xcc,0x7c,0x02,0x40,0x00]
sha1rnds4 $0, 64(%rdx,%rax), %xmm15
// CHECK: sha1rnds4 $0, 64(%rdx,%rax), %xmm6
// CHECK: encoding: [0x0f,0x3a,0xcc,0x74,0x02,0x40,0x00]
sha1rnds4 $0, 64(%rdx,%rax), %xmm6
// CHECK: sha1rnds4 $0, 64(%rdx), %xmm15
// CHECK: encoding: [0x44,0x0f,0x3a,0xcc,0x7a,0x40,0x00]
sha1rnds4 $0, 64(%rdx), %xmm15
// CHECK: sha1rnds4 $0, 64(%rdx), %xmm6
// CHECK: encoding: [0x0f,0x3a,0xcc,0x72,0x40,0x00]
sha1rnds4 $0, 64(%rdx), %xmm6
// CHECK: sha1rnds4 $0, (%rdx), %xmm15
// CHECK: encoding: [0x44,0x0f,0x3a,0xcc,0x3a,0x00]
sha1rnds4 $0, (%rdx), %xmm15
// CHECK: sha1rnds4 $0, (%rdx), %xmm6
// CHECK: encoding: [0x0f,0x3a,0xcc,0x32,0x00]
sha1rnds4 $0, (%rdx), %xmm6
// CHECK: sha1rnds4 $0, %xmm15, %xmm15
// CHECK: encoding: [0x45,0x0f,0x3a,0xcc,0xff,0x00]
sha1rnds4 $0, %xmm15, %xmm15
// CHECK: sha1rnds4 $0, %xmm6, %xmm6
// CHECK: encoding: [0x0f,0x3a,0xcc,0xf6,0x00]
sha1rnds4 $0, %xmm6, %xmm6
// CHECK: sha256msg1 485498096, %xmm15
// CHECK: encoding: [0x44,0x0f,0x38,0xcc,0x3c,0x25,0xf0,0x1c,0xf0,0x1c]
sha256msg1 485498096, %xmm15
// CHECK: sha256msg1 485498096, %xmm6
// CHECK: encoding: [0x0f,0x38,0xcc,0x34,0x25,0xf0,0x1c,0xf0,0x1c]
sha256msg1 485498096, %xmm6
// CHECK: sha256msg1 64(%rdx,%rax,4), %xmm15
// CHECK: encoding: [0x44,0x0f,0x38,0xcc,0x7c,0x82,0x40]
sha256msg1 64(%rdx,%rax,4), %xmm15
// CHECK: sha256msg1 -64(%rdx,%rax,4), %xmm15
// CHECK: encoding: [0x44,0x0f,0x38,0xcc,0x7c,0x82,0xc0]
sha256msg1 -64(%rdx,%rax,4), %xmm15
// CHECK: sha256msg1 64(%rdx,%rax,4), %xmm6
// CHECK: encoding: [0x0f,0x38,0xcc,0x74,0x82,0x40]
sha256msg1 64(%rdx,%rax,4), %xmm6
// CHECK: sha256msg1 -64(%rdx,%rax,4), %xmm6
// CHECK: encoding: [0x0f,0x38,0xcc,0x74,0x82,0xc0]
sha256msg1 -64(%rdx,%rax,4), %xmm6
// CHECK: sha256msg1 64(%rdx,%rax), %xmm15
// CHECK: encoding: [0x44,0x0f,0x38,0xcc,0x7c,0x02,0x40]
sha256msg1 64(%rdx,%rax), %xmm15
// CHECK: sha256msg1 64(%rdx,%rax), %xmm6
// CHECK: encoding: [0x0f,0x38,0xcc,0x74,0x02,0x40]
sha256msg1 64(%rdx,%rax), %xmm6
// CHECK: sha256msg1 64(%rdx), %xmm15
// CHECK: encoding: [0x44,0x0f,0x38,0xcc,0x7a,0x40]
sha256msg1 64(%rdx), %xmm15
// CHECK: sha256msg1 64(%rdx), %xmm6
// CHECK: encoding: [0x0f,0x38,0xcc,0x72,0x40]
sha256msg1 64(%rdx), %xmm6
// CHECK: sha256msg1 (%rdx), %xmm15
// CHECK: encoding: [0x44,0x0f,0x38,0xcc,0x3a]
sha256msg1 (%rdx), %xmm15
// CHECK: sha256msg1 (%rdx), %xmm6
// CHECK: encoding: [0x0f,0x38,0xcc,0x32]
sha256msg1 (%rdx), %xmm6
// CHECK: sha256msg1 %xmm15, %xmm15
// CHECK: encoding: [0x45,0x0f,0x38,0xcc,0xff]
sha256msg1 %xmm15, %xmm15
// CHECK: sha256msg1 %xmm6, %xmm6
// CHECK: encoding: [0x0f,0x38,0xcc,0xf6]
sha256msg1 %xmm6, %xmm6
// CHECK: sha256msg2 485498096, %xmm15
// CHECK: encoding: [0x44,0x0f,0x38,0xcd,0x3c,0x25,0xf0,0x1c,0xf0,0x1c]
sha256msg2 485498096, %xmm15
// CHECK: sha256msg2 485498096, %xmm6
// CHECK: encoding: [0x0f,0x38,0xcd,0x34,0x25,0xf0,0x1c,0xf0,0x1c]
sha256msg2 485498096, %xmm6
// CHECK: sha256msg2 64(%rdx,%rax,4), %xmm15
// CHECK: encoding: [0x44,0x0f,0x38,0xcd,0x7c,0x82,0x40]
sha256msg2 64(%rdx,%rax,4), %xmm15
// CHECK: sha256msg2 -64(%rdx,%rax,4), %xmm15
// CHECK: encoding: [0x44,0x0f,0x38,0xcd,0x7c,0x82,0xc0]
sha256msg2 -64(%rdx,%rax,4), %xmm15
// CHECK: sha256msg2 64(%rdx,%rax,4), %xmm6
// CHECK: encoding: [0x0f,0x38,0xcd,0x74,0x82,0x40]
sha256msg2 64(%rdx,%rax,4), %xmm6
// CHECK: sha256msg2 -64(%rdx,%rax,4), %xmm6
// CHECK: encoding: [0x0f,0x38,0xcd,0x74,0x82,0xc0]
sha256msg2 -64(%rdx,%rax,4), %xmm6
// CHECK: sha256msg2 64(%rdx,%rax), %xmm15
// CHECK: encoding: [0x44,0x0f,0x38,0xcd,0x7c,0x02,0x40]
sha256msg2 64(%rdx,%rax), %xmm15
// CHECK: sha256msg2 64(%rdx,%rax), %xmm6
// CHECK: encoding: [0x0f,0x38,0xcd,0x74,0x02,0x40]
sha256msg2 64(%rdx,%rax), %xmm6
// CHECK: sha256msg2 64(%rdx), %xmm15
// CHECK: encoding: [0x44,0x0f,0x38,0xcd,0x7a,0x40]
sha256msg2 64(%rdx), %xmm15
// CHECK: sha256msg2 64(%rdx), %xmm6
// CHECK: encoding: [0x0f,0x38,0xcd,0x72,0x40]
sha256msg2 64(%rdx), %xmm6
// CHECK: sha256msg2 (%rdx), %xmm15
// CHECK: encoding: [0x44,0x0f,0x38,0xcd,0x3a]
sha256msg2 (%rdx), %xmm15
// CHECK: sha256msg2 (%rdx), %xmm6
// CHECK: encoding: [0x0f,0x38,0xcd,0x32]
sha256msg2 (%rdx), %xmm6
// CHECK: sha256msg2 %xmm15, %xmm15
// CHECK: encoding: [0x45,0x0f,0x38,0xcd,0xff]
sha256msg2 %xmm15, %xmm15
// CHECK: sha256msg2 %xmm6, %xmm6
// CHECK: encoding: [0x0f,0x38,0xcd,0xf6]
sha256msg2 %xmm6, %xmm6
// CHECK: sha256rnds2 %xmm0, 485498096, %xmm15
// CHECK: encoding: [0x44,0x0f,0x38,0xcb,0x3c,0x25,0xf0,0x1c,0xf0,0x1c]
sha256rnds2 %xmm0, 485498096, %xmm15
// CHECK: sha256rnds2 %xmm0, 485498096, %xmm6
// CHECK: encoding: [0x0f,0x38,0xcb,0x34,0x25,0xf0,0x1c,0xf0,0x1c]
sha256rnds2 %xmm0, 485498096, %xmm6
// CHECK: sha256rnds2 %xmm0, 64(%rdx,%rax,4), %xmm15
// CHECK: encoding: [0x44,0x0f,0x38,0xcb,0x7c,0x82,0x40]
sha256rnds2 %xmm0, 64(%rdx,%rax,4), %xmm15
// CHECK: sha256rnds2 %xmm0, -64(%rdx,%rax,4), %xmm15
// CHECK: encoding: [0x44,0x0f,0x38,0xcb,0x7c,0x82,0xc0]
sha256rnds2 %xmm0, -64(%rdx,%rax,4), %xmm15
// CHECK: sha256rnds2 %xmm0, 64(%rdx,%rax,4), %xmm6
// CHECK: encoding: [0x0f,0x38,0xcb,0x74,0x82,0x40]
sha256rnds2 %xmm0, 64(%rdx,%rax,4), %xmm6
// CHECK: sha256rnds2 %xmm0, -64(%rdx,%rax,4), %xmm6
// CHECK: encoding: [0x0f,0x38,0xcb,0x74,0x82,0xc0]
sha256rnds2 %xmm0, -64(%rdx,%rax,4), %xmm6
// CHECK: sha256rnds2 %xmm0, 64(%rdx,%rax), %xmm15
// CHECK: encoding: [0x44,0x0f,0x38,0xcb,0x7c,0x02,0x40]
sha256rnds2 %xmm0, 64(%rdx,%rax), %xmm15
// CHECK: sha256rnds2 %xmm0, 64(%rdx,%rax), %xmm6
// CHECK: encoding: [0x0f,0x38,0xcb,0x74,0x02,0x40]
sha256rnds2 %xmm0, 64(%rdx,%rax), %xmm6
// CHECK: sha256rnds2 %xmm0, 64(%rdx), %xmm15
// CHECK: encoding: [0x44,0x0f,0x38,0xcb,0x7a,0x40]
sha256rnds2 %xmm0, 64(%rdx), %xmm15
// CHECK: sha256rnds2 %xmm0, 64(%rdx), %xmm6
// CHECK: encoding: [0x0f,0x38,0xcb,0x72,0x40]
sha256rnds2 %xmm0, 64(%rdx), %xmm6
// CHECK: sha256rnds2 %xmm0, (%rdx), %xmm15
// CHECK: encoding: [0x44,0x0f,0x38,0xcb,0x3a]
sha256rnds2 %xmm0, (%rdx), %xmm15
// CHECK: sha256rnds2 %xmm0, (%rdx), %xmm6
// CHECK: encoding: [0x0f,0x38,0xcb,0x32]
sha256rnds2 %xmm0, (%rdx), %xmm6
// CHECK: sha256rnds2 %xmm0, %xmm15, %xmm15
// CHECK: encoding: [0x45,0x0f,0x38,0xcb,0xff]
sha256rnds2 %xmm0, %xmm15, %xmm15
// CHECK: sha256rnds2 %xmm0, %xmm6, %xmm6
// CHECK: encoding: [0x0f,0x38,0xcb,0xf6]
sha256rnds2 %xmm0, %xmm6, %xmm6