This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH V2 6/9] gas, opcodes: SPARC M7 support: xmpmul, xmontmul and xmontsqr instructions.
- From: "Jose E. Marchesi" <jose dot marchesi at oracle dot com>
- To: binutils at sourceware dot org
- Cc: davem at davemloft dot net
- Date: Tue, 7 Oct 2014 16:48:30 +0200
- Subject: [PATCH V2 6/9] gas, opcodes: SPARC M7 support: xmpmul, xmontmul and xmontsqr instructions.
- Authentication-results: sourceware.org; auth=none
- References: <1412693313-3546-1-git-send-email-jose dot marchesi at oracle dot com>
This patch adds support for the new cryptography instructions added in
the OSA2015 specification and implemented by the M7 cpu.
Tested in sparc64-unknown-linux-gnu.
opcodes/ChangeLog:
2014-10-07 Jose E. Marchesi <jose.marchesi@oracle.com>
* sparc-opc.c (sparc-opcodes): Add instructions xmontmul,
xmontsqr, xmpmul.
gas/testsuite/ChangeLog:
2014-10-07 Jose E. Marchesi <jose.marchesi@oracle.com>
* gas/sparc/sparc.exp (sparc_elf_setup): Run the xcrypto test.
* gas/sparc/xcrypto.d: New file.
* gas/sparc/xcrypto.s: Likewise.
---
gas/testsuite/ChangeLog | 7 +++
gas/testsuite/gas/sparc/sparc.exp | 1 +
gas/testsuite/gas/sparc/xcrypto.d | 105 +++++++++++++++++++++++++++++++++++++
gas/testsuite/gas/sparc/xcrypto.s | 98 ++++++++++++++++++++++++++++++++++
opcodes/ChangeLog | 5 ++
opcodes/sparc-opc.c | 3 ++
6 files changed, 219 insertions(+)
create mode 100644 gas/testsuite/gas/sparc/xcrypto.d
create mode 100644 gas/testsuite/gas/sparc/xcrypto.s
diff --git a/gas/testsuite/gas/sparc/sparc.exp b/gas/testsuite/gas/sparc/sparc.exp
index 0504b8f..ed23655 100644
--- a/gas/testsuite/gas/sparc/sparc.exp
+++ b/gas/testsuite/gas/sparc/sparc.exp
@@ -79,6 +79,7 @@ if [istarget sparc*-*-*] {
run_dump_test "hpcvis3"
run_dump_test "ima"
run_dump_test "crypto"
+ run_dump_test "xcrypto"
run_dump_test "cbcond"
run_dump_test "pause"
run_dump_test "cfr"
diff --git a/gas/testsuite/gas/sparc/xcrypto.d b/gas/testsuite/gas/sparc/xcrypto.d
new file mode 100644
index 0000000..fbf8ba3
--- /dev/null
+++ b/gas/testsuite/gas/sparc/xcrypto.d
@@ -0,0 +1,105 @@
+#as: -Av9m
+#objdump: -dr
+#name: OSA2015 crypto instructions
+
+.*: +file format .*sparc.*
+
+Disassembly of section .text:
+
+0+ <.text>:
+ 0: 83 b0 29 00 xmpmul 0
+ 4: 83 b0 29 01 xmpmul 1
+ 8: 83 b0 29 02 xmpmul 2
+ c: 83 b0 29 03 xmpmul 3
+ 10: 83 b0 29 04 xmpmul 4
+ 14: 83 b0 29 05 xmpmul 5
+ 18: 83 b0 29 06 xmpmul 6
+ 1c: 83 b0 29 07 xmpmul 7
+ 20: 83 b0 29 08 xmpmul 8
+ 24: 83 b0 29 09 xmpmul 9
+ 28: 83 b0 29 0a xmpmul 0xa
+ 2c: 83 b0 29 0b xmpmul 0xb
+ 30: 83 b0 29 0c xmpmul 0xc
+ 34: 83 b0 29 0d xmpmul 0xd
+ 38: 83 b0 29 0e xmpmul 0xe
+ 3c: 83 b0 29 0f xmpmul 0xf
+ 40: 83 b0 29 10 xmpmul 0x10
+ 44: 83 b0 29 11 xmpmul 0x11
+ 48: 83 b0 29 12 xmpmul 0x12
+ 4c: 83 b0 29 13 xmpmul 0x13
+ 50: 83 b0 29 14 xmpmul 0x14
+ 54: 83 b0 29 15 xmpmul 0x15
+ 58: 83 b0 29 16 xmpmul 0x16
+ 5c: 83 b0 29 17 xmpmul 0x17
+ 60: 83 b0 29 18 xmpmul 0x18
+ 64: 83 b0 29 19 xmpmul 0x19
+ 68: 83 b0 29 1a xmpmul 0x1a
+ 6c: 83 b0 29 1b xmpmul 0x1b
+ 70: 83 b0 29 1c xmpmul 0x1c
+ 74: 83 b0 29 1d xmpmul 0x1d
+ 78: 83 b0 29 1e xmpmul 0x1e
+ 7c: 83 b0 29 1f xmpmul 0x1f
+ 80: 83 b0 29 20 xmontmul 0
+ 84: 83 b0 29 21 xmontmul 1
+ 88: 83 b0 29 22 xmontmul 2
+ 8c: 83 b0 29 23 xmontmul 3
+ 90: 83 b0 29 24 xmontmul 4
+ 94: 83 b0 29 25 xmontmul 5
+ 98: 83 b0 29 26 xmontmul 6
+ 9c: 83 b0 29 27 xmontmul 7
+ a0: 83 b0 29 28 xmontmul 8
+ a4: 83 b0 29 29 xmontmul 9
+ a8: 83 b0 29 2a xmontmul 0xa
+ ac: 83 b0 29 2b xmontmul 0xb
+ b0: 83 b0 29 2c xmontmul 0xc
+ b4: 83 b0 29 2d xmontmul 0xd
+ b8: 83 b0 29 2e xmontmul 0xe
+ bc: 83 b0 29 2f xmontmul 0xf
+ c0: 83 b0 29 30 xmontmul 0x10
+ c4: 83 b0 29 31 xmontmul 0x11
+ c8: 83 b0 29 32 xmontmul 0x12
+ cc: 83 b0 29 33 xmontmul 0x13
+ d0: 83 b0 29 34 xmontmul 0x14
+ d4: 83 b0 29 35 xmontmul 0x15
+ d8: 83 b0 29 36 xmontmul 0x16
+ dc: 83 b0 29 37 xmontmul 0x17
+ e0: 83 b0 29 38 xmontmul 0x18
+ e4: 83 b0 29 39 xmontmul 0x19
+ e8: 83 b0 29 3a xmontmul 0x1a
+ ec: 83 b0 29 3b xmontmul 0x1b
+ f0: 83 b0 29 3c xmontmul 0x1c
+ f4: 83 b0 29 3d xmontmul 0x1d
+ f8: 83 b0 29 3e xmontmul 0x1e
+ fc: 83 b0 29 3f xmontmul 0x1f
+ 100: 83 b0 29 40 xmontsqr 0
+ 104: 83 b0 29 41 xmontsqr 1
+ 108: 83 b0 29 42 xmontsqr 2
+ 10c: 83 b0 29 43 xmontsqr 3
+ 110: 83 b0 29 44 xmontsqr 4
+ 114: 83 b0 29 45 xmontsqr 5
+ 118: 83 b0 29 46 xmontsqr 6
+ 11c: 83 b0 29 47 xmontsqr 7
+ 120: 83 b0 29 48 xmontsqr 8
+ 124: 83 b0 29 49 xmontsqr 9
+ 128: 83 b0 29 4a xmontsqr 0xa
+ 12c: 83 b0 29 4b xmontsqr 0xb
+ 130: 83 b0 29 4c xmontsqr 0xc
+ 134: 83 b0 29 4d xmontsqr 0xd
+ 138: 83 b0 29 4e xmontsqr 0xe
+ 13c: 83 b0 29 4f xmontsqr 0xf
+ 140: 83 b0 29 50 xmontsqr 0x10
+ 144: 83 b0 29 51 xmontsqr 0x11
+ 148: 83 b0 29 52 xmontsqr 0x12
+ 14c: 83 b0 29 53 xmontsqr 0x13
+ 150: 83 b0 29 54 xmontsqr 0x14
+ 154: 83 b0 29 55 xmontsqr 0x15
+ 158: 83 b0 29 56 xmontsqr 0x16
+ 15c: 83 b0 29 57 xmontsqr 0x17
+ 160: 83 b0 29 58 xmontsqr 0x18
+ 164: 83 b0 29 59 xmontsqr 0x19
+ 168: 83 b0 29 5a xmontsqr 0x1a
+ 16c: 83 b0 29 5b xmontsqr 0x1b
+ 170: 83 b0 29 5c xmontsqr 0x1c
+ 174: 83 b0 29 5d xmontsqr 0x1d
+ 178: 83 b0 29 5e xmontsqr 0x1e
+ 17c: 83 b0 29 5f xmontsqr 0x1f
diff --git a/gas/testsuite/gas/sparc/xcrypto.s b/gas/testsuite/gas/sparc/xcrypto.s
new file mode 100644
index 0000000..d793ce0
--- /dev/null
+++ b/gas/testsuite/gas/sparc/xcrypto.s
@@ -0,0 +1,98 @@
+# Test OSA2015 CRYPTO instructions
+ .text
+ xmpmul 0
+ xmpmul 1
+ xmpmul 2
+ xmpmul 3
+ xmpmul 4
+ xmpmul 5
+ xmpmul 6
+ xmpmul 7
+ xmpmul 8
+ xmpmul 9
+ xmpmul 10
+ xmpmul 11
+ xmpmul 12
+ xmpmul 13
+ xmpmul 14
+ xmpmul 15
+ xmpmul 16
+ xmpmul 17
+ xmpmul 18
+ xmpmul 19
+ xmpmul 20
+ xmpmul 21
+ xmpmul 22
+ xmpmul 23
+ xmpmul 24
+ xmpmul 25
+ xmpmul 26
+ xmpmul 27
+ xmpmul 28
+ xmpmul 29
+ xmpmul 30
+ xmpmul 31
+ xmontmul 0
+ xmontmul 1
+ xmontmul 2
+ xmontmul 3
+ xmontmul 4
+ xmontmul 5
+ xmontmul 6
+ xmontmul 7
+ xmontmul 8
+ xmontmul 9
+ xmontmul 10
+ xmontmul 11
+ xmontmul 12
+ xmontmul 13
+ xmontmul 14
+ xmontmul 15
+ xmontmul 16
+ xmontmul 17
+ xmontmul 18
+ xmontmul 19
+ xmontmul 20
+ xmontmul 21
+ xmontmul 22
+ xmontmul 23
+ xmontmul 24
+ xmontmul 25
+ xmontmul 26
+ xmontmul 27
+ xmontmul 28
+ xmontmul 29
+ xmontmul 30
+ xmontmul 31
+ xmontsqr 0
+ xmontsqr 1
+ xmontsqr 2
+ xmontsqr 3
+ xmontsqr 4
+ xmontsqr 5
+ xmontsqr 6
+ xmontsqr 7
+ xmontsqr 8
+ xmontsqr 9
+ xmontsqr 10
+ xmontsqr 11
+ xmontsqr 12
+ xmontsqr 13
+ xmontsqr 14
+ xmontsqr 15
+ xmontsqr 16
+ xmontsqr 17
+ xmontsqr 18
+ xmontsqr 19
+ xmontsqr 20
+ xmontsqr 21
+ xmontsqr 22
+ xmontsqr 23
+ xmontsqr 24
+ xmontsqr 25
+ xmontsqr 26
+ xmontsqr 27
+ xmontsqr 28
+ xmontsqr 29
+ xmontsqr 30
+ xmontsqr 31
diff --git a/opcodes/sparc-opc.c b/opcodes/sparc-opc.c
index dc1c939..8c3251a 100644
--- a/opcodes/sparc-opc.c
+++ b/opcodes/sparc-opc.c
@@ -2020,8 +2020,11 @@ SLCBCC("cbnefr", 15),
{ "sha256", F3F(2, 0x36, 0x142), F3F(~2, ~0x36, ~0x142), "", F_FLOAT, HWCAP_SHA256, 0, v9b },
{ "sha512", F3F(2, 0x36, 0x143), F3F(~2, ~0x36, ~0x143), "", F_FLOAT, HWCAP_SHA512, 0, v9b },
{ "crc32c", F3F(2, 0x36, 0x147), F3F(~2, ~0x36, ~0x147), "v,B,H", F_FLOAT, HWCAP_CRC32C, 0, v9b },
+{ "xmpmul", F3F(2, 0x36, 0x148)|RD(1), F3F(~2, ~0x36, ~0x148)|RD(~1), "X", F_FLOAT, 0, HWCAP2_XMPMUL, v9b },
{ "mpmul", F3F(2, 0x36, 0x148), F3F(~2, ~0x36, ~0x148), "X", F_FLOAT, HWCAP_MPMUL, 0, v9b },
+{ "xmontmul", F3F(2, 0x36, 0x149)|RD(1), F3F(~2, ~0x36, ~0x149)|RD(~1), "X", F_FLOAT, 0, HWCAP2_XMONT, v9b },
{ "montmul", F3F(2, 0x36, 0x149), F3F(~2, ~0x36, ~0x149), "X", F_FLOAT, HWCAP_MONT, 0, v9b },
+{ "xmontsqr", F3F(2, 0x36, 0x14a)|RD(1), F3F(~2, ~0x36, ~0x14a)|RD(~1), "X", F_FLOAT, 0, HWCAP2_XMONT, v9b },
{ "montsqr", F3F(2, 0x36, 0x14a), F3F(~2, ~0x36, ~0x14a), "X", F_FLOAT, HWCAP_MONT, 0, v9b },
{"aes_eround01", F3F4(2, 0x19, 0), F3F4(~2, ~0x19, ~0), "v,B,5,H", F_FLOAT, HWCAP_AES, 0, v9b },
{"aes_eround23", F3F4(2, 0x19, 1), F3F4(~2, ~0x19, ~1), "v,B,5,H", F_FLOAT, HWCAP_AES, 0, v9b },
--
1.7.10.4