aboutsummaryrefslogtreecommitdiff
path: root/target/ppc/insn64.decode
blob: 880ac3edc7e1c2134b442ff135d52e4b195c5cfc (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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
#
# Power ISA decode for 64-bit prefixed insns (opcode space 0 and 1)
#
# Copyright (c) 2021 Instituto de Pesquisas Eldorado (eldorado.org.br)
#
# 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.1 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/>.
#

# Format MLS:D and 8LS:D
&PLS_D          rt ra si:int64_t r:bool
%pls_si         32:s18 0:16
@PLS_D          ...... .. ... r:1 .. .................. \
                ...... rt:5 ra:5 ................       \
                &PLS_D si=%pls_si
@8LS_D_TSX      ...... .. . .. r:1 .. .................. \
                ..... rt:6 ra:5 ................         \
                &PLS_D si=%pls_si

%rt_tsxp        21:1 22:4 !function=times_2
@8LS_D_TSXP     ...... .. . .. r:1 .. .................. \
                ...... ..... ra:5 ................       \
                &PLS_D si=%pls_si rt=%rt_tsxp

### Fixed-Point Load Instructions

PLBZ            000001 10 0--.-- .................. \
                100010 ..... ..... ................     @PLS_D
PLHZ            000001 10 0--.-- .................. \
                101000 ..... ..... ................     @PLS_D
PLHA            000001 10 0--.-- .................. \
                101010 ..... ..... ................     @PLS_D
PLWZ            000001 10 0--.-- .................. \
                100000 ..... ..... ................     @PLS_D
PLWA            000001 00 0--.-- .................. \
                101001 ..... ..... ................     @PLS_D
PLD             000001 00 0--.-- .................. \
                111001 ..... ..... ................     @PLS_D
PLQ             000001 00 0--.-- .................. \
                111000 ..... ..... ................     @PLS_D

### Fixed-Point Store Instructions

PSTW            000001 10 0--.-- .................. \
                100100 ..... ..... ................     @PLS_D
PSTB            000001 10 0--.-- .................. \
                100110 ..... ..... ................     @PLS_D
PSTH            000001 10 0--.-- .................. \
                101100 ..... ..... ................     @PLS_D

PSTD            000001 00 0--.-- .................. \
                111101 ..... ..... ................     @PLS_D
PSTQ            000001 00 0--.-- .................. \
                111100 ..... ..... ................     @PLS_D

### Fixed-Point Arithmetic Instructions

PADDI           000001 10 0--.-- ..................     \
                001110 ..... ..... ................     @PLS_D

### Float-Point Load and Store Instructions

PLFS            000001 10 0--.-- .................. \
                110000 ..... ..... ................     @PLS_D
PLFD            000001 10 0--.-- .................. \
                110010 ..... ..... ................     @PLS_D
PSTFS           000001 10 0--.-- .................. \
                110100 ..... ..... ................     @PLS_D
PSTFD           000001 10 0--.-- .................. \
                110110 ..... ..... ................     @PLS_D

### Prefixed No-operation Instruction

@PNOP           000001 11 0000-- 000000000000000000     \
                ................................

{
  [
    ## Invalid suffixes: Branch instruction
    # bc[l][a]
    INVALID     ................................        \
                010000--------------------------        @PNOP
    # b[l][a]
    INVALID     ................................        \
                010010--------------------------        @PNOP
    # bclr[l]
    INVALID     ................................        \
                010011---------------0000010000-        @PNOP
    # bcctr[l]
    INVALID     ................................        \
                010011---------------1000010000-        @PNOP
    # bctar[l]
    INVALID     ................................        \
                010011---------------1000110000-        @PNOP

    ## Invalid suffixes: rfebb
    INVALID     ................................        \
                010011---------------0010010010-        @PNOP

    ## Invalid suffixes: context synchronizing other than isync
    # sc
    INVALID     ................................        \
                010001------------------------1-        @PNOP
    # scv
    INVALID     ................................        \
                010001------------------------01        @PNOP
    # rfscv
    INVALID     ................................        \
                010011---------------0001010010-        @PNOP
    # rfid
    INVALID     ................................        \
                010011---------------0000010010-        @PNOP
    # hrfid
    INVALID     ................................        \
                010011---------------0100010010-        @PNOP
    # urfid
    INVALID     ................................        \
                010011---------------0100110010-        @PNOP
    # stop
    INVALID     ................................        \
                010011---------------0101110010-        @PNOP
    # mtmsr w/ L=0
    INVALID     ................................        \
                011111---------0-----0010010010-        @PNOP
    # mtmsrd w/ L=0
    INVALID     ................................        \
                011111---------0-----0010110010-        @PNOP

    ## Invalid suffixes: Service Processor Attention
    INVALID     ................................        \
                000000----------------100000000-        @PNOP
  ]

  ## Valid suffixes
  PNOP          ................................        \
                --------------------------------        @PNOP
}

### VSX instructions

PLXV            000001 00 0--.-- .................. \
                11001 ...... ..... ................     @8LS_D_TSX
PSTXV           000001 00 0--.-- .................. \
                11011 ...... ..... ................     @8LS_D_TSX
PLXVP           000001 00 0--.-- .................. \
                111010 ..... ..... ................     @8LS_D_TSXP
PSTXVP          000001 00 0--.-- .................. \
                111110 ..... ..... ................     @8LS_D_TSXP