]> git.saurik.com Git - apple/xnu.git/blame_incremental - osfmk/ppc/ppc_disasm.i
xnu-344.23.tar.gz
[apple/xnu.git] / osfmk / ppc / ppc_disasm.i
... / ...
CommitLineData
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
39in 01001100000000000000000100101100 isync
40in 010011cccccccccc000001000010000l $br($c,0,$l,ctr,0)
41in 010111dddddaaaaabbbbbffffftttttr rlwnm{|.}[$r] \
42 $reg($a),$reg($d),$reg($b),$dec($f),$dec($t)
43in 0101xxdddddaaaaasssssffffftttttr rl{wimi|winm|?|?}[$x]{|.}[$r] \
44 $reg($a),$reg($d),$dec($s),$dec($f),$dec($t)
45in 011110dddddaaaaasssssffffff0xxSr rld{icl|icr|ic|imi}[$x]{|.}[$r] \
46 $reg($a),$reg($d),$dec($[sssssS]),$dec($f)
47in 011110dddddaaaaabbbbbffffff100xr rldc{l|r}[$x]{|.}[$r] \
48 $reg($a),$reg($d),$reg($b),$dec($f)
49in 011111ddd0laaaaabbbbb0000u000000 cmp{|l}[$u] \
50 $crcom($d){|1,}[$l]$reg($a),$reg($b)
51in 011111cccccaaaaabbbbb000w0001000 t{w|d}[$w]$tcond($c) $reg($a),$reg($b)
52in 011111dddddaaaaabbbbbo000C01000r subf{c|}[$C]{|o}[$o]{|.}[$r] \
53 $reg($d),$reg($a),$reg($b)
54in 011111dddddaaaaabbbbb000u0010w1r mulh{d|w}[$w]{u|}[$u]{|.}[$r] \
55 $reg($d),$reg($a),$reg($b)
56in 011111dddddaaaaabbbbbott0001010r add{c|e||?}[$t]{|o}[$o]{|.}[$r] \
57 $reg($d),$reg($a),$reg($b)
58in 011111ddddd0000000000000m0100110 mf{cr|msr}[$m] $reg($d)
59in 011111dddddaaaaabbbbb000w0101000 l{w|d}[$w]arx $reg($d),$reg0($a),$reg($b)
60in 011111dddddaaaaabbbbb0000u101010 ld{|u}[$u]x $reg($d),$reg0($a),$reg($b)
61in 011111dddddaaaaabbbbb0ooou101110 $ldst($o){|u}[$u]x \
62 $reg($d),$reg($a),$reg($b)
63in 011111dddddaaaaabbbbb0000011A00r {slw|and}[$A]{|.}[$r] \
64 $reg($a),$reg($d),$reg($b)
65in 011111dddddaaaaa000000000w11010r cntlz{w|d}[$w]{|.}[$r] $reg($a),$reg($d)
66in 011111dddddaaaaabbbbb0000011011r sld{|.}[$r] $reg($a),$reg($d),$reg($b)
67in 01111100000aaaaabbbbb00001101100 dcbst $reg($a),$reg($b)
68in 011111dddddaaaaabbbbb0000111100r andc{|.}[$r] $reg($a),$reg($d),$reg($b)
69in 01111100000aaaaabbbbb00010101100 dcbf $reg($a),$reg($b)
70in 011111dddddaaaaa00000o001101000r neg{|o}[$o]{|.}[$r] $reg($d),$reg($a)
71in 011111dddddaaaaabbbbb0001111100r nor{|.}[$r] $reg($a),$reg($d),$reg($b)
72in 011111dddddaaaaabbbbbo01z001000r subf{|z}[$z]e{|o}[$o]{|.}[$r] \
73 $reg($d),$reg($a)
74in 011111ddddd0ffffffff000100100m00 mt{crf $hex($f),|msr}[$m] $reg($d)
75in 011111sssssaaaaabbbbb0010u101010 std{|u}[$u]x $reg($s),$reg0($a),$reg($b)
76in 011111sssssaaaaabbbbb001w0101101 st{w|d}[$w]cx. $reg($s),$reg0($a),$reg($b)
77in 011111dddddaaaaa00000o011001010r addze{|o}[$o]{|.}[$r] $reg($d),$reg($a)
78in 011111sssss0rrrr0000000110100100 mtsr $dec($r),$reg($s)
79in 011111dddddaaaaa00000o0111010x0r {subf|add}[$x]me{|o}[$o]{|.}[$r] \
80 $reg($d),$reg($a)
81in 011111dddddaaaaabbbbbo0111010w1r mull{w|d}[$w]{|o}[$o]{|.}[$r] \
82 $reg($d),$reg($a),$reg($b)
83in 011111sssss00000bbbbb00111100100 mtsrin $reg($s),$reg($b)
84in 01111100000aaaaabbbbb00111101100 dcbtst $reg0($a),$reg($b)
85in 01111100000aaaaabbbbb01000101100 dcbt $reg0($a),$reg($b)
86in 011111sssssaaaaabbbbb0100011100r eqv{|.}[$r] $reg($a),$reg($s),$reg($b)
87in 0111110000000000bbbbb01001100100 tlbie $reg($b)
88in 011111dddddaaaaabbbbb01i01101100 ec{i|o}[$i]wx $reg($d),$reg0($a),$reg($b)
89in 011111dddddrrrrrrrrrr01t10100110 m{f|t}[$t]spr $reg($d),$spr($r)
90in 011111dddddaaaaabbbbb0101u101010 lwa{|u}[$u]x $reg($d),$reg($a),$reg($b)
91in 01111100000000000000001011100100 tlbia
92in 011111dddddtttttttttt01011100110 mftb $reg($d),$dec($t)
93in 011111sssssaaaaabbbbb0110011100r orc{|.}[$r] $reg($a),$reg($s),$reg($b)
94in 0111110000000000bbbbb01101100100 slbie $reg($b)
95in 011111dddddaaaaabbbbbo111u010w1r div{d|w}[$w]{u|}[$u]{|o}[$o]{|.}[$r] \
96 $reg($d),$reg($a),$reg($b)
97in 01111100000aaaaabbbbb01110101100 dcbi $reg0($a),$reg($b)
98in 011111sssssaaaaabbbbb0111011100r nand{|.}[$r] $reg($a),$reg($s),$reg($b)
99in 01111100000000000000001111100100 slbia
100in 011111ddd00000000000010000000000 mcrxr $crf($d)
101in 011111dddddaaaaabbbbb10000101010 lswx $reg($d),$reg0($a),$reg($b)
102in 011111dddddaaaaabbbbb1w000101100 l{w|h}[$w]brx $reg($d),$reg0($a),$reg($b)
103in 011111dddddaaaaabbbbb100su101110 lf{s|d}[$s]{|u}[$u]x \
104 $fr($d),$reg0($a),$reg($b)
105in 011111sssssaaaaabbbbb1x000110w0r sr{|a}[$x]{w|d}[$w]{|.}[$r] \
106 $reg($a),$reg($s),$reg($b)
107in 011111sssssaaaaabbbbb1000011011r srd{|.}[$r] $reg($a),$reg($s),$reg($b)
108in 01111100000000000000010001101100 tlbsync
109in 011111ddddd0rrrr0000010010101100 mfsr $reg($d),$dec($r)
110in 011111dddddaaaaannnnn10010101010 lswi $reg($d),$reg0($a),$dec($n)
111in 01111100000000000000010010101100 sync
112in 011111ddddd00000bbbbb10100100110 mfsrin $reg($d),$reg($b)
113in 011111sssssaaaaabbbbb10100101010 stswx $reg($s),$reg0($a),$reg($b)
114in 011111sssssaaaaabbbbb1w100101100 st{w|h}[$w]brx $reg($s),$reg0($a),$reg($b)
115in 011111sssssaaaaabbbbb101du101110 stf{s|d}[$d]{|u}[$u]x \
116 $fr($s),{$reg0($a)|$reg($a)}[$u],$reg($b)
117in 011111sssssaaaaannnnn10110101010 stswi $reg($s),$reg0($a),$dec($n)
118in 011111dddddaaaaasssss1100111000r srawi{|.}[$r] $reg($a),$reg($s),$dec($s)
119in 01111100000000000000011010101100 eieio
120in 011111sssssaaaaa00000111xx11010r exts{h|b|w|?}[$x]{|.}[$r] $reg($a),$reg($s)
121in 01111100000aaaaabbbbb11110101100 icbi $reg0($a),$reg($b)
122in 011111sssssaaaaabbbbb11110101110 stfiwx $fr($s),$reg0($a),$reg($b)
123in 01111100000aaaaabbbbb11111101100 dcbz $reg0($a),$reg($b)
124in 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.
130in 10111sdddddaaaaaiiiiiiiiiiiiiiii {l|st}[$s]mw \
131 $reg($d),$simm16($i)($reg0($a))
132in 10oooudddddaaaaaiiiiiiiiiiiiiiii $ldst($o){|u}[$u] \
133 $reg($d),$simm16($i)($reg0($a))
134in 110sDudddddaaaaaiiiiiiiiiiiiiiii {l|st}[$s]f{s|d}[$D]{|u}[$u] \
135 $fr($d),$simm16($i)($reg0($a))
136in 111010dddddaaaaaiiiiiiiiiiiiiixy l{d{|u}[$y]|{|?}[$y]w}[$x] \
137 $reg($d),$simm16($i)($reg0($a))
138in 111s11dddddaaaaabbbbb0000010010r fdiv{s|}[$s]{|.}[$r] \
139 $fr($d),$fr($a),$fr($b)
140in 111s11dddddaaaaabbbbb000001010xr f{sub|add}[$x]{s|}[$s]{|.}[$r] \
141 $fr($d),$fr($a),$fr($b)
142in 111s11ddddd00000bbbbb0000010110r fsqrt{s|}[$s]{|.}[$r] $fr($d),$fr($b)
143in 111011ddddd00000bbbbb0000011000r fress{|.}[$r] $fr($d),$fr($b)
144in 111s11dddddaaaaa00000ccccc11001r fmul{s|}[$s]{|.}[$r] \
145 $fr($d),$fr($a),$fr($c)
146in 111s11dddddaaaaabbbbbccccc111nxr f{|n}[$n]m{sub|add}[$x]{s|}[$s]{|.}[$r] \
147 $fr($d),$fr($a),$fr($c),$fr($b)
148in 111110sssssaaaaaiiiiiiiiiiiiii0u std{|u}[$u] \
149 $reg($s),$simm16($i)({$reg0($a)|$reg($a)}[$u])
150in 111111ccc00aaaaabbbbb0000o000000 fcmp{u|o}[$o] $crf($c),$fr($a),$fr($b)
151in 111111ddddd00000bbbbb0000001100r frsp{|.}[$r] $fr($d),$fr($b)
152in 111111ddddd00000bbbbb000000111zr fctiw{|z}[$z]{|.}[$r] $fr($d),$fr($b)
153in 111111dddddaaaaabbbbbccccc10111r fsel{|.}[$r] \
154 $fr($d),$fr($a),$fr($c),$fr($b)
155in 111111ddddd00000bbbbb0000011010r frsqrte{|,.}[$r] $fr($d),$fr($b)
156in 111111ddddd0000000000000xx00110r mtfsb{?|1|0|?}[$x]{|.}[$r] $fcond($d)
157in 111111ddddd00000bbbbb0000101000r fneg{|.}[$r] $fr($d),$fr($b)
158in 111111ddd00sss000000000010000000 mcrfs $crf($d),$crf($s)
159in 111111ddddd00000bbbbb0001001000r fmr{|.}[$r] $fr($d),$fr($b)
160in 111111ddd0000000iiii00010000110r mtfsfi{|.}[$r] $crf($d),$simm16($i)
161in 111111ddddd00000bbbbb0010001000r fnabs{|.}[$r] $fr($d),$fr($b)
162in 111111ddddd00000bbbbb0100001000r fabs{|.}[$r] $fr($d),$fr($b)
163in 111111ddddd00000000001001000111r mffs{|.}[$r] $fr($d)
164in 1111110ffffffff0bbbbb1011000111r mtfsf{|.}[$r] $hex($f),$fr($b)
165in 111111ddddd00000bbbbb110010111zr fctid{|z}[$z]{|.}[$r] $fr($d),$fr($b)
166in 111111ddddd00000bbbbb1101001110r fcfid{|.}[$r] $fr($d),$fr($b)
167
168in xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ?
169
170
171ldst ooo {lwz|lbz|stw|stb|lhz|lha|sth|?}[$o]
172br utdzyrrrcc(%a,%l,s,%C) b{d{nz|z}[$z]|{|?}[$z]}[$d]{c|}[$u]\
173 {|l}[$l]{|a}[$a]$s \
174 {$crcom($r)$cond($[cct]){|,}[$C]|}[$u]
175cond ccc {ge|lt|le|gt|ne|eq|ns|so}[$c]
176fcond ccc $hex($c)
177crb rrrcc $cr($r):$cond($[cc1])
178crop oooo {?|nor|?|?|andc|?|xor|nand|and|eqv|?|?|?|orc|or|?}[$o]
179tcond ccccc {?|lgt|llt|?|eq|lge|lle|?|?|?|?|?|ge|?|?|?|lt|?|?|?|le|?|?|?|ne|?|?|?|?|?|?|a}[$c]
180
181spr 0000000000 mq
182spr 0000100000 xer
183spr 0010l00000 rtc{u|l}[$l]
184spr s011000000 dec{u|s}[$s]
185spr 0100000000 lr
186spr 0100100000 ctr
187spr 1001000000 dsisr
188spr 1001100000 dar
189spr 1100100000 sdr1
190spr 1101n00000 srr$dec($n)
191spr 100nn01000 sprg$dec($n)
192spr 1101001000 ear
193spr 1101101000 pvr
194spr 10nnl10000 ibat$dec($n){u|l}[$l]
195spr 1000n11111 hid$dec($n)
196spr 1001011111 iabr
197spr 1010111111 dabr
198spr 1111111111 pir
199spr xxxxxxxxxx ?
200
201reg0 00000 0
202reg0 nnnnn $reg($n)
203
204reg (%n) r$dec($n)
205fr (%n) fr$dec($n)
206cr (%n) cr$dec($n)
207crf (%n) crf$dec($n)
208crcom 000
209crcom nnn $cr($n),
210
211simm16 snnnnnnnnnnnnnnn {$hex($n)|-$hex((1 << 15) - $n)}[$s]
212
213shifted16 (%n) $hex($n << 16)
214
215brabs (%n) $hex($n << 2)
216
217hex (%n) :
218dec (%n) :
219mbz (%n) :
220brdispl (%d,%n) :