]>
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 | ||
24 | # immediates: | |
3cca75a6 | 25 | %imm_i 20:s12 |
c1000d4e | 26 | %imm_s 25:s7 7:5 |
3cca75a6 BK |
27 | %imm_b 31:s1 7:1 25:6 8:4 !function=ex_shift_1 |
28 | %imm_j 31:s1 12:8 20:1 21:10 !function=ex_shift_1 | |
2a53cff4 BK |
29 | %imm_u 12:s20 !function=ex_shift_12 |
30 | ||
3cca75a6 BK |
31 | # Argument sets: |
32 | &b imm rs2 rs1 | |
33 | ||
2a53cff4 | 34 | # Formats 32: |
3cca75a6 BK |
35 | @i ............ ..... ... ..... ....... imm=%imm_i %rs1 %rd |
36 | @b ....... ..... ..... ... ..... ....... &b imm=%imm_b %rs2 %rs1 | |
c1000d4e | 37 | @s ....... ..... ..... ... ..... ....... imm=%imm_s %rs2 %rs1 |
2a53cff4 | 38 | @u .................... ..... ....... imm=%imm_u %rd |
3cca75a6 | 39 | @j .................... ..... ....... imm=%imm_j %rd |
2a53cff4 BK |
40 | |
41 | # *** RV32I Base Instruction Set *** | |
42 | lui .................... ..... 0110111 @u | |
43 | auipc .................... ..... 0010111 @u | |
3cca75a6 BK |
44 | jal .................... ..... 1101111 @j |
45 | jalr ............ ..... 000 ..... 1100111 @i | |
46 | beq ....... ..... ..... 000 ..... 1100011 @b | |
47 | bne ....... ..... ..... 001 ..... 1100011 @b | |
48 | blt ....... ..... ..... 100 ..... 1100011 @b | |
49 | bge ....... ..... ..... 101 ..... 1100011 @b | |
50 | bltu ....... ..... ..... 110 ..... 1100011 @b | |
51 | bgeu ....... ..... ..... 111 ..... 1100011 @b | |
c1000d4e BK |
52 | lb ............ ..... 000 ..... 0000011 @i |
53 | lh ............ ..... 001 ..... 0000011 @i | |
54 | lw ............ ..... 010 ..... 0000011 @i | |
55 | lbu ............ ..... 100 ..... 0000011 @i | |
56 | lhu ............ ..... 101 ..... 0000011 @i | |
57 | sb ....... ..... ..... 000 ..... 0100011 @s | |
58 | sh ....... ..... ..... 001 ..... 0100011 @s | |
59 | sw ....... ..... ..... 010 ..... 0100011 @s |