From 64a336ac134ebd7f9452a7088e90e29551465251 Mon Sep 17 00:00:00 2001 From: Palmer Dabbelt Date: Tue, 2 Oct 2018 08:26:32 -0700 Subject: RISC-V: Add fence.tso instruction The RISC-V memory model has been ratified, and it includes an additional fence: "fence.tso". This pseudo instruction extends one of the previously reserved full fence patterns to be less restrictive, and therefor will execute correctly on all existing microarchitectures. Thus there is no reason to allow this instruction to be disabled (or unconverted to a full fence), so it's just unconditionally allowed. I've added a test case for GAS to check that "fence.tso" correctly assembles on rv32i-based targets. I checked to see that "fence.tso" appears in "gas.log", but that's the only testing I've done. gas/ChangeLog 2018-10-02 Palmer Dabbelt * testsuite/gas/riscv/fence-tso.d: New file. * testsuite/gas/riscv/fence-tso.s: Likewise. include/ChangeLog 2018-10-02 Palmer Dabbelt * opcode/riscv-opc.h (MATCH_FENCE_TSO): New define. (MASK_FENCE_TSO): Likewise. opcodes/ChangeLog 2018-10-02 Palmer Dabbelt * riscv-opc.c (riscv_opcodes) : New opcode. --- gas/ChangeLog | 5 +++++ gas/testsuite/gas/riscv/fence-tso.d | 11 +++++++++++ gas/testsuite/gas/riscv/fence-tso.s | 2 ++ 3 files changed, 18 insertions(+) create mode 100644 gas/testsuite/gas/riscv/fence-tso.d create mode 100644 gas/testsuite/gas/riscv/fence-tso.s (limited to 'gas') diff --git a/gas/ChangeLog b/gas/ChangeLog index 069f9cb..d6a4380 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2018-10-02 Palmer Dabbelt + + * testsuite/gas/riscv/fence-tso.d: New file. + * testsuite/gas/riscv/fence-tso.s: Likewise. + 2018-09-26 Sandra Loosemore * testsuite/gas/all/gas.exp: Skip "Output file must be distinct diff --git a/gas/testsuite/gas/riscv/fence-tso.d b/gas/testsuite/gas/riscv/fence-tso.d new file mode 100644 index 0000000..ef8a4cd --- /dev/null +++ b/gas/testsuite/gas/riscv/fence-tso.d @@ -0,0 +1,11 @@ +#as: -march=rv32ic +#objdump: -dr + +.*:[ ]+file format .* + + +Disassembly of section .text: + +0+000 : +[ ]+0:[ ]+8330000f[ ]+fence.tso + diff --git a/gas/testsuite/gas/riscv/fence-tso.s b/gas/testsuite/gas/riscv/fence-tso.s new file mode 100644 index 0000000..7770052 --- /dev/null +++ b/gas/testsuite/gas/riscv/fence-tso.s @@ -0,0 +1,2 @@ +target: + fence.tso -- cgit v1.1