]> git.proxmox.com Git - mirror_qemu.git/blame - target/riscv/insn32.decode
target/riscv: Convert RVXI fence insns to decodetree
[mirror_qemu.git] / target / riscv / insn32.decode
CommitLineData
2a53cff4
BK
1#
2# RISC-V translation routines for the RVXI Base Integer Instruction Set.
3#
4# Copyright (c) 2018 Peer Adelt, peer.adelt@hni.uni-paderborn.de
5# Bastian Koppelmann, kbastian@mail.uni-paderborn.de
6#
7# This program is free software; you can redistribute it and/or modify it
8# under the terms and conditions of the GNU General Public License,
9# version 2 or later, as published by the Free Software Foundation.
10#
11# This program is distributed in the hope it will be useful, but WITHOUT
12# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14# more details.
15#
16# You should have received a copy of the GNU General Public License along with
17# this program. If not, see <http://www.gnu.org/licenses/>.
18
19# Fields:
3cca75a6
BK
20%rs2 20:5
21%rs1 15:5
2a53cff4
BK
22%rd 7:5
23
b73a987b
BK
24%sh10 20:10
25
2a53cff4 26# immediates:
3cca75a6 27%imm_i 20:s12
c1000d4e 28%imm_s 25:s7 7:5
3cca75a6
BK
29%imm_b 31:s1 7:1 25:6 8:4 !function=ex_shift_1
30%imm_j 31:s1 12:8 20:1 21:10 !function=ex_shift_1
2a53cff4
BK
31%imm_u 12:s20 !function=ex_shift_12
32
3cca75a6
BK
33# Argument sets:
34&b imm rs2 rs1
b73a987b 35&shift shamt rs1 rd
3cca75a6 36
2a53cff4 37# Formats 32:
b73a987b 38@r ....... ..... ..... ... ..... ....... %rs2 %rs1 %rd
3cca75a6
BK
39@i ............ ..... ... ..... ....... imm=%imm_i %rs1 %rd
40@b ....... ..... ..... ... ..... ....... &b imm=%imm_b %rs2 %rs1
c1000d4e 41@s ....... ..... ..... ... ..... ....... imm=%imm_s %rs2 %rs1
2a53cff4 42@u .................... ..... ....... imm=%imm_u %rd
3cca75a6 43@j .................... ..... ....... imm=%imm_j %rd
2a53cff4 44
b73a987b
BK
45@sh ...... ...... ..... ... ..... ....... &shift shamt=%sh10 %rs1 %rd
46
2a53cff4
BK
47# *** RV32I Base Instruction Set ***
48lui .................... ..... 0110111 @u
49auipc .................... ..... 0010111 @u
3cca75a6
BK
50jal .................... ..... 1101111 @j
51jalr ............ ..... 000 ..... 1100111 @i
52beq ....... ..... ..... 000 ..... 1100011 @b
53bne ....... ..... ..... 001 ..... 1100011 @b
54blt ....... ..... ..... 100 ..... 1100011 @b
55bge ....... ..... ..... 101 ..... 1100011 @b
56bltu ....... ..... ..... 110 ..... 1100011 @b
57bgeu ....... ..... ..... 111 ..... 1100011 @b
c1000d4e
BK
58lb ............ ..... 000 ..... 0000011 @i
59lh ............ ..... 001 ..... 0000011 @i
60lw ............ ..... 010 ..... 0000011 @i
61lbu ............ ..... 100 ..... 0000011 @i
62lhu ............ ..... 101 ..... 0000011 @i
63sb ....... ..... ..... 000 ..... 0100011 @s
64sh ....... ..... ..... 001 ..... 0100011 @s
65sw ....... ..... ..... 010 ..... 0100011 @s
b73a987b
BK
66addi ............ ..... 000 ..... 0010011 @i
67slti ............ ..... 010 ..... 0010011 @i
68sltiu ............ ..... 011 ..... 0010011 @i
69xori ............ ..... 100 ..... 0010011 @i
70ori ............ ..... 110 ..... 0010011 @i
71andi ............ ..... 111 ..... 0010011 @i
72slli 00.... ...... ..... 001 ..... 0010011 @sh
73srli 00.... ...... ..... 101 ..... 0010011 @sh
74srai 01.... ...... ..... 101 ..... 0010011 @sh
75add 0000000 ..... ..... 000 ..... 0110011 @r
76sub 0100000 ..... ..... 000 ..... 0110011 @r
77sll 0000000 ..... ..... 001 ..... 0110011 @r
78slt 0000000 ..... ..... 010 ..... 0110011 @r
79sltu 0000000 ..... ..... 011 ..... 0110011 @r
80xor 0000000 ..... ..... 100 ..... 0110011 @r
81srl 0000000 ..... ..... 101 ..... 0110011 @r
82sra 0100000 ..... ..... 101 ..... 0110011 @r
83or 0000000 ..... ..... 110 ..... 0110011 @r
84and 0000000 ..... ..... 111 ..... 0110011 @r
0c865e85
BK
85fence ---- pred:4 succ:4 ----- 000 ----- 0001111
86fence_i ---- ---- ---- ----- 001 ----- 0001111