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