]>
Commit | Line | Data |
---|---|---|
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 *** |
48 | lui .................... ..... 0110111 @u | |
49 | auipc .................... ..... 0010111 @u | |
3cca75a6 BK |
50 | jal .................... ..... 1101111 @j |
51 | jalr ............ ..... 000 ..... 1100111 @i | |
52 | beq ....... ..... ..... 000 ..... 1100011 @b | |
53 | bne ....... ..... ..... 001 ..... 1100011 @b | |
54 | blt ....... ..... ..... 100 ..... 1100011 @b | |
55 | bge ....... ..... ..... 101 ..... 1100011 @b | |
56 | bltu ....... ..... ..... 110 ..... 1100011 @b | |
57 | bgeu ....... ..... ..... 111 ..... 1100011 @b | |
c1000d4e BK |
58 | lb ............ ..... 000 ..... 0000011 @i |
59 | lh ............ ..... 001 ..... 0000011 @i | |
60 | lw ............ ..... 010 ..... 0000011 @i | |
61 | lbu ............ ..... 100 ..... 0000011 @i | |
62 | lhu ............ ..... 101 ..... 0000011 @i | |
63 | sb ....... ..... ..... 000 ..... 0100011 @s | |
64 | sh ....... ..... ..... 001 ..... 0100011 @s | |
65 | sw ....... ..... ..... 010 ..... 0100011 @s | |
b73a987b BK |
66 | addi ............ ..... 000 ..... 0010011 @i |
67 | slti ............ ..... 010 ..... 0010011 @i | |
68 | sltiu ............ ..... 011 ..... 0010011 @i | |
69 | xori ............ ..... 100 ..... 0010011 @i | |
70 | ori ............ ..... 110 ..... 0010011 @i | |
71 | andi ............ ..... 111 ..... 0010011 @i | |
72 | slli 00.... ...... ..... 001 ..... 0010011 @sh | |
73 | srli 00.... ...... ..... 101 ..... 0010011 @sh | |
74 | srai 01.... ...... ..... 101 ..... 0010011 @sh | |
75 | add 0000000 ..... ..... 000 ..... 0110011 @r | |
76 | sub 0100000 ..... ..... 000 ..... 0110011 @r | |
77 | sll 0000000 ..... ..... 001 ..... 0110011 @r | |
78 | slt 0000000 ..... ..... 010 ..... 0110011 @r | |
79 | sltu 0000000 ..... ..... 011 ..... 0110011 @r | |
80 | xor 0000000 ..... ..... 100 ..... 0110011 @r | |
81 | srl 0000000 ..... ..... 101 ..... 0110011 @r | |
82 | sra 0100000 ..... ..... 101 ..... 0110011 @r | |
83 | or 0000000 ..... ..... 110 ..... 0110011 @r | |
84 | and 0000000 ..... ..... 111 ..... 0110011 @r | |
0c865e85 BK |
85 | fence ---- pred:4 succ:4 ----- 000 ----- 0001111 |
86 | fence_i ---- ---- ---- ----- 001 ----- 0001111 |