aboutsummaryrefslogtreecommitdiff
path: root/target/openrisc/insns.decode
blob: 247a2e14f21438c43875bc1a0b7593ccd741f99b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#
# OpenRISC instruction decode definitions.
#
# Copyright (c) 2018 Richard Henderson <rth@twiddle.net>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, see <http://www.gnu.org/licenses/>.
#

####
# System Instructions
####

l_sys           001000 0000000000 k:16
l_trap          001000 0100000000 k:16
l_msync         001000 1000000000 00000000 00000000
l_psync         001000 1010000000 00000000 00000000
l_csync         001000 1100000000 00000000 00000000

l_rfe		001001 ----- ----- -------- --------

####
# Branch Instructions
####

l_j             000000 n:s26
l_jal           000001 n:s26
l_bnf           000011 n:s26
l_bf            000100 n:s26

l_jr            010001 ---------- b:5 -----------
l_jalr          010010 ---------- b:5 -----------

####
# Memory Instructions
####

&load           d a i
@load           ...... d:5 a:5 i:s16                    &load

%store_i        21:s5 0:11
&store          a b i
@store          ...... ..... a:5 b:5 ...........        &store i=%store_i

l_lwa           011011 ..... ..... ........ ........    @load
l_lwz           100001 ..... ..... ........ ........    @load
l_lws           100010 ..... ..... ........ ........    @load
l_lbz           100011 ..... ..... ........ ........    @load
l_lbs           100100 ..... ..... ........ ........    @load
l_lhz           100101 ..... ..... ........ ........    @load
l_lhs           100110 ..... ..... ........ ........    @load

l_swa		110011 ..... ..... ..... ...........	@store
l_sw		110101 ..... ..... ..... ...........	@store
l_sb		110110 ..... ..... ..... ...........	@store
l_sh		110111 ..... ..... ..... ...........	@store

####
# Immediate Operand Instructions
####

%mtspr_k	21:5 0:11

&rri		d a i
&rrk		d a k
@rri		...... d:5 a:5 i:s16			&rri
@rrk		...... d:5 a:5 k:16			&rrk

l_nop		000101 01--- ----- k:16

l_addi		100111 ..... ..... ........ ........	@rri
l_addic		101000 ..... ..... ........ ........	@rri
l_andi		101001 ..... ..... ........ ........	@rrk
l_ori		101010 ..... ..... ........ ........	@rrk
l_xori		101011 ..... ..... ........ ........	@rri
l_muli		101100 ..... ..... ........ ........	@rri

l_mfspr		101101 ..... ..... ........ ........	@rrk
l_mtspr		110000 ..... a:5 b:5 ...........	k=%mtspr_k

l_maci		010011 ----- a:5 i:s16