aboutsummaryrefslogtreecommitdiff
path: root/target/arm/t16.decode
blob: 83fe4363c75bd25960807c39855f6524864f7ab2 (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
# Thumb1 instructions
#
#  Copyright (c) 2019 Linaro, Ltd
#
# 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/>.

#
# This file is processed by scripts/decodetree.py
#

&s_rrr_shi       !extern s rd rn rm shim shty
&s_rrr_shr       !extern s rn rd rm rs shty
&s_rri_rot       !extern s rn rd imm rot
&s_rrrr          !extern s rd rn rm ra
&ldst_rr         !extern p w u rn rt rm shimm shtype

# Set S if the instruction is outside of an IT block.
%s               !function=t16_setflags

# Data-processing (two low registers)

%reg_0           0:3

@lll_noshr       ...... .... rm:3 rd:3 \
                 &s_rrr_shi %s rn=%reg_0 shim=0 shty=0
@xll_noshr       ...... .... rm:3 rn:3 \
                 &s_rrr_shi s=1 rd=0 shim=0 shty=0
@lxl_shr         ...... .... rs:3 rd:3 \
                 &s_rrr_shr %s rm=%reg_0 rn=0

AND_rrri         010000 0000 ... ...            @lll_noshr
EOR_rrri         010000 0001 ... ...            @lll_noshr
MOV_rxrr         010000 0010 ... ...            @lxl_shr shty=0  # LSL
MOV_rxrr         010000 0011 ... ...            @lxl_shr shty=1  # LSR
MOV_rxrr         010000 0100 ... ...            @lxl_shr shty=2  # ASR
ADC_rrri         010000 0101 ... ...            @lll_noshr
SBC_rrri         010000 0110 ... ...            @lll_noshr
MOV_rxrr         010000 0111 ... ...            @lxl_shr shty=3  # ROR
TST_xrri         010000 1000 ... ...            @xll_noshr
RSB_rri          010000 1001 rn:3 rd:3          &s_rri_rot %s imm=0 rot=0
CMP_xrri         010000 1010 ... ...            @xll_noshr
CMN_xrri         010000 1011 ... ...            @xll_noshr
ORR_rrri         010000 1100 ... ...            @lll_noshr
MUL              010000 1101 rn:3 rd:3          &s_rrrr %s rm=%reg_0 ra=0
BIC_rrri         010000 1110 ... ...            @lll_noshr
MVN_rxri         010000 1111 ... ...            @lll_noshr

# Load/store (register offset)

@ldst_rr         ....... rm:3 rn:3 rt:3 \
                 &ldst_rr p=1 w=0 u=1 shimm=0 shtype=0

STR_rr           0101 000 ... ... ...           @ldst_rr
STRH_rr          0101 001 ... ... ...           @ldst_rr
STRB_rr          0101 010 ... ... ...           @ldst_rr
LDRSB_rr         0101 011 ... ... ...           @ldst_rr
LDR_rr           0101 100 ... ... ...           @ldst_rr
LDRH_rr          0101 101 ... ... ...           @ldst_rr
LDRB_rr          0101 110 ... ... ...           @ldst_rr
LDRSH_rr         0101 111 ... ... ...           @ldst_rr