4 # ppc.i - PowerPC instructions
6 # By Eamonn McManus <emcmanus@gr.osf.org>, 1995.
10 in 01100000000000000000000000000000 nop
12 in 00111sddddd00000iiiiiiiiiiiiiiii li{|s}[$s] \
13 $reg($d),{$simm16($i)|$shifted16($i)}[$s]
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)
20 in 011111ddddd011111111000100100000 mtcr $reg($d)
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
39 in 01001100000000000000000100101100 isync
40 in 010011cccccccccc000001000010000l $br($c,0,$l,ctr,0)
41 in 010111dddddaaaaabbbbbffffftttttr rlwnm{|.}[$r] \
42 $reg($a),$reg($d),$reg($b),$dec($f),$dec($t)
43 in 0101xxdddddaaaaasssssffffftttttr rl{wimi|winm|?|?}[$x]{|.}[$r] \
44 $reg($a),$reg($d),$dec($s),$dec($f),$dec($t)
45 in 011110dddddaaaaasssssffffff0xxSr rld{icl|icr|ic|imi}[$x]{|.}[$r] \
46 $reg($a),$reg($d),$dec($[sssssS]),$dec($f)
47 in 011110dddddaaaaabbbbbffffff100xr rldc{l|r}[$x]{|.}[$r] \
48 $reg($a),$reg($d),$reg($b),$dec($f)
49 in 011111ddd0laaaaabbbbb0000u000000 cmp{|l}[$u] \
50 $crcom($d){|1,}[$l]$reg($a),$reg($b)
51 in 011111cccccaaaaabbbbb000w0001000 t{w|d}[$w]$tcond($c) $reg($a),$reg($b)
52 in 011111dddddaaaaabbbbbo000C01000r subf{c|}[$C]{|o}[$o]{|.}[$r] \
53 $reg($d),$reg($a),$reg($b)
54 in 011111dddddaaaaabbbbb000u0010w1r mulh{d|w}[$w]{u|}[$u]{|.}[$r] \
55 $reg($d),$reg($a),$reg($b)
56 in 011111dddddaaaaabbbbbott0001010r add{c|e||?}[$t]{|o}[$o]{|.}[$r] \
57 $reg($d),$reg($a),$reg($b)
58 in 011111ddddd0000000000000m0100110 mf{cr|msr}[$m] $reg($d)
59 in 011111dddddaaaaabbbbb000w0101000 l{w|d}[$w]arx $reg($d),$reg0($a),$reg($b)
60 in 011111dddddaaaaabbbbb0000u101010 ld{|u}[$u]x $reg($d),$reg0($a),$reg($b)
61 in 011111dddddaaaaabbbbb0ooou101110 $ldst($o){|u}[$u]x \
62 $reg($d),$reg($a),$reg($b)
63 in 011111dddddaaaaabbbbb0000011A00r {slw|and}[$A]{|.}[$r] \
64 $reg($a),$reg($d),$reg($b)
65 in 011111dddddaaaaa000000000w11010r cntlz{w|d}[$w]{|.}[$r] $reg($a),$reg($d)
66 in 011111dddddaaaaabbbbb0000011011r sld{|.}[$r] $reg($a),$reg($d),$reg($b)
67 in 01111100000aaaaabbbbb00001101100 dcbst $reg($a),$reg($b)
68 in 011111dddddaaaaabbbbb0000111100r andc{|.}[$r] $reg($a),$reg($d),$reg($b)
69 in 01111100000aaaaabbbbb00010101100 dcbf $reg($a),$reg($b)
70 in 011111dddddaaaaa00000o001101000r neg{|o}[$o]{|.}[$r] $reg($d),$reg($a)
71 in 011111dddddaaaaabbbbb0001111100r nor{|.}[$r] $reg($a),$reg($d),$reg($b)
72 in 011111dddddaaaaabbbbbo01z001000r subf{|z}[$z]e{|o}[$o]{|.}[$r] \
74 in 011111ddddd0ffffffff000100100m00 mt{crf $hex($f),|msr}[$m] $reg($d)
75 in 011111sssssaaaaabbbbb0010u101010 std{|u}[$u]x $reg($s),$reg0($a),$reg($b)
76 in 011111sssssaaaaabbbbb001w0101101 st{w|d}[$w]cx. $reg($s),$reg0($a),$reg($b)
77 in 011111dddddaaaaa00000o011001010r addze{|o}[$o]{|.}[$r] $reg($d),$reg($a)
78 in 011111sssss0rrrr0000000110100100 mtsr $dec($r),$reg($s)
79 in 011111dddddaaaaa00000o0111010x0r {subf|add}[$x]me{|o}[$o]{|.}[$r] \
81 in 011111dddddaaaaabbbbbo0111010w1r mull{w|d}[$w]{|o}[$o]{|.}[$r] \
82 $reg($d),$reg($a),$reg($b)
83 in 011111sssss00000bbbbb00111100100 mtsrin $reg($s),$reg($b)
84 in 01111100000aaaaabbbbb00111101100 dcbtst $reg0($a),$reg($b)
85 in 01111100000aaaaabbbbb01000101100 dcbt $reg0($a),$reg($b)
86 in 011111sssssaaaaabbbbb0100011100r eqv{|.}[$r] $reg($a),$reg($s),$reg($b)
87 in 0111110000000000bbbbb01001100100 tlbie $reg($b)
88 in 011111dddddaaaaabbbbb01i01101100 ec{i|o}[$i]wx $reg($d),$reg0($a),$reg($b)
89 in 011111dddddrrrrrrrrrr01t10100110 m{f|t}[$t]spr $reg($d),$spr($r)
90 in 011111dddddaaaaabbbbb0101u101010 lwa{|u}[$u]x $reg($d),$reg($a),$reg($b)
91 in 01111100000000000000001011100100 tlbia
92 in 011111dddddtttttttttt01011100110 mftb $reg($d),$dec($t)
93 in 011111sssssaaaaabbbbb0110011100r orc{|.}[$r] $reg($a),$reg($s),$reg($b)
94 in 0111110000000000bbbbb01101100100 slbie $reg($b)
95 in 011111dddddaaaaabbbbbo111u010w1r div{d|w}[$w]{u|}[$u]{|o}[$o]{|.}[$r] \
96 $reg($d),$reg($a),$reg($b)
97 in 01111100000aaaaabbbbb01110101100 dcbi $reg0($a),$reg($b)
98 in 011111sssssaaaaabbbbb0111011100r nand{|.}[$r] $reg($a),$reg($s),$reg($b)
99 in 01111100000000000000001111100100 slbia
100 in 011111ddd00000000000010000000000 mcrxr $crf($d)
101 in 011111dddddaaaaabbbbb10000101010 lswx $reg($d),$reg0($a),$reg($b)
102 in 011111dddddaaaaabbbbb1w000101100 l{w|h}[$w]brx $reg($d),$reg0($a),$reg($b)
103 in 011111dddddaaaaabbbbb100su101110 lf{s|d}[$s]{|u}[$u]x \
104 $fr($d),$reg0($a),$reg($b)
105 in 011111sssssaaaaabbbbb1x000110w0r sr{|a}[$x]{w|d}[$w]{|.}[$r] \
106 $reg($a),$reg($s),$reg($b)
107 in 011111sssssaaaaabbbbb1000011011r srd{|.}[$r] $reg($a),$reg($s),$reg($b)
108 in 01111100000000000000010001101100 tlbsync
109 in 011111ddddd0rrrr0000010010101100 mfsr $reg($d),$dec($r)
110 in 011111dddddaaaaannnnn10010101010 lswi $reg($d),$reg0($a),$dec($n)
111 in 01111100000000000000010010101100 sync
112 in 011111ddddd00000bbbbb10100100110 mfsrin $reg($d),$reg($b)
113 in 011111sssssaaaaabbbbb10100101010 stswx $reg($s),$reg0($a),$reg($b)
114 in 011111sssssaaaaabbbbb1w100101100 st{w|h}[$w]brx $reg($s),$reg0($a),$reg($b)
115 in 011111sssssaaaaabbbbb101du101110 stf{s|d}[$d]{|u}[$u]x \
116 $fr($s),{$reg0($a)|$reg($a)}[$u],$reg($b)
117 in 011111sssssaaaaannnnn10110101010 stswi $reg($s),$reg0($a),$dec($n)
118 in 011111dddddaaaaasssss1100111000r srawi{|.}[$r] $reg($a),$reg($s),$dec($s)
119 in 01111100000000000000011010101100 eieio
120 in 011111sssssaaaaa00000111xx11010r exts{h|b|w|?}[$x]{|.}[$r] $reg($a),$reg($s)
121 in 01111100000aaaaabbbbb11110101100 icbi $reg0($a),$reg($b)
122 in 011111sssssaaaaabbbbb11110101110 stfiwx $fr($s),$reg0($a),$reg($b)
123 in 01111100000aaaaabbbbb11111101100 dcbz $reg0($a),$reg($b)
124 in 011Axsaaaaadddddiiiiiiiiiiiiiiii {{|x}[$x]or|{and|?}[$x]}[$A]i{|s}[$s]\
125 {|.}[$A] $reg($d),$reg($a),\
126 {$hex($i)|$shifted16($i)}[$s]
127 # Grouping andi with xori and ori may not be such a brilliant idea, since it
128 # gets invoked as a catch-all for the 011111 instructions below. But that
129 # just means that we get a different sort of undefined instruction.
130 in 10111sdddddaaaaaiiiiiiiiiiiiiiii {l|st}[$s]mw \
131 $reg($d),$simm16($i)($reg0($a))
132 in 10oooudddddaaaaaiiiiiiiiiiiiiiii $ldst($o){|u}[$u] \
133 $reg($d),$simm16($i)($reg0($a))
134 in 110sDudddddaaaaaiiiiiiiiiiiiiiii {l|st}[$s]f{s|d}[$D]{|u}[$u] \
135 $fr($d),$simm16($i)($reg0($a))
136 in 111010dddddaaaaaiiiiiiiiiiiiiixy l{d{|u}[$y]|{|?}[$y]w}[$x] \
137 $reg($d),$simm16($i)($reg0($a))
138 in 111s11dddddaaaaabbbbb0000010010r fdiv{s|}[$s]{|.}[$r] \
139 $fr($d),$fr($a),$fr($b)
140 in 111s11dddddaaaaabbbbb000001010xr f{sub|add}[$x]{s|}[$s]{|.}[$r] \
141 $fr($d),$fr($a),$fr($b)
142 in 111s11ddddd00000bbbbb0000010110r fsqrt{s|}[$s]{|.}[$r] $fr($d),$fr($b)
143 in 111011ddddd00000bbbbb0000011000r fress{|.}[$r] $fr($d),$fr($b)
144 in 111s11dddddaaaaa00000ccccc11001r fmul{s|}[$s]{|.}[$r] \
145 $fr($d),$fr($a),$fr($c)
146 in 111s11dddddaaaaabbbbbccccc111nxr f{|n}[$n]m{sub|add}[$x]{s|}[$s]{|.}[$r] \
147 $fr($d),$fr($a),$fr($c),$fr($b)
148 in 111110sssssaaaaaiiiiiiiiiiiiii0u std{|u}[$u] \
149 $reg($s),$simm16($i)({$reg0($a)|$reg($a)}[$u])
150 in 111111ccc00aaaaabbbbb0000o000000 fcmp{u|o}[$o] $crf($c),$fr($a),$fr($b)
151 in 111111ddddd00000bbbbb0000001100r frsp{|.}[$r] $fr($d),$fr($b)
152 in 111111ddddd00000bbbbb000000111zr fctiw{|z}[$z]{|.}[$r] $fr($d),$fr($b)
153 in 111111dddddaaaaabbbbbccccc10111r fsel{|.}[$r] \
154 $fr($d),$fr($a),$fr($c),$fr($b)
155 in 111111ddddd00000bbbbb0000011010r frsqrte{|,.}[$r] $fr($d),$fr($b)
156 in 111111ddddd0000000000000xx00110r mtfsb{?|1|0|?}[$x]{|.}[$r] $fcond($d)
157 in 111111ddddd00000bbbbb0000101000r fneg{|.}[$r] $fr($d),$fr($b)
158 in 111111ddd00sss000000000010000000 mcrfs $crf($d),$crf($s)
159 in 111111ddddd00000bbbbb0001001000r fmr{|.}[$r] $fr($d),$fr($b)
160 in 111111ddd0000000iiii00010000110r mtfsfi{|.}[$r] $crf($d),$simm16($i)
161 in 111111ddddd00000bbbbb0010001000r fnabs{|.}[$r] $fr($d),$fr($b)
162 in 111111ddddd00000bbbbb0100001000r fabs{|.}[$r] $fr($d),$fr($b)
163 in 111111ddddd00000000001001000111r mffs{|.}[$r] $fr($d)
164 in 1111110ffffffff0bbbbb1011000111r mtfsf{|.}[$r] $hex($f),$fr($b)
165 in 111111ddddd00000bbbbb110010111zr fctid{|z}[$z]{|.}[$r] $fr($d),$fr($b)
166 in 111111ddddd00000bbbbb1101001110r fcfid{|.}[$r] $fr($d),$fr($b)
168 in xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ?
171 ldst ooo {lwz|lbz|stw|stb|lhz|lha|sth|?}[$o]
172 br utdzyrrrcc(%a,%l,s,%C) b{d{nz|z}[$z]|{|?}[$z]}[$d]{c|}[$u]\
174 {$crcom($r)$cond($[cct]){|,}[$C]|}[$u]
175 cond ccc {ge|lt|le|gt|ne|eq|ns|so}[$c]
177 crb rrrcc $cr($r):$cond($[cc1])
178 crop oooo {?|nor|?|?|andc|?|xor|nand|and|eqv|?|?|?|orc|or|?}[$o]
179 tcond ccccc {?|lgt|llt|?|eq|lge|lle|?|?|?|?|?|ge|?|?|?|lt|?|?|?|le|?|?|?|ne|?|?|?|?|?|?|a}[$c]
183 spr 0010l00000 rtc{u|l}[$l]
184 spr s011000000 dec{u|s}[$s]
190 spr 1101n00000 srr$dec($n)
191 spr 100nn01000 sprg$dec($n)
194 spr 10nnl10000 ibat$dec($n){u|l}[$l]
195 spr 1000n11111 hid$dec($n)
211 simm16 snnnnnnnnnnnnnnn {$hex($n)|-$hex((1 << 15) - $n)}[$s]
213 shifted16 (%n) $hex($n << 16)
215 brabs (%n) $hex($n << 2)