From e6f372ba661bb0d8eec1e22a6dc1ad9937336e4d Mon Sep 17 00:00:00 2001 From: Jim Wilson Date: Tue, 8 May 2018 15:46:19 -0700 Subject: RISC-V: Add missing hint instructions from RV128I. gas/ * testsuite/gas/riscv/c-zero-imm.d: Add more tests. * testsuite/gas/riscv/c-zero-imm.s: Likewise. * testsuite/gas/riscv/c-zero-reg.d: Fix typo in test. Add disabled future test for RV128 support. * testsuite/gas/riscv/c-zero-reg.s: Likewise. include/ * opcode/riscv-opc.h (MATCH_C_SRLI64, MASK_C_SRLI64): New. (MATCH_C_SRAI64, MASK_C_SRAI64): New. (MATCH_C_SLLI64, MASK_C_SLLI64): New. opcodes/ * riscv-opc.c (match_c_slli, match_slli_as_c_slli): New. (match_c_slli64, match_srxi_as_c_srxi): New. (riscv_opcodes) : Use match_slli_as_c_slli. : Use match_srxi_as_c_srxi. : Use match_s_slli. : New. --- gas/ChangeLog | 8 ++++++++ gas/testsuite/gas/riscv/c-zero-imm.d | 6 ++++++ gas/testsuite/gas/riscv/c-zero-imm.s | 8 ++++++++ gas/testsuite/gas/riscv/c-zero-reg.d | 2 +- gas/testsuite/gas/riscv/c-zero-reg.s | 4 +++- 5 files changed, 26 insertions(+), 2 deletions(-) (limited to 'gas') diff --git a/gas/ChangeLog b/gas/ChangeLog index 971e42a..88ab077 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,11 @@ +2018-05-08 Jim Wilson + + * testsuite/gas/riscv/c-zero-imm.d: Add more tests. + * testsuite/gas/riscv/c-zero-imm.s: Likewise. + * testsuite/gas/riscv/c-zero-reg.d: Fix typo in test. Add disabled + future test for RV128 support. + * testsuite/gas/riscv/c-zero-reg.s: Likewise. + 2018-05-07 Igor Tsimbalist H.J. Lu diff --git a/gas/testsuite/gas/riscv/c-zero-imm.d b/gas/testsuite/gas/riscv/c-zero-imm.d index c138966..97b845d 100644 --- a/gas/testsuite/gas/riscv/c-zero-imm.d +++ b/gas/testsuite/gas/riscv/c-zero-imm.d @@ -14,4 +14,10 @@ Disassembly of section .text: [ ]+8:[ ]+0001[ ]+nop [ ]+a:[ ]+00070713[ ]+mv[ ]+a4,a4 [ ]+e:[ ]+0781[ ]+addi[ ]+a5,a5,0 +[ ]+10:[ ]+00051513[ ]+slli[ ]+a0,a0,0x0 +[ ]+14:[ ]+0005d593[ ]+srli[ ]+a1,a1,0x0 +[ ]+18:[ ]+40065613[ ]+srai[ ]+a2,a2,0x0 +[ ]+1c:[ ]+0682[ ]+c.slli64[ ]+a3 +[ ]+1e:[ ]+8301[ ]+c.srli64[ ]+a4 +[ ]+20:[ ]+8781[ ]+c.srai64[ ]+a5 #... diff --git a/gas/testsuite/gas/riscv/c-zero-imm.s b/gas/testsuite/gas/riscv/c-zero-imm.s index a07baa4..b0f4710 100644 --- a/gas/testsuite/gas/riscv/c-zero-imm.s +++ b/gas/testsuite/gas/riscv/c-zero-imm.s @@ -9,3 +9,11 @@ addi a4,a4,0 # These are hints. c.addi a5,0 + # Don't let these compress to hints. + slli a0, a0, 0 + srli a1, a1, 0 + srai a2, a2, 0 + # These are hints. + c.slli64 a3 + c.srli64 a4 + c.srai64 a5 diff --git a/gas/testsuite/gas/riscv/c-zero-reg.d b/gas/testsuite/gas/riscv/c-zero-reg.d index 2daf896..02d5978 100644 --- a/gas/testsuite/gas/riscv/c-zero-reg.d +++ b/gas/testsuite/gas/riscv/c-zero-reg.d @@ -14,7 +14,7 @@ Disassembly of section .text: [ ]+8:[ ]+9006[ ]+c.add[ ]+zero,ra [ ]+a:[ ]+00500013[ ]+li[ ]+zero,5 [ ]+e:[ ]+00006037[ ]+lui[ ]+zero,0x6 -[ ]+12:[ ]+00709013[ ]+slli[ ]+zero,ra,0x7 +[ ]+12:[ ]+00701013[ ]+slli[ ]+zero,zero,0x7 [ ]+16:[ ]+00008013[ ]+mv[ ]+zero,ra [ ]+1a:[ ]+00100033[ ]+add[ ]+zero,zero,ra #... diff --git a/gas/testsuite/gas/riscv/c-zero-reg.s b/gas/testsuite/gas/riscv/c-zero-reg.s index 414c8a4..4e39030 100644 --- a/gas/testsuite/gas/riscv/c-zero-reg.s +++ b/gas/testsuite/gas/riscv/c-zero-reg.s @@ -8,6 +8,8 @@ # Don't let these compress to hints. li x0, 5 lui x0, 6 - slli x0, x1, 7 + slli x0, x0, 7 mv x0, x1 add x0, x0, x1 +# RV128 support not implemented yet. +# slli x0, x0, 64 -- cgit v1.1