]>
Commit | Line | Data |
---|---|---|
44d1432b RH |
1 | # |
2 | # MicroBlaze instruction decode definitions. | |
3 | # | |
4 | # Copyright (c) 2020 Richard Henderson <rth@twiddle.net> | |
5 | # | |
6 | # This library is free software; you can redistribute it and/or | |
7 | # modify it under the terms of the GNU Lesser General Public | |
8 | # License as published by the Free Software Foundation; either | |
9 | # version 2.1 of the License, or (at your option) any later version. | |
10 | # | |
11 | # This library is distributed in the hope that it will be useful, | |
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 | # Lesser General Public License for more details. | |
15 | # | |
16 | # You should have received a copy of the GNU Lesser General Public | |
17 | # License along with this library; if not, see <http://www.gnu.org/licenses/>. | |
18 | # | |
20800179 | 19 | |
39cf3864 | 20 | &typea0 rd ra |
20800179 RH |
21 | &typea rd ra rb |
22 | &typeb rd ra imm | |
23 | ||
24 | # Include any IMM prefix in the value reported. | |
25 | %extimm 0:s16 !function=typeb_imm | |
26 | ||
27 | @typea ...... rd:5 ra:5 rb:5 ... .... .... &typea | |
28 | @typeb ...... rd:5 ra:5 ................ &typeb imm=%extimm | |
29 | ||
39cf3864 RH |
30 | # Officially typea, but with rb==0, which is not used. |
31 | @typea0 ...... rd:5 ra:5 ................ &typea0 | |
32 | ||
081d8e02 RH |
33 | # Officially typeb, but any immediate extension is unused. |
34 | @typeb_bs ...... rd:5 ra:5 ..... ...... imm:5 &typeb | |
35 | ||
36 | # For convenience, extract the two imm_w/imm_s fields, then pack | |
37 | # them back together as "imm". Doing this makes it easiest to | |
38 | # match the required zero at bit 5. | |
39 | %ieimm 6:5 0:5 | |
40 | @typeb_ie ...... rd:5 ra:5 ..... ..... . ..... &typeb imm=%ieimm | |
41 | ||
20800179 RH |
42 | ### |
43 | ||
44 | { | |
45 | zero 000000 00000 00000 00000 000 0000 0000 | |
46 | add 000000 ..... ..... ..... 000 0000 0000 @typea | |
47 | } | |
48 | addc 000010 ..... ..... ..... 000 0000 0000 @typea | |
49 | addk 000100 ..... ..... ..... 000 0000 0000 @typea | |
50 | addkc 000110 ..... ..... ..... 000 0000 0000 @typea | |
51 | ||
52 | addi 001000 ..... ..... ................ @typeb | |
53 | addic 001010 ..... ..... ................ @typeb | |
54 | addik 001100 ..... ..... ................ @typeb | |
55 | addikc 001110 ..... ..... ................ @typeb | |
a2b0b90e | 56 | |
cb0a0a4c RH |
57 | and 100001 ..... ..... ..... 000 0000 0000 @typea |
58 | andi 101001 ..... ..... ................ @typeb | |
59 | ||
60 | andn 100011 ..... ..... ..... 000 0000 0000 @typea | |
61 | andni 101011 ..... ..... ................ @typeb | |
62 | ||
081d8e02 RH |
63 | bsrl 010001 ..... ..... ..... 000 0000 0000 @typea |
64 | bsra 010001 ..... ..... ..... 010 0000 0000 @typea | |
65 | bsll 010001 ..... ..... ..... 100 0000 0000 @typea | |
66 | ||
67 | bsrli 011001 ..... ..... 00000 000000 ..... @typeb_bs | |
68 | bsrai 011001 ..... ..... 00000 010000 ..... @typeb_bs | |
69 | bslli 011001 ..... ..... 00000 100000 ..... @typeb_bs | |
70 | ||
71 | bsefi 011001 ..... ..... 01000 .....0 ..... @typeb_ie | |
72 | bsifi 011001 ..... ..... 10000 .....0 ..... @typeb_ie | |
73 | ||
39cf3864 RH |
74 | clz 100100 ..... ..... 00000 000 1110 0000 @typea0 |
75 | ||
a2b0b90e RH |
76 | cmp 000101 ..... ..... ..... 000 0000 0001 @typea |
77 | cmpu 000101 ..... ..... ..... 000 0000 0011 @typea | |
78 | ||
d5aead3d RH |
79 | fadd 010110 ..... ..... ..... 0000 000 0000 @typea |
80 | frsub 010110 ..... ..... ..... 0001 000 0000 @typea | |
81 | fmul 010110 ..... ..... ..... 0010 000 0000 @typea | |
82 | fdiv 010110 ..... ..... ..... 0011 000 0000 @typea | |
83 | fcmp_un 010110 ..... ..... ..... 0100 000 0000 @typea | |
84 | fcmp_lt 010110 ..... ..... ..... 0100 001 0000 @typea | |
85 | fcmp_eq 010110 ..... ..... ..... 0100 010 0000 @typea | |
86 | fcmp_le 010110 ..... ..... ..... 0100 011 0000 @typea | |
87 | fcmp_gt 010110 ..... ..... ..... 0100 100 0000 @typea | |
88 | fcmp_ne 010110 ..... ..... ..... 0100 101 0000 @typea | |
89 | fcmp_ge 010110 ..... ..... ..... 0100 110 0000 @typea | |
90 | ||
91 | # Note that flt and fint, unlike fsqrt, are documented as having the RB | |
92 | # operand which is unused. So allow the field to be non-zero but discard | |
93 | # the value and treat as 2-operand insns. | |
94 | flt 010110 ..... ..... ----- 0101 000 0000 @typea0 | |
95 | fint 010110 ..... ..... ----- 0110 000 0000 @typea0 | |
96 | fsqrt 010110 ..... ..... 00000 0111 000 0000 @typea0 | |
97 | ||
b1354342 RH |
98 | idiv 010010 ..... ..... ..... 000 0000 0000 @typea |
99 | idivu 010010 ..... ..... ..... 000 0000 0010 @typea | |
100 | ||
e64b2e5c RH |
101 | imm 101100 00000 00000 imm:16 |
102 | ||
97955ceb RH |
103 | mul 010000 ..... ..... ..... 000 0000 0000 @typea |
104 | mulh 010000 ..... ..... ..... 000 0000 0001 @typea | |
105 | mulhu 010000 ..... ..... ..... 000 0000 0011 @typea | |
106 | mulhsu 010000 ..... ..... ..... 000 0000 0010 @typea | |
107 | muli 011000 ..... ..... ................ @typeb | |
108 | ||
cb0a0a4c RH |
109 | or 100000 ..... ..... ..... 000 0000 0000 @typea |
110 | ori 101000 ..... ..... ................ @typeb | |
111 | ||
607f5767 RH |
112 | pcmpbf 100000 ..... ..... ..... 100 0000 0000 @typea |
113 | pcmpeq 100010 ..... ..... ..... 100 0000 0000 @typea | |
114 | pcmpne 100011 ..... ..... ..... 100 0000 0000 @typea | |
115 | ||
a2b0b90e RH |
116 | rsub 000001 ..... ..... ..... 000 0000 0000 @typea |
117 | rsubc 000011 ..... ..... ..... 000 0000 0000 @typea | |
118 | rsubk 000101 ..... ..... ..... 000 0000 0000 @typea | |
119 | rsubkc 000111 ..... ..... ..... 000 0000 0000 @typea | |
120 | ||
121 | rsubi 001001 ..... ..... ................ @typeb | |
122 | rsubic 001011 ..... ..... ................ @typeb | |
123 | rsubik 001101 ..... ..... ................ @typeb | |
124 | rsubikc 001111 ..... ..... ................ @typeb | |
cb0a0a4c | 125 | |
39cf3864 RH |
126 | sext8 100100 ..... ..... 00000 000 0110 0000 @typea0 |
127 | sext16 100100 ..... ..... 00000 000 0110 0001 @typea0 | |
128 | ||
129 | sra 100100 ..... ..... 00000 000 0000 0001 @typea0 | |
130 | src 100100 ..... ..... 00000 000 0010 0001 @typea0 | |
131 | srl 100100 ..... ..... 00000 000 0100 0001 @typea0 | |
132 | ||
133 | swapb 100100 ..... ..... 00000 001 1110 0000 @typea0 | |
134 | swaph 100100 ..... ..... 00000 001 1110 0010 @typea0 | |
135 | ||
136 | # Cache operations have no effect in qemu: discard the arguments. | |
137 | wdic 100100 00000 ----- ----- -00 -11- 01-0 # wdc | |
138 | wdic 100100 00000 ----- ----- 000 0110 1000 # wic | |
139 | ||
cb0a0a4c RH |
140 | xor 100010 ..... ..... ..... 000 0000 0000 @typea |
141 | xori 101010 ..... ..... ................ @typeb |