]>
Commit | Line | Data |
---|---|---|
1c79356b A |
1 | # @OSF_COPYRIGHT@ |
2 | # | |
3 | ||
4 | # ppc.i - PowerPC instructions | |
5 | # , | |
6 | # By Eamonn McManus <emcmanus@gr.osf.org>, 1995. | |
7 | ||
8 | # simplified mnemonics | |
9 | # ori 0,0,0 | |
10 | in 01100000000000000000000000000000 nop | |
11 | # addi[s] rD,0,value | |
12 | in 00111sddddd00000iiiiiiiiiiiiiiii li{|s}[$s] \ | |
13 | $reg($d),{$simm16($i)|$shifted16($i)}[$s] | |
14 | # or rA,rS,rS | |
15 | in 011111dddddaaaaabbbbb0110111100r {or{|.}[$r] $reg($a),$reg($b),$reg($d)|\ | |
16 | mr{|.}[$r] $reg($a),$reg($d)}[$b == $d] | |
17 | in 011111dddddaaaaabbbbb0100111100r xor{|.}[$r] $reg($a),$reg($b),$reg($d) | |
18 | ||
19 | # mtcrf 0xFF,rS | |
20 | in 011111ddddd011111111000100100000 mtcr $reg($d) | |
21 | ||
22 | in 00001Dcccccaaaaaiiiiiiiiiiiiiiii t{d|w}[$D]$tcond($c)i $reg($a),$simm16($i) | |
23 | in 000111dddddaaaaaiiiiiiiiiiiiiiii mulli $reg($d),$reg($a),$simm16($i) | |
24 | in 001000dddddaaaaaiiiiiiiiiiiiiiii subfic $reg($d),$reg($a),$simm16($i) | |
25 | in 00101Uddd0laaaaaiiiiiiiiiiiiiiii cmp{l|}[$U]i \ | |
26 | $crcom($d){|1,}[$l]$reg($a),$simm16($i) | |
27 | in 00110rdddddaaaaaiiiiiiiiiiiiiiii addic{|.}[$r] $reg($d),$reg0($a),$simm16($i) | |
28 | in 00111sdddddaaaaaiiiiiiiiiiiiiiii addi{|s}[$s] $reg($d),$reg0($a),\ | |
29 | {$simm16($i)|$shifted16($i)}[$s] | |
30 | in 010000cccccccccciiiiiiiiiiiiiial $br($c,$a,$l,,1)\ | |
31 | {$brdispl($i,14)|$brabs($i)}[$a] | |
32 | in 01000100000000000000000000000010 sc | |
33 | in 010010iiiiiiiiiiiiiiiiiiiiiiiial b{|l}[$l]{|a}[$a] \ | |
34 | {$brdispl($i,24)|$brabs($i)}[$a] | |
35 | in 010011ddd00sss000000000000000000 mcrf $crf($d),$crf($s) | |
36 | in 010011cccccccccc000000000010000l $br($c,0,$l,lr,0) | |
37 | in 010011dddddaaaaabbbbb0oooo000010 cr$crop($o) $crb($d),$crb($a),$crb($b) | |
38 | in 01001100000000000000000001100100 rfi | |
55e303ae A |
39 | in 01001100000000000000000000100100 rfid |
40 | in 01001100000000000000001000100100 hrfid | |
1c79356b A |
41 | in 01001100000000000000000100101100 isync |
42 | in 010011cccccccccc000001000010000l $br($c,0,$l,ctr,0) | |
43 | in 010111dddddaaaaabbbbbffffftttttr rlwnm{|.}[$r] \ | |
44 | $reg($a),$reg($d),$reg($b),$dec($f),$dec($t) | |
45 | in 0101xxdddddaaaaasssssffffftttttr rl{wimi|winm|?|?}[$x]{|.}[$r] \ | |
46 | $reg($a),$reg($d),$dec($s),$dec($f),$dec($t) | |
47 | in 011110dddddaaaaasssssffffff0xxSr rld{icl|icr|ic|imi}[$x]{|.}[$r] \ | |
55e303ae | 48 | $reg($a),$reg($d),$dec($[Ssssss]),$dec($f) |
1c79356b A |
49 | in 011110dddddaaaaabbbbbffffff100xr rldc{l|r}[$x]{|.}[$r] \ |
50 | $reg($a),$reg($d),$reg($b),$dec($f) | |
51 | in 011111ddd0laaaaabbbbb0000u000000 cmp{|l}[$u] \ | |
52 | $crcom($d){|1,}[$l]$reg($a),$reg($b) | |
53 | in 011111cccccaaaaabbbbb000w0001000 t{w|d}[$w]$tcond($c) $reg($a),$reg($b) | |
54 | in 011111dddddaaaaabbbbbo000C01000r subf{c|}[$C]{|o}[$o]{|.}[$r] \ | |
55 | $reg($d),$reg($a),$reg($b) | |
56 | in 011111dddddaaaaabbbbb000u0010w1r mulh{d|w}[$w]{u|}[$u]{|.}[$r] \ | |
57 | $reg($d),$reg($a),$reg($b) | |
58 | in 011111dddddaaaaabbbbbott0001010r add{c|e||?}[$t]{|o}[$o]{|.}[$r] \ | |
59 | $reg($d),$reg($a),$reg($b) | |
60 | in 011111ddddd0000000000000m0100110 mf{cr|msr}[$m] $reg($d) | |
55e303ae | 61 | in 011111ddddd0ffffffff000000100110 mfcr $hex($f),$reg($d) |
1c79356b A |
62 | in 011111dddddaaaaabbbbb000w0101000 l{w|d}[$w]arx $reg($d),$reg0($a),$reg($b) |
63 | in 011111dddddaaaaabbbbb0000u101010 ld{|u}[$u]x $reg($d),$reg0($a),$reg($b) | |
64 | in 011111dddddaaaaabbbbb0ooou101110 $ldst($o){|u}[$u]x \ | |
65 | $reg($d),$reg($a),$reg($b) | |
66 | in 011111dddddaaaaabbbbb0000011A00r {slw|and}[$A]{|.}[$r] \ | |
67 | $reg($a),$reg($d),$reg($b) | |
68 | in 011111dddddaaaaa000000000w11010r cntlz{w|d}[$w]{|.}[$r] $reg($a),$reg($d) | |
69 | in 011111dddddaaaaabbbbb0000011011r sld{|.}[$r] $reg($a),$reg($d),$reg($b) | |
70 | in 01111100000aaaaabbbbb00001101100 dcbst $reg($a),$reg($b) | |
71 | in 011111dddddaaaaabbbbb0000111100r andc{|.}[$r] $reg($a),$reg($d),$reg($b) | |
72 | in 01111100000aaaaabbbbb00010101100 dcbf $reg($a),$reg($b) | |
73 | in 011111dddddaaaaa00000o001101000r neg{|o}[$o]{|.}[$r] $reg($d),$reg($a) | |
74 | in 011111dddddaaaaabbbbb0001111100r nor{|.}[$r] $reg($a),$reg($d),$reg($b) | |
75 | in 011111dddddaaaaabbbbbo01z001000r subf{|z}[$z]e{|o}[$o]{|.}[$r] \ | |
76 | $reg($d),$reg($a) | |
77 | in 011111ddddd0ffffffff000100100m00 mt{crf $hex($f),|msr}[$m] $reg($d) | |
55e303ae | 78 | in 011111ddddd000000000000101100100 mtmsrd $reg($d) |
1c79356b A |
79 | in 011111sssssaaaaabbbbb0010u101010 std{|u}[$u]x $reg($s),$reg0($a),$reg($b) |
80 | in 011111sssssaaaaabbbbb001w0101101 st{w|d}[$w]cx. $reg($s),$reg0($a),$reg($b) | |
81 | in 011111dddddaaaaa00000o011001010r addze{|o}[$o]{|.}[$r] $reg($d),$reg($a) | |
82 | in 011111sssss0rrrr0000000110100100 mtsr $dec($r),$reg($s) | |
83 | in 011111dddddaaaaa00000o0111010x0r {subf|add}[$x]me{|o}[$o]{|.}[$r] \ | |
84 | $reg($d),$reg($a) | |
85 | in 011111dddddaaaaabbbbbo0111010w1r mull{w|d}[$w]{|o}[$o]{|.}[$r] \ | |
86 | $reg($d),$reg($a),$reg($b) | |
87 | in 011111sssss00000bbbbb00111100100 mtsrin $reg($s),$reg($b) | |
88 | in 01111100000aaaaabbbbb00111101100 dcbtst $reg0($a),$reg($b) | |
89 | in 01111100000aaaaabbbbb01000101100 dcbt $reg0($a),$reg($b) | |
90 | in 011111sssssaaaaabbbbb0100011100r eqv{|.}[$r] $reg($a),$reg($s),$reg($b) | |
91 | in 0111110000000000bbbbb01001100100 tlbie $reg($b) | |
92 | in 011111dddddaaaaabbbbb01i01101100 ec{i|o}[$i]wx $reg($d),$reg0($a),$reg($b) | |
93 | in 011111dddddrrrrrrrrrr01t10100110 m{f|t}[$t]spr $reg($d),$spr($r) | |
94 | in 011111dddddaaaaabbbbb0101u101010 lwa{|u}[$u]x $reg($d),$reg($a),$reg($b) | |
95 | in 01111100000000000000001011100100 tlbia | |
96 | in 011111dddddtttttttttt01011100110 mftb $reg($d),$dec($t) | |
97 | in 011111sssssaaaaabbbbb0110011100r orc{|.}[$r] $reg($a),$reg($s),$reg($b) | |
98 | in 0111110000000000bbbbb01101100100 slbie $reg($b) | |
99 | in 011111dddddaaaaabbbbbo111u010w1r div{d|w}[$w]{u|}[$u]{|o}[$o]{|.}[$r] \ | |
100 | $reg($d),$reg($a),$reg($b) | |
101 | in 01111100000aaaaabbbbb01110101100 dcbi $reg0($a),$reg($b) | |
102 | in 011111sssssaaaaabbbbb0111011100r nand{|.}[$r] $reg($a),$reg($s),$reg($b) | |
103 | in 01111100000000000000001111100100 slbia | |
55e303ae A |
104 | in 011111ddddd00000bbbbb01100100100 slbmte $reg($d),$reg($b) |
105 | in 011111ddddd00000bbbbb11010100110 slbmfev $reg($d),$reg($b) | |
106 | in 011111ddddd00000bbbbb11100100110 slbmfee $reg($d),$reg($b) | |
1c79356b A |
107 | in 011111ddd00000000000010000000000 mcrxr $crf($d) |
108 | in 011111dddddaaaaabbbbb10000101010 lswx $reg($d),$reg0($a),$reg($b) | |
109 | in 011111dddddaaaaabbbbb1w000101100 l{w|h}[$w]brx $reg($d),$reg0($a),$reg($b) | |
110 | in 011111dddddaaaaabbbbb100su101110 lf{s|d}[$s]{|u}[$u]x \ | |
111 | $fr($d),$reg0($a),$reg($b) | |
112 | in 011111sssssaaaaabbbbb1x000110w0r sr{|a}[$x]{w|d}[$w]{|.}[$r] \ | |
113 | $reg($a),$reg($s),$reg($b) | |
114 | in 011111sssssaaaaabbbbb1000011011r srd{|.}[$r] $reg($a),$reg($s),$reg($b) | |
115 | in 01111100000000000000010001101100 tlbsync | |
116 | in 011111ddddd0rrrr0000010010101100 mfsr $reg($d),$dec($r) | |
117 | in 011111dddddaaaaannnnn10010101010 lswi $reg($d),$reg0($a),$dec($n) | |
55e303ae | 118 | in 011111000ll000000000010010101100 {sync|?|ptesync|?}[$l] |
1c79356b A |
119 | in 011111ddddd00000bbbbb10100100110 mfsrin $reg($d),$reg($b) |
120 | in 011111sssssaaaaabbbbb10100101010 stswx $reg($s),$reg0($a),$reg($b) | |
121 | in 011111sssssaaaaabbbbb1w100101100 st{w|h}[$w]brx $reg($s),$reg0($a),$reg($b) | |
122 | in 011111sssssaaaaabbbbb101du101110 stf{s|d}[$d]{|u}[$u]x \ | |
123 | $fr($s),{$reg0($a)|$reg($a)}[$u],$reg($b) | |
124 | in 011111sssssaaaaannnnn10110101010 stswi $reg($s),$reg0($a),$dec($n) | |
55e303ae A |
125 | in 011111dddddaaaaasssss1100111000r srawi{|.}[$r] $reg($a),$reg($d),$dec($s) |
126 | in 011111dddddaaaaasssss110011101Sr sradi{|.}[$r] $reg($a),$reg($d),$dec($[Ssssss]) | |
1c79356b | 127 | in 01111100000000000000011010101100 eieio |
55e303ae | 128 | in 00000000000000000000001000000000 attn |
1c79356b A |
129 | in 011111sssssaaaaa00000111xx11010r exts{h|b|w|?}[$x]{|.}[$r] $reg($a),$reg($s) |
130 | in 01111100000aaaaabbbbb11110101100 icbi $reg0($a),$reg($b) | |
131 | in 011111sssssaaaaabbbbb11110101110 stfiwx $fr($s),$reg0($a),$reg($b) | |
132 | in 01111100000aaaaabbbbb11111101100 dcbz $reg0($a),$reg($b) | |
133 | in 011Axsaaaaadddddiiiiiiiiiiiiiiii {{|x}[$x]or|{and|?}[$x]}[$A]i{|s}[$s]\ | |
134 | {|.}[$A] $reg($d),$reg($a),\ | |
135 | {$hex($i)|$shifted16($i)}[$s] | |
136 | # Grouping andi with xori and ori may not be such a brilliant idea, since it | |
137 | # gets invoked as a catch-all for the 011111 instructions below. But that | |
138 | # just means that we get a different sort of undefined instruction. | |
139 | in 10111sdddddaaaaaiiiiiiiiiiiiiiii {l|st}[$s]mw \ | |
140 | $reg($d),$simm16($i)($reg0($a)) | |
141 | in 10oooudddddaaaaaiiiiiiiiiiiiiiii $ldst($o){|u}[$u] \ | |
142 | $reg($d),$simm16($i)($reg0($a)) | |
143 | in 110sDudddddaaaaaiiiiiiiiiiiiiiii {l|st}[$s]f{s|d}[$D]{|u}[$u] \ | |
144 | $fr($d),$simm16($i)($reg0($a)) | |
145 | in 111010dddddaaaaaiiiiiiiiiiiiiixy l{d{|u}[$y]|{|?}[$y]w}[$x] \ | |
146 | $reg($d),$simm16($i)($reg0($a)) | |
147 | in 111s11dddddaaaaabbbbb0000010010r fdiv{s|}[$s]{|.}[$r] \ | |
148 | $fr($d),$fr($a),$fr($b) | |
149 | in 111s11dddddaaaaabbbbb000001010xr f{sub|add}[$x]{s|}[$s]{|.}[$r] \ | |
150 | $fr($d),$fr($a),$fr($b) | |
151 | in 111s11ddddd00000bbbbb0000010110r fsqrt{s|}[$s]{|.}[$r] $fr($d),$fr($b) | |
152 | in 111011ddddd00000bbbbb0000011000r fress{|.}[$r] $fr($d),$fr($b) | |
153 | in 111s11dddddaaaaa00000ccccc11001r fmul{s|}[$s]{|.}[$r] \ | |
154 | $fr($d),$fr($a),$fr($c) | |
155 | in 111s11dddddaaaaabbbbbccccc111nxr f{|n}[$n]m{sub|add}[$x]{s|}[$s]{|.}[$r] \ | |
156 | $fr($d),$fr($a),$fr($c),$fr($b) | |
157 | in 111110sssssaaaaaiiiiiiiiiiiiii0u std{|u}[$u] \ | |
158 | $reg($s),$simm16($i)({$reg0($a)|$reg($a)}[$u]) | |
159 | in 111111ccc00aaaaabbbbb0000o000000 fcmp{u|o}[$o] $crf($c),$fr($a),$fr($b) | |
160 | in 111111ddddd00000bbbbb0000001100r frsp{|.}[$r] $fr($d),$fr($b) | |
161 | in 111111ddddd00000bbbbb000000111zr fctiw{|z}[$z]{|.}[$r] $fr($d),$fr($b) | |
162 | in 111111dddddaaaaabbbbbccccc10111r fsel{|.}[$r] \ | |
163 | $fr($d),$fr($a),$fr($c),$fr($b) | |
164 | in 111111ddddd00000bbbbb0000011010r frsqrte{|,.}[$r] $fr($d),$fr($b) | |
165 | in 111111ddddd0000000000000xx00110r mtfsb{?|1|0|?}[$x]{|.}[$r] $fcond($d) | |
166 | in 111111ddddd00000bbbbb0000101000r fneg{|.}[$r] $fr($d),$fr($b) | |
167 | in 111111ddd00sss000000000010000000 mcrfs $crf($d),$crf($s) | |
168 | in 111111ddddd00000bbbbb0001001000r fmr{|.}[$r] $fr($d),$fr($b) | |
169 | in 111111ddd0000000iiii00010000110r mtfsfi{|.}[$r] $crf($d),$simm16($i) | |
170 | in 111111ddddd00000bbbbb0010001000r fnabs{|.}[$r] $fr($d),$fr($b) | |
171 | in 111111ddddd00000bbbbb0100001000r fabs{|.}[$r] $fr($d),$fr($b) | |
172 | in 111111ddddd00000000001001000111r mffs{|.}[$r] $fr($d) | |
173 | in 1111110ffffffff0bbbbb1011000111r mtfsf{|.}[$r] $hex($f),$fr($b) | |
174 | in 111111ddddd00000bbbbb110010111zr fctid{|z}[$z]{|.}[$r] $fr($d),$fr($b) | |
175 | in 111111ddddd00000bbbbb1101001110r fcfid{|.}[$r] $fr($d),$fr($b) | |
176 | ||
177 | in xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ? | |
178 | ||
179 | ||
180 | ldst ooo {lwz|lbz|stw|stb|lhz|lha|sth|?}[$o] | |
181 | br utdzyrrrcc(%a,%l,s,%C) b{d{nz|z}[$z]|{|?}[$z]}[$d]{c|}[$u]\ | |
182 | {|l}[$l]{|a}[$a]$s \ | |
183 | {$crcom($r)$cond($[cct]){|,}[$C]|}[$u] | |
184 | cond ccc {ge|lt|le|gt|ne|eq|ns|so}[$c] | |
185 | fcond ccc $hex($c) | |
186 | crb rrrcc $cr($r):$cond($[cc1]) | |
187 | crop oooo {?|nor|?|?|andc|?|xor|nand|and|eqv|?|?|?|orc|or|?}[$o] | |
188 | tcond ccccc {?|lgt|llt|?|eq|lge|lle|?|?|?|?|?|ge|?|?|?|lt|?|?|?|le|?|?|?|ne|?|?|?|?|?|?|a}[$c] | |
189 | ||
190 | spr 0000000000 mq | |
191 | spr 0000100000 xer | |
192 | spr 0010l00000 rtc{u|l}[$l] | |
193 | spr s011000000 dec{u|s}[$s] | |
194 | spr 0100000000 lr | |
195 | spr 0100100000 ctr | |
196 | spr 1001000000 dsisr | |
197 | spr 1001100000 dar | |
198 | spr 1100100000 sdr1 | |
199 | spr 1101n00000 srr$dec($n) | |
200 | spr 100nn01000 sprg$dec($n) | |
201 | spr 1101001000 ear | |
202 | spr 1101101000 pvr | |
203 | spr 10nnl10000 ibat$dec($n){u|l}[$l] | |
204 | spr 1000n11111 hid$dec($n) | |
205 | spr 1001011111 iabr | |
206 | spr 1010111111 dabr | |
207 | spr 1111111111 pir | |
55e303ae A |
208 | spr 0000110000 hspr0 |
209 | spr 0000110001 hspr1 | |
210 | spr 0000110110 hdec0 | |
211 | spr 0000111010 hsrr0 | |
212 | spr 0000111011 hsrr1 | |
1c79356b A |
213 | spr xxxxxxxxxx ? |
214 | ||
215 | reg0 00000 0 | |
216 | reg0 nnnnn $reg($n) | |
217 | ||
218 | reg (%n) r$dec($n) | |
219 | fr (%n) fr$dec($n) | |
220 | cr (%n) cr$dec($n) | |
221 | crf (%n) crf$dec($n) | |
222 | crcom 000 | |
223 | crcom nnn $cr($n), | |
224 | ||
225 | simm16 snnnnnnnnnnnnnnn {$hex($n)|-$hex((1 << 15) - $n)}[$s] | |
226 | ||
227 | shifted16 (%n) $hex($n << 16) | |
228 | ||
229 | brabs (%n) $hex($n << 2) | |
230 | ||
231 | hex (%n) : | |
232 | dec (%n) : | |
233 | mbz (%n) : | |
234 | brdispl (%d,%n) : |