aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/config/tc-i386.c2
-rw-r--r--gas/doc/c-i386.texi2
-rw-r--r--gas/testsuite/ChangeLog8
-rw-r--r--gas/testsuite/gas/i386/i386.exp2
-rw-r--r--gas/testsuite/gas/i386/sha.d72
-rw-r--r--gas/testsuite/gas/i386/sha.s72
-rw-r--r--gas/testsuite/gas/i386/x86-64-sha.d72
-rw-r--r--gas/testsuite/gas/i386/x86-64-sha.s73
9 files changed, 308 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 18cdcb5..233f917 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+2013-07-25 Michael Zolotukhin <michael.v.zolotukhin@intel.com>
+
+ * config/tc-i386.c (cpu_arch): Add .sha.
+ * doc/c-i386.texi: Document sha/.sha.
+
2013-07-24 Anna Tikhonova <anna.tikhonova@intel.com>
Kirill Yukhin <kirill.yukhin@intel.com>
Michael Zolotukhin <michael.v.zolotukhin@intel.com>
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index fed8e3b..a5e014a 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -790,6 +790,8 @@ static const arch_entry cpu_arch[] =
CPU_SMAP_FLAGS, 0, 0 },
{ STRING_COMMA_LEN (".mpx"), PROCESSOR_UNKNOWN,
CPU_MPX_FLAGS, 0, 0 },
+ { STRING_COMMA_LEN (".sha"), PROCESSOR_UNKNOWN,
+ CPU_SHA_FLAGS, 0, 0 },
};
#ifdef I386COFF
diff --git a/gas/doc/c-i386.texi b/gas/doc/c-i386.texi
index 8a3a292..4012074 100644
--- a/gas/doc/c-i386.texi
+++ b/gas/doc/c-i386.texi
@@ -151,6 +151,7 @@ accept various extension mnemonics. For example,
@code{prfchw},
@code{smap},
@code{mpx},
+@code{sha},
@code{noavx},
@code{vmx},
@code{vmfunc},
@@ -1036,6 +1037,7 @@ supported on the CPU specified. The choices for @var{cpu_type} are:
@item @samp{.lzcnt} @tab @samp{.invpcid} @tab @samp{.vmfunc} @tab @samp{.hle}
@item @samp{.rtm} @tab @samp{.adx} @tab @samp{.rdseed} @tab @samp{.prfchw}
@item @samp{.smap} @tab @samp{.mpx}
+@item @samp{.smap} @tab @samp{.sha}
@item @samp{.3dnow} @tab @samp{.3dnowa} @tab @samp{.sse4a} @tab @samp{.sse5}
@item @samp{.syscall} @tab @samp{.rdtscp} @tab @samp{.svme} @tab @samp{.abm}
@item @samp{.lwp} @tab @samp{.fma4} @tab @samp{.xop} @tab @samp{.cx16}
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index d5c5174..f6c38f0 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+2013-07-25 Michael Zolotukhin <michael.v.zolotukhin@intel.com>
+
+ * gas/i386/sha.d: New.
+ * gas/i386/sha.s: New.
+ * gas/i386/x86-64-sha.d: New.
+ * gas/i386/x86-64-sha.s: New.
+ * gas/i386/i386.exp: Run new SHA tests.
+
2013-07-24 Anna Tikhonova <anna.tikhonova@intel.com>
Kirill Yukhin <kirill.yukhin@intel.com>
Michael Zolotukhin <michael.v.zolotukhin@intel.com>
diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp
index 7e98644..a97ae9c 100644
--- a/gas/testsuite/gas/i386/i386.exp
+++ b/gas/testsuite/gas/i386/i386.exp
@@ -248,6 +248,7 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_32_check]]
run_dump_test "mpx"
run_list_test "mpx-inval-1" "-al"
run_dump_test "mpx-add-bnd-prefix"
+ run_dump_test "sha"
# These tests require support for 8 and 16 bit relocs,
# so we only run them for ELF and COFF targets.
@@ -514,6 +515,7 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_64_check]] t
run_list_test "x86-64-mpx-inval-2" "-al"
run_dump_test "x86-64-mpx-addr32"
run_dump_test "x86-64-mpx-add-bnd-prefix"
+ run_dump_test "x86-64-sha"
if { ![istarget "*-*-aix*"]
&& ![istarget "*-*-beos*"]
diff --git a/gas/testsuite/gas/i386/sha.d b/gas/testsuite/gas/i386/sha.d
new file mode 100644
index 0000000..6d87264
--- /dev/null
+++ b/gas/testsuite/gas/i386/sha.d
@@ -0,0 +1,72 @@
+#objdump: -dw
+#name: i386 SHA
+
+.*: file format .*
+
+Disassembly of section \.text:
+
+0+ <_start>:
+[ ]*[a-f0-9]+: 0f 3a cc ca 09 sha1rnds4 \$0x9,%xmm2,%xmm1
+[ ]*[a-f0-9]+: 0f 3a cc 10 07 sha1rnds4 \$0x7,\(%eax\),%xmm2
+[ ]*[a-f0-9]+: 0f 3a cc 58 12 05 sha1rnds4 \$0x5,0x12\(%eax\),%xmm3
+[ ]*[a-f0-9]+: 0f 3a cc 24 58 01 sha1rnds4 \$0x1,\(%eax,%ebx,2\),%xmm4
+[ ]*[a-f0-9]+: 0f 38 c8 ca sha1nexte %xmm2,%xmm1
+[ ]*[a-f0-9]+: 0f 38 c8 08 sha1nexte \(%eax\),%xmm1
+[ ]*[a-f0-9]+: 0f 38 c8 48 12 sha1nexte 0x12\(%eax\),%xmm1
+[ ]*[a-f0-9]+: 0f 38 c8 0c 58 sha1nexte \(%eax,%ebx,2\),%xmm1
+[ ]*[a-f0-9]+: 0f 38 c9 ca sha1msg1 %xmm2,%xmm1
+[ ]*[a-f0-9]+: 0f 38 c9 08 sha1msg1 \(%eax\),%xmm1
+[ ]*[a-f0-9]+: 0f 38 c9 48 12 sha1msg1 0x12\(%eax\),%xmm1
+[ ]*[a-f0-9]+: 0f 38 c9 0c 58 sha1msg1 \(%eax,%ebx,2\),%xmm1
+[ ]*[a-f0-9]+: 0f 38 ca ca sha1msg2 %xmm2,%xmm1
+[ ]*[a-f0-9]+: 0f 38 ca 08 sha1msg2 \(%eax\),%xmm1
+[ ]*[a-f0-9]+: 0f 38 ca 48 12 sha1msg2 0x12\(%eax\),%xmm1
+[ ]*[a-f0-9]+: 0f 38 ca 0c 58 sha1msg2 \(%eax,%ebx,2\),%xmm1
+[ ]*[a-f0-9]+: 0f 38 cb ca sha256rnds2 (%xmm0,)?%xmm2,%xmm1
+[ ]*[a-f0-9]+: 0f 38 cb 08 sha256rnds2 (%xmm0,)?\(%eax\),%xmm1
+[ ]*[a-f0-9]+: 0f 38 cb 48 12 sha256rnds2 (%xmm0,)?0x12\(%eax\),%xmm1
+[ ]*[a-f0-9]+: 0f 38 cb 0c 58 sha256rnds2 (%xmm0,)?\(%eax,%ebx,2\),%xmm1
+[ ]*[a-f0-9]+: 0f 38 cb ca sha256rnds2 (%xmm0,)?%xmm2,%xmm1
+[ ]*[a-f0-9]+: 0f 38 cb 08 sha256rnds2 (%xmm0,)?\(%eax\),%xmm1
+[ ]*[a-f0-9]+: 0f 38 cb 48 12 sha256rnds2 (%xmm0,)?0x12\(%eax\),%xmm1
+[ ]*[a-f0-9]+: 0f 38 cb 0c 58 sha256rnds2 (%xmm0,)?\(%eax,%ebx,2\),%xmm1
+[ ]*[a-f0-9]+: 0f 38 cc ca sha256msg1 %xmm2,%xmm1
+[ ]*[a-f0-9]+: 0f 38 cc 08 sha256msg1 \(%eax\),%xmm1
+[ ]*[a-f0-9]+: 0f 38 cc 48 12 sha256msg1 0x12\(%eax\),%xmm1
+[ ]*[a-f0-9]+: 0f 38 cc 0c 58 sha256msg1 \(%eax,%ebx,2\),%xmm1
+[ ]*[a-f0-9]+: 0f 38 cd ca sha256msg2 %xmm2,%xmm1
+[ ]*[a-f0-9]+: 0f 38 cd 08 sha256msg2 \(%eax\),%xmm1
+[ ]*[a-f0-9]+: 0f 38 cd 48 12 sha256msg2 0x12\(%eax\),%xmm1
+[ ]*[a-f0-9]+: 0f 38 cd 0c 58 sha256msg2 \(%eax,%ebx,2\),%xmm1
+[ ]*[a-f0-9]+: 0f 3a cc ca 09 sha1rnds4 \$0x9,%xmm2,%xmm1
+[ ]*[a-f0-9]+: 0f 3a cc 10 07 sha1rnds4 \$0x7,\(%eax\),%xmm2
+[ ]*[a-f0-9]+: 0f 3a cc 58 12 05 sha1rnds4 \$0x5,0x12\(%eax\),%xmm3
+[ ]*[a-f0-9]+: 0f 3a cc 24 58 01 sha1rnds4 \$0x1,\(%eax,%ebx,2\),%xmm4
+[ ]*[a-f0-9]+: 0f 38 c8 ca sha1nexte %xmm2,%xmm1
+[ ]*[a-f0-9]+: 0f 38 c8 10 sha1nexte \(%eax\),%xmm2
+[ ]*[a-f0-9]+: 0f 38 c8 58 12 sha1nexte 0x12\(%eax\),%xmm3
+[ ]*[a-f0-9]+: 0f 38 c8 24 58 sha1nexte \(%eax,%ebx,2\),%xmm4
+[ ]*[a-f0-9]+: 0f 38 c9 ca sha1msg1 %xmm2,%xmm1
+[ ]*[a-f0-9]+: 0f 38 c9 10 sha1msg1 \(%eax\),%xmm2
+[ ]*[a-f0-9]+: 0f 38 c9 58 12 sha1msg1 0x12\(%eax\),%xmm3
+[ ]*[a-f0-9]+: 0f 38 c9 24 58 sha1msg1 \(%eax,%ebx,2\),%xmm4
+[ ]*[a-f0-9]+: 0f 38 ca ca sha1msg2 %xmm2,%xmm1
+[ ]*[a-f0-9]+: 0f 38 ca 10 sha1msg2 \(%eax\),%xmm2
+[ ]*[a-f0-9]+: 0f 38 ca 58 12 sha1msg2 0x12\(%eax\),%xmm3
+[ ]*[a-f0-9]+: 0f 38 ca 24 58 sha1msg2 \(%eax,%ebx,2\),%xmm4
+[ ]*[a-f0-9]+: 0f 38 cb ca sha256rnds2 (%xmm0,)?%xmm2,%xmm1
+[ ]*[a-f0-9]+: 0f 38 cb 10 sha256rnds2 (%xmm0,)?\(%eax\),%xmm2
+[ ]*[a-f0-9]+: 0f 38 cb 58 12 sha256rnds2 (%xmm0,)?0x12\(%eax\),%xmm3
+[ ]*[a-f0-9]+: 0f 38 cb 24 58 sha256rnds2 (%xmm0,)?\(%eax,%ebx,2\),%xmm4
+[ ]*[a-f0-9]+: 0f 38 cb ca sha256rnds2 (%xmm0,)?%xmm2,%xmm1
+[ ]*[a-f0-9]+: 0f 38 cb 10 sha256rnds2 (%xmm0,)?\(%eax\),%xmm2
+[ ]*[a-f0-9]+: 0f 38 cb 58 12 sha256rnds2 (%xmm0,)?0x12\(%eax\),%xmm3
+[ ]*[a-f0-9]+: 0f 38 cb 24 58 sha256rnds2 (%xmm0,)?\(%eax,%ebx,2\),%xmm4
+[ ]*[a-f0-9]+: 0f 38 cc ca sha256msg1 %xmm2,%xmm1
+[ ]*[a-f0-9]+: 0f 38 cc 10 sha256msg1 \(%eax\),%xmm2
+[ ]*[a-f0-9]+: 0f 38 cc 58 12 sha256msg1 0x12\(%eax\),%xmm3
+[ ]*[a-f0-9]+: 0f 38 cc 24 58 sha256msg1 \(%eax,%ebx,2\),%xmm4
+[ ]*[a-f0-9]+: 0f 38 cd ca sha256msg2 %xmm2,%xmm1
+[ ]*[a-f0-9]+: 0f 38 cd 10 sha256msg2 \(%eax\),%xmm2
+[ ]*[a-f0-9]+: 0f 38 cd 58 12 sha256msg2 0x12\(%eax\),%xmm3
+[ ]*[a-f0-9]+: 0f 38 cd 24 58 sha256msg2 \(%eax,%ebx,2\),%xmm4
diff --git a/gas/testsuite/gas/i386/sha.s b/gas/testsuite/gas/i386/sha.s
new file mode 100644
index 0000000..59d9b51
--- /dev/null
+++ b/gas/testsuite/gas/i386/sha.s
@@ -0,0 +1,72 @@
+# Check SHA instructions
+
+ .allow_index_reg
+ .text
+_start:
+ sha1rnds4 $9, %xmm2, %xmm1
+ sha1rnds4 $7, (%eax), %xmm2
+ sha1rnds4 $5, 0x12(%eax), %xmm3
+ sha1rnds4 $1, (%eax,%ebx,2), %xmm4
+ sha1nexte %xmm2, %xmm1
+ sha1nexte (%eax), %xmm1
+ sha1nexte 0x12(%eax), %xmm1
+ sha1nexte (%eax,%ebx,2), %xmm1
+ sha1msg1 %xmm2, %xmm1
+ sha1msg1 (%eax), %xmm1
+ sha1msg1 0x12(%eax), %xmm1
+ sha1msg1 (%eax,%ebx,2), %xmm1
+ sha1msg2 %xmm2, %xmm1
+ sha1msg2 (%eax), %xmm1
+ sha1msg2 0x12(%eax), %xmm1
+ sha1msg2 (%eax,%ebx,2), %xmm1
+ sha256rnds2 %xmm2, %xmm1
+ sha256rnds2 (%eax), %xmm1
+ sha256rnds2 0x12(%eax), %xmm1
+ sha256rnds2 (%eax,%ebx,2), %xmm1
+ sha256rnds2 %xmm0, %xmm2, %xmm1
+ sha256rnds2 %xmm0, (%eax), %xmm1
+ sha256rnds2 %xmm0, 0x12(%eax), %xmm1
+ sha256rnds2 %xmm0, (%eax,%ebx,2), %xmm1
+ sha256msg1 %xmm2, %xmm1
+ sha256msg1 (%eax), %xmm1
+ sha256msg1 0x12(%eax), %xmm1
+ sha256msg1 (%eax,%ebx,2), %xmm1
+ sha256msg2 %xmm2, %xmm1
+ sha256msg2 (%eax), %xmm1
+ sha256msg2 0x12(%eax), %xmm1
+ sha256msg2 (%eax,%ebx,2), %xmm1
+
+ .intel_syntax noprefix
+
+ sha1rnds4 xmm1, xmm2, 9
+ sha1rnds4 xmm2, XMMWORD PTR [eax], 7
+ sha1rnds4 xmm3, XMMWORD PTR [eax+0x12], 5
+ sha1rnds4 xmm4, XMMWORD PTR [eax+ebx*2], 1
+ sha1nexte xmm1, xmm2
+ sha1nexte xmm2, XMMWORD PTR [eax]
+ sha1nexte xmm3, XMMWORD PTR [eax+0x12]
+ sha1nexte xmm4, XMMWORD PTR [eax+ebx*2]
+ sha1msg1 xmm1, xmm2
+ sha1msg1 xmm2, XMMWORD PTR [eax]
+ sha1msg1 xmm3, XMMWORD PTR [eax+0x12]
+ sha1msg1 xmm4, XMMWORD PTR [eax+ebx*2]
+ sha1msg2 xmm1, xmm2
+ sha1msg2 xmm2, XMMWORD PTR [eax]
+ sha1msg2 xmm3, XMMWORD PTR [eax+0x12]
+ sha1msg2 xmm4, XMMWORD PTR [eax+ebx*2]
+ sha256rnds2 xmm1, xmm2
+ sha256rnds2 xmm2, XMMWORD PTR [eax]
+ sha256rnds2 xmm3, XMMWORD PTR [eax+0x12]
+ sha256rnds2 xmm4, XMMWORD PTR [eax+ebx*2]
+ sha256rnds2 xmm1, xmm2, xmm0
+ sha256rnds2 xmm2, XMMWORD PTR [eax], xmm0
+ sha256rnds2 xmm3, XMMWORD PTR [eax+0x12], xmm0
+ sha256rnds2 xmm4, XMMWORD PTR [eax+ebx*2], xmm0
+ sha256msg1 xmm1, xmm2
+ sha256msg1 xmm2, XMMWORD PTR [eax]
+ sha256msg1 xmm3, XMMWORD PTR [eax+0x12]
+ sha256msg1 xmm4, XMMWORD PTR [eax+ebx*2]
+ sha256msg2 xmm1, xmm2
+ sha256msg2 xmm2, XMMWORD PTR [eax]
+ sha256msg2 xmm3, XMMWORD PTR [eax+0x12]
+ sha256msg2 xmm4, XMMWORD PTR [eax+ebx*2]
diff --git a/gas/testsuite/gas/i386/x86-64-sha.d b/gas/testsuite/gas/i386/x86-64-sha.d
new file mode 100644
index 0000000..64f515d
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-sha.d
@@ -0,0 +1,72 @@
+#objdump: -dw
+#name: x86-64 SHA
+
+.*: file format .*
+
+Disassembly of section \.text:
+
+0+ <_start>:
+[ ]*[a-f0-9]+: 0f 3a cc ca 09 sha1rnds4 \$0x9,%xmm2,%xmm1
+[ ]*[a-f0-9]+: 0f 3a cc 10 07 sha1rnds4 \$0x7,\(%rax\),%xmm2
+[ ]*[a-f0-9]+: 0f 3a cc 58 12 05 sha1rnds4 \$0x5,0x12\(%rax\),%xmm3
+[ ]*[a-f0-9]+: 0f 3a cc 24 58 01 sha1rnds4 \$0x1,\(%rax,%rbx,2\),%xmm4
+[ ]*[a-f0-9]+: 0f 38 c8 fa sha1nexte %xmm2,%xmm7
+[ ]*[a-f0-9]+: 44 0f 38 c8 00 sha1nexte \(%rax\),%xmm8
+[ ]*[a-f0-9]+: 44 0f 38 c8 48 12 sha1nexte 0x12\(%rax\),%xmm9
+[ ]*[a-f0-9]+: 44 0f 38 c8 14 58 sha1nexte \(%rax,%rbx,2\),%xmm10
+[ ]*[a-f0-9]+: 0f 38 c9 fa sha1msg1 %xmm2,%xmm7
+[ ]*[a-f0-9]+: 44 0f 38 c9 00 sha1msg1 \(%rax\),%xmm8
+[ ]*[a-f0-9]+: 44 0f 38 c9 48 12 sha1msg1 0x12\(%rax\),%xmm9
+[ ]*[a-f0-9]+: 44 0f 38 c9 14 58 sha1msg1 \(%rax,%rbx,2\),%xmm10
+[ ]*[a-f0-9]+: 0f 38 ca fa sha1msg2 %xmm2,%xmm7
+[ ]*[a-f0-9]+: 44 0f 38 ca 00 sha1msg2 \(%rax\),%xmm8
+[ ]*[a-f0-9]+: 44 0f 38 ca 48 12 sha1msg2 0x12\(%rax\),%xmm9
+[ ]*[a-f0-9]+: 44 0f 38 ca 14 58 sha1msg2 \(%rax,%rbx,2\),%xmm10
+[ ]*[a-f0-9]+: 0f 38 cb ca sha256rnds2 (%xmm0,)?%xmm2,%xmm1
+[ ]*[a-f0-9]+: 0f 38 cb 08 sha256rnds2 (%xmm0,)?\(%rax\),%xmm1
+[ ]*[a-f0-9]+: 0f 38 cb 48 12 sha256rnds2 (%xmm0,)?0x12\(%rax\),%xmm1
+[ ]*[a-f0-9]+: 0f 38 cb 0c 58 sha256rnds2 (%xmm0,)?\(%rax,%rbx,2\),%xmm1
+[ ]*[a-f0-9]+: 0f 38 cb ca sha256rnds2 (%xmm0,)?%xmm2,%xmm1
+[ ]*[a-f0-9]+: 0f 38 cb 08 sha256rnds2 (%xmm0,)?\(%rax\),%xmm1
+[ ]*[a-f0-9]+: 0f 38 cb 48 12 sha256rnds2 (%xmm0,)?0x12\(%rax\),%xmm1
+[ ]*[a-f0-9]+: 0f 38 cb 0c 58 sha256rnds2 (%xmm0,)?\(%rax,%rbx,2\),%xmm1
+[ ]*[a-f0-9]+: 0f 38 cc ca sha256msg1 %xmm2,%xmm1
+[ ]*[a-f0-9]+: 0f 38 cc 08 sha256msg1 \(%rax\),%xmm1
+[ ]*[a-f0-9]+: 0f 38 cc 48 12 sha256msg1 0x12\(%rax\),%xmm1
+[ ]*[a-f0-9]+: 0f 38 cc 0c 58 sha256msg1 \(%rax,%rbx,2\),%xmm1
+[ ]*[a-f0-9]+: 0f 38 cd ca sha256msg2 %xmm2,%xmm1
+[ ]*[a-f0-9]+: 0f 38 cd 08 sha256msg2 \(%rax\),%xmm1
+[ ]*[a-f0-9]+: 0f 38 cd 48 12 sha256msg2 0x12\(%rax\),%xmm1
+[ ]*[a-f0-9]+: 0f 38 cd 0c 58 sha256msg2 \(%rax,%rbx,2\),%xmm1
+[ ]*[a-f0-9]+: 0f 3a cc ca 09 sha1rnds4 \$0x9,%xmm2,%xmm1
+[ ]*[a-f0-9]+: 0f 3a cc 10 07 sha1rnds4 \$0x7,\(%rax\),%xmm2
+[ ]*[a-f0-9]+: 0f 3a cc 58 12 05 sha1rnds4 \$0x5,0x12\(%rax\),%xmm3
+[ ]*[a-f0-9]+: 0f 3a cc 24 58 01 sha1rnds4 \$0x1,\(%rax,%rbx,2\),%xmm4
+[ ]*[a-f0-9]+: 0f 38 c8 ca sha1nexte %xmm2,%xmm1
+[ ]*[a-f0-9]+: 0f 38 c8 10 sha1nexte \(%rax\),%xmm2
+[ ]*[a-f0-9]+: 0f 38 c8 58 12 sha1nexte 0x12\(%rax\),%xmm3
+[ ]*[a-f0-9]+: 0f 38 c8 24 58 sha1nexte \(%rax,%rbx,2\),%xmm4
+[ ]*[a-f0-9]+: 0f 38 c9 ca sha1msg1 %xmm2,%xmm1
+[ ]*[a-f0-9]+: 0f 38 c9 10 sha1msg1 \(%rax\),%xmm2
+[ ]*[a-f0-9]+: 0f 38 c9 58 12 sha1msg1 0x12\(%rax\),%xmm3
+[ ]*[a-f0-9]+: 0f 38 c9 24 58 sha1msg1 \(%rax,%rbx,2\),%xmm4
+[ ]*[a-f0-9]+: 0f 38 ca ca sha1msg2 %xmm2,%xmm1
+[ ]*[a-f0-9]+: 0f 38 ca 10 sha1msg2 \(%rax\),%xmm2
+[ ]*[a-f0-9]+: 0f 38 ca 58 12 sha1msg2 0x12\(%rax\),%xmm3
+[ ]*[a-f0-9]+: 0f 38 ca 24 58 sha1msg2 \(%rax,%rbx,2\),%xmm4
+[ ]*[a-f0-9]+: 0f 38 cb ca sha256rnds2 (%xmm0,)?%xmm2,%xmm1
+[ ]*[a-f0-9]+: 0f 38 cb 10 sha256rnds2 (%xmm0,)?\(%rax\),%xmm2
+[ ]*[a-f0-9]+: 0f 38 cb 58 12 sha256rnds2 (%xmm0,)?0x12\(%rax\),%xmm3
+[ ]*[a-f0-9]+: 0f 38 cb 24 58 sha256rnds2 (%xmm0,)?\(%rax,%rbx,2\),%xmm4
+[ ]*[a-f0-9]+: 0f 38 cb ca sha256rnds2 (%xmm0,)?%xmm2,%xmm1
+[ ]*[a-f0-9]+: 0f 38 cb 10 sha256rnds2 (%xmm0,)?\(%rax\),%xmm2
+[ ]*[a-f0-9]+: 0f 38 cb 58 12 sha256rnds2 (%xmm0,)?0x12\(%rax\),%xmm3
+[ ]*[a-f0-9]+: 0f 38 cb 24 58 sha256rnds2 (%xmm0,)?\(%rax,%rbx,2\),%xmm4
+[ ]*[a-f0-9]+: 0f 38 cc ca sha256msg1 %xmm2,%xmm1
+[ ]*[a-f0-9]+: 0f 38 cc 10 sha256msg1 \(%rax\),%xmm2
+[ ]*[a-f0-9]+: 0f 38 cc 58 12 sha256msg1 0x12\(%rax\),%xmm3
+[ ]*[a-f0-9]+: 0f 38 cc 24 58 sha256msg1 \(%rax,%rbx,2\),%xmm4
+[ ]*[a-f0-9]+: 0f 38 cd ca sha256msg2 %xmm2,%xmm1
+[ ]*[a-f0-9]+: 0f 38 cd 10 sha256msg2 \(%rax\),%xmm2
+[ ]*[a-f0-9]+: 0f 38 cd 58 12 sha256msg2 0x12\(%rax\),%xmm3
+[ ]*[a-f0-9]+: 0f 38 cd 24 58 sha256msg2 \(%rax,%rbx,2\),%xmm4
diff --git a/gas/testsuite/gas/i386/x86-64-sha.s b/gas/testsuite/gas/i386/x86-64-sha.s
new file mode 100644
index 0000000..cc4d60e
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-sha.s
@@ -0,0 +1,73 @@
+# Check SHA instructions
+
+ .allow_index_reg
+ .text
+_start:
+ sha1rnds4 $9, %xmm2, %xmm1
+ sha1rnds4 $7, (%rax), %xmm2
+ sha1rnds4 $5, 0x12(%rax), %xmm3
+ sha1rnds4 $1, (%rax,%rbx,2), %xmm4
+ sha1nexte %xmm2, %xmm7
+ sha1nexte (%rax), %xmm8
+ sha1nexte 0x12(%rax), %xmm9
+ sha1nexte (%rax,%rbx,2), %xmm10
+ sha1msg1 %xmm2, %xmm7
+ sha1msg1 (%rax), %xmm8
+ sha1msg1 0x12(%rax), %xmm9
+ sha1msg1 (%rax,%rbx,2), %xmm10
+ sha1msg2 %xmm2, %xmm7
+ sha1msg2 (%rax), %xmm8
+ sha1msg2 0x12(%rax), %xmm9
+ sha1msg2 (%rax,%rbx,2), %xmm10
+ sha256rnds2 %xmm2, %xmm1
+ sha256rnds2 (%rax), %xmm1
+ sha256rnds2 0x12(%rax), %xmm1
+ sha256rnds2 (%rax,%rbx,2), %xmm1
+ sha256rnds2 %xmm0, %xmm2, %xmm1
+ sha256rnds2 %xmm0, (%rax), %xmm1
+ sha256rnds2 %xmm0, 0x12(%rax), %xmm1
+ sha256rnds2 %xmm0, (%rax,%rbx,2), %xmm1
+ sha256msg1 %xmm2, %xmm1
+ sha256msg1 (%rax), %xmm1
+ sha256msg1 0x12(%rax), %xmm1
+ sha256msg1 (%rax,%rbx,2), %xmm1
+ sha256msg2 %xmm2, %xmm1
+ sha256msg2 (%rax), %xmm1
+ sha256msg2 0x12(%rax), %xmm1
+ sha256msg2 (%rax,%rbx,2), %xmm1
+
+ .intel_syntax noprefix
+
+ sha1rnds4 xmm1, xmm2, 9
+ sha1rnds4 xmm2, XMMWORD PTR [rax], 7
+ sha1rnds4 xmm3, XMMWORD PTR [rax+0x12], 5
+ sha1rnds4 xmm4, XMMWORD PTR [rax+rbx*2], 1
+ sha1nexte xmm1, xmm2
+ sha1nexte xmm2, XMMWORD PTR [rax]
+ sha1nexte xmm3, XMMWORD PTR [rax+0x12]
+ sha1nexte xmm4, XMMWORD PTR [rax+rbx*2]
+ sha1msg1 xmm1, xmm2
+ sha1msg1 xmm2, XMMWORD PTR [rax]
+ sha1msg1 xmm3, XMMWORD PTR [rax+0x12]
+ sha1msg1 xmm4, XMMWORD PTR [rax+rbx*2]
+ sha1msg2 xmm1, xmm2
+ sha1msg2 xmm2, XMMWORD PTR [rax]
+ sha1msg2 xmm3, XMMWORD PTR [rax+0x12]
+ sha1msg2 xmm4, XMMWORD PTR [rax+rbx*2]
+ sha256rnds2 xmm1, xmm2
+ sha256rnds2 xmm2, XMMWORD PTR [rax]
+ sha256rnds2 xmm3, XMMWORD PTR [rax+0x12]
+ sha256rnds2 xmm4, XMMWORD PTR [rax+rbx*2]
+ sha256rnds2 xmm1, xmm2, xmm0
+ sha256rnds2 xmm2, XMMWORD PTR [rax], xmm0
+ sha256rnds2 xmm3, XMMWORD PTR [rax+0x12], xmm0
+ sha256rnds2 xmm4, XMMWORD PTR [rax+rbx*2], xmm0
+ sha256msg1 xmm1, xmm2
+ sha256msg1 xmm2, XMMWORD PTR [rax]
+ sha256msg1 xmm3, XMMWORD PTR [rax+0x12]
+ sha256msg1 xmm4, XMMWORD PTR [rax+rbx*2]
+ sha256msg2 xmm1, xmm2
+ sha256msg2 xmm2, XMMWORD PTR [rax]
+ sha256msg2 xmm3, XMMWORD PTR [rax+0x12]
+ sha256msg2 xmm4, XMMWORD PTR [rax+rbx*2]
+