Mercurial > pub > dyncall > dyncall
annotate doc/disas_examples/ppc64.elfabi.disas @ 497:cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
author | Tassilo Philipp |
---|---|
date | Wed, 23 Mar 2022 15:24:31 +0100 |
parents | ead041d93e36 |
children | fc614cb865c6 |
rev | line source |
---|---|
327
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
1 ; #include <stdlib.h> |
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
2 ; |
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
3 ; void leaf_call(int b, int c, int d, int e, int f, int g, int h) |
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
4 ; { |
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
5 ; } |
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
6 ; |
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
7 ; void nonleaf_call(int a, int b, int c, int d, int e, int f, int g, int h) |
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
8 ; { |
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
9 ; /* use some local data */ |
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
10 ; *(char*)alloca(220) = 'L'; |
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
11 ; leaf_call(b, c, d, e, f, g, h); |
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
12 ; } |
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
13 ; |
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
14 ; int main() |
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
15 ; { |
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
16 ; nonleaf_call(0, 1, 2, 3, 4, 5, 6, 7); |
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
17 ; return 0; |
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
18 ; } |
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
19 |
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
20 |
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
21 |
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
22 ; output from freebsd-11.0-ppc64 w/ gcc 4.2.1 |
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
23 |
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
24 0000000000000000 <.leaf_call>: |
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
25 0: fb e1 ff f8 std r31,-8(r1) |
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
26 4: f8 21 ff c1 stdu r1,-64(r1) |
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
27 8: 7c 3f 0b 78 mr r31,r1 |
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
28 c: 7c 60 1b 78 mr r0,r3 |
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
29 10: 7c 8b 23 78 mr r11,r4 |
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
30 14: 7c aa 2b 78 mr r10,r5 |
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
31 18: 90 1f 00 70 stw r0,112(r31) |
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
32 1c: 91 7f 00 78 stw r11,120(r31) |
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
33 20: 91 5f 00 80 stw r10,128(r31) |
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
34 24: 90 df 00 88 stw r6,136(r31) |
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
35 28: 90 ff 00 90 stw r7,144(r31) |
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
36 2c: 91 1f 00 98 stw r8,152(r31) |
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
37 30: 91 3f 00 a0 stw r9,160(r31) |
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
38 34: e8 21 00 00 ld r1,0(r1) |
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
39 38: eb e1 ff f8 ld r31,-8(r1) |
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
40 3c: 4e 80 00 20 blr |
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
41 ... |
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
42 48: 80 01 00 01 lwz r0,1(r1) |
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
43 |
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
44 000000000000004c <.nonleaf_call>: |
331 | 45 4c: 7c 08 02 a6 mflr r0 ; | |
46 50: fb e1 ff f8 std r31,-8(r1) ; | | |
47 54: f8 01 00 10 std r0,16(r1) ; | prolog | |
48 58: f8 21 ff 71 stdu r1,-144(r1) ; | | |
49 5c: 7c 3f 0b 78 mr r31,r1 ; use gpr31 as sort of frame pointer, below | |
50 60: 7c 60 1b 78 mr r0,r3 ; in arg 0 -> gpr0 | |
51 64: 7c 8b 23 78 mr r11,r4 ; in arg 1 -> gpr11 | |
52 68: 90 1f 00 c0 stw r0,192(r31) ; | | |
53 6c: 91 7f 00 c8 stw r11,200(r31) ; | | |
54 70: 90 bf 00 d0 stw r5,208(r31) ; | | |
55 74: 90 df 00 d8 stw r6,216(r31) ; | | |
56 78: 90 ff 00 e0 stw r7,224(r31) ; | all in args -> spill area in prev frame (jump over own frame (144) + linkage area of prev frame (48) = 192) | |
57 7c: 91 1f 00 e8 stw r8,232(r31) ; | | |
58 80: 91 3f 00 f0 stw r9,240(r31) ; | | |
59 84: 91 5f 00 f8 stw r10,248(r31) ; | | |
60 88: e8 01 00 00 ld r0,0(r1) ; fetch back-chain ptr (parent frame's sp) from stack of top by prolog -> gpr0, and ... | |
61 8c: f8 01 ff 11 stdu r0,-240(r1) ; ... update it further up the stack for alloca(220) - with padding to guarantee alignment | |
62 90: 39 21 00 70 addi r9,r1,112 ; | | |
63 94: f9 3f 00 70 std r9,112(r31) ; | | |
64 98: e9 3f 00 70 ld r9,112(r31) ; | | |
65 9c: 38 09 00 0f addi r0,r9,15 ; | start of alloca()'d memory -> gpr9, by ... | |
66 a0: 78 00 e1 02 rldicl r0,r0,60,4 ; | ... using gpr0 as helper to align to 16b, leaving at least 112b at top of stack | |
67 a4: 78 00 26 e4 rldicr r0,r0,4,59 ; | | |
68 a8: f8 1f 00 70 std r0,112(r31) ; | | |
69 ac: e9 3f 00 70 ld r9,112(r31) ; | | |
70 b0: 38 00 00 4c li r0,76 ; 'L' -> gpr0, and ... | |
71 b4: 98 09 00 00 stb r0,0(r9) ; ... store in local area (of alloca()'d space) | |
72 b8: 80 1f 00 c8 lwz r0,200(r31) ; prep arg 0 (from prev frame's spill area), ... | |
73 bc: 7c 08 07 b4 extsw r8,r0 ; ... -> gpr8 (w/ sign extension b/c int param in 64bit reg) | |
74 c0: 80 1f 00 d0 lwz r0,208(r31) ; prep arg 1 (from prev frame's spill area), ... | |
75 c4: 7c 07 07 b4 extsw r7,r0 ; ... -> gpr7 | |
76 c8: 80 1f 00 d8 lwz r0,216(r31) ; prep arg 2 (from prev frame's spill area), ... | |
77 cc: 7c 06 07 b4 extsw r6,r0 ; ... -> gpr6 | |
78 d0: 80 1f 00 e0 lwz r0,224(r31) ; prep arg 3 (from prev frame's spill area), ... | |
79 d4: 7c 09 07 b4 extsw r9,r0 ; ... -> gpr9 | |
80 d8: 80 1f 00 e8 lwz r0,232(r31) ; prep arg 4 (from prev frame's spill area), ... | |
81 dc: 7c 0b 07 b4 extsw r11,r0 ; ... -> gpr11 | |
82 e0: 80 1f 00 f0 lwz r0,240(r31) ; prep arg 5 (from prev frame's spill area), ... | |
83 e4: 7c 0a 07 b4 extsw r10,r0 ; ... -> gpr10 | |
84 e8: 80 1f 00 f8 lwz r0,248(r31) ; prep arg 6 (from prev frame's spill area), ... | |
85 ec: 7c 00 07 b4 extsw r0,r0 ; ... -> gpr0 | |
86 f0: 7d 03 43 78 mr r3,r8 ; arg 0 | |
87 f4: 7c e4 3b 78 mr r4,r7 ; arg 1 | |
88 f8: 7c c5 33 78 mr r5,r6 ; arg 2 | |
89 fc: 7d 26 4b 78 mr r6,r9 ; arg 3 | |
90 100: 7d 67 5b 78 mr r7,r11 ; arg 4 | |
91 104: 7d 48 53 78 mr r8,r10 ; arg 5 | |
92 108: 7c 09 03 78 mr r9,r0 ; arg 6 | |
93 10c: 48 00 00 01 bl 10c <.nonleaf_call+0xc0> ; call and put return address -> lr | |
94 110: e8 21 00 00 ld r1,0(r1) ; | | |
95 114: e8 01 00 10 ld r0,16(r1) ; | | |
96 118: 7c 08 03 a6 mtlr r0 ; | epilog | |
97 11c: eb e1 ff f8 ld r31,-8(r1) ; | | |
98 120: 4e 80 00 20 blr ; | | |
99 124: 00 00 00 00 .long 0x0 ; data | |
100 128: 00 00 00 01 .long 0x1 ; data | |
101 12c: 80 01 00 01 lwz r0,1(r1) ; unsure@@@. data? | |
327
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
102 |
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
103 0000000000000130 <.main>: |
331 | 104 130: 7c 08 02 a6 mflr r0 ; | lr -> gpr0 |
105 134: fb e1 ff f8 std r31,-8(r1) ; | preseve gpr31 (as used in func as helper addr) | |
106 138: f8 01 00 10 std r0,16(r1) ; | prolog store lr | |
107 13c: f8 21 ff 81 stdu r1,-128(r1) ; | open frame | |
108 140: 7c 3f 0b 78 mr r31,r1 ; use gpr31 as sort of frame pointer, below | |
109 144: 38 60 00 00 li r3,0 ; arg 0 | |
110 148: 38 80 00 01 li r4,1 ; arg 1 | |
111 14c: 38 a0 00 02 li r5,2 ; arg 2 | |
112 150: 38 c0 00 03 li r6,3 ; arg 3 | |
113 154: 38 e0 00 04 li r7,4 ; arg 4 | |
114 158: 39 00 00 05 li r8,5 ; arg 5 | |
115 15c: 39 20 00 06 li r9,6 ; arg 6 | |
116 160: 39 40 00 07 li r10,7 ; arg 7 | |
117 164: 48 00 00 01 bl 164 <.main+0x34> ; call and put return address -> lr | |
118 168: 38 00 00 00 li r0,0 ; return value ... | |
119 16c: 7c 03 03 78 mr r3,r0 ; ... in gpr3 | |
120 170: e8 21 00 00 ld r1,0(r1) ; | | |
121 174: e8 01 00 10 ld r0,16(r1) ; | | |
122 178: 7c 08 03 a6 mtlr r0 ; | epilog | |
123 17c: eb e1 ff f8 ld r31,-8(r1) ; | | |
124 180: 4e 80 00 20 blr ; | | |
125 184: 00 00 00 00 .long 0x0 ; data | |
126 188: 00 00 00 01 .long 0x1 ; data | |
127 18c: 80 01 00 01 lwz r0,1(r1) ; unsure@@@. data? | |
128 | |
129 | |
130 | |
131 ; ------------- ints and floats, var args, struct return value (meaning implicit first param), more than 8 params (11, with implicit return value ptr) -----------> | |
132 | |
133 ; #include <stdlib.h> | |
134 ; #include <stdarg.h> | |
135 ; | |
136 ; void leaf_call(int b, float c, int d, float e, int f, float g, float h, int i, float j) | |
137 ; { | |
138 ; } | |
139 ; | |
140 ; struct aggr { int x; int y; int z; }; | |
141 ; | |
142 ; struct aggr nonleaf_call(int a, int b, float c, int d, float e, int f, ...) | |
143 ; { | |
144 ; va_list v; | |
145 ; int i; | |
146 ; float g, h, j; | |
147 ; struct aggr st = { b, d, f }; | |
148 ; va_start(v, f); | |
149 ; g = va_arg(v, float); | |
150 ; h = va_arg(v, float); | |
151 ; i = va_arg(v, int); | |
152 ; h = va_arg(v, float); | |
153 ; /* use some local data */ | |
154 ; *(char*)alloca(220) = 'L'; | |
155 ; leaf_call(b, c, d, e, f, g, h, i, j); | |
156 ; | |
157 ; return st; | |
158 ; } | |
159 ; | |
160 ; int main() | |
161 ; { | |
162 ; struct aggr st = nonleaf_call(0, 1, 2.f, 3, 4.f, 5, 6.f, 7.f, 8, 9.f); | |
163 ; return 0; | |
164 ; } | |
165 | |
166 | |
167 | |
168 ; output from freebsd-11.0-ppc64 w/ gcc 4.2.1 | |
169 | |
170 0000000000000000 <.leaf_call>: | |
171 0: fb e1 ff f8 std r31,-8(r1) | |
172 4: f8 21 ff c1 stdu r1,-64(r1) | |
173 8: 7c 3f 0b 78 mr r31,r1 | |
174 c: 7c 69 1b 78 mr r9,r3 | |
175 10: d0 3f 00 78 stfs f1,120(r31) | |
176 14: 7c ab 2b 78 mr r11,r5 | |
177 18: d0 5f 00 88 stfs f2,136(r31) | |
178 1c: 7c e8 3b 78 mr r8,r7 | |
179 20: d0 7f 00 98 stfs f3,152(r31) | |
180 24: d0 9f 00 a0 stfs f4,160(r31) | |
181 28: 7d 40 53 78 mr r0,r10 | |
182 2c: d0 bf 00 b0 stfs f5,176(r31) | |
183 30: 91 3f 00 70 stw r9,112(r31) | |
184 34: 91 7f 00 80 stw r11,128(r31) | |
185 38: 91 1f 00 90 stw r8,144(r31) | |
186 3c: 90 1f 00 a8 stw r0,168(r31) | |
187 40: e8 21 00 00 ld r1,0(r1) | |
188 44: eb e1 ff f8 ld r31,-8(r1) | |
189 48: 4e 80 00 20 blr | |
190 ... | |
191 54: 80 01 00 01 lwz r0,1(r1) | |
192 | |
193 0000000000000058 <.nonleaf_call>: | |
194 58: fb e1 ff f8 std r31,-8(r1) ; | | |
195 5c: f8 21 ff 91 stdu r1,-112(r1) ; | prolog | |
196 60: 7c 3f 0b 78 mr r31,r1 ; use gpr31 as sort of frame pointer, below | |
197 64: 7c 8b 23 78 mr r11,r4 ; in arg 1 (first explicit arg, b/c of struct return value ptr being arg0) -> r11 | |
198 68: 7c a8 2b 78 mr r8,r5 ; in arg 2 -> r8 (free reg, was skipped for float param) | |
199 6c: d0 3f 00 b8 stfs f1,184(r31) ; | in arg 3 (float) -> prev frame's spill area: 184 = 112 (frame) + 48 (prev frame's linkage area) + 8 (arg 0 = return value ptr) + 16 (first two explicit args) | |
200 70: d0 5f 00 c8 stfs f2,200(r31) ; | in arg 5 (float) -> prev frame's spill area | |
201 74: f9 5f 00 d8 std r10,216(r31) ; | in arg 7 (float, also held in gpr reg b/c vararg) -> prev frame's spill area | |
202 78: 7d 20 4b 78 mr r0,r9 ; | spilling in arg 6 in gpr0 (spilled below) | |
203 7c: 91 7f 00 a8 stw r11,168(r31) ; | in arg 1 (int) -> prev frame's spill area | |
204 80: 91 1f 00 b0 stw r8,176(r31) ; | in arg 2 (int) -> prev frame's spill area | |
205 84: 90 ff 00 c0 stw r7,192(r31) ; | in arg 4 (int) -> prev frame's spill area | |
206 88: 90 1f 00 d0 stw r0,208(r31) ; / in arg 6 (int) -> prev frame's spill area | |
207 8c: 80 1f 00 b0 lwz r0,176(r31) ; \ | |
208 90: 90 1f 00 48 stw r0,72(r31) ; | | |
209 94: 80 1f 00 c0 lwz r0,192(r31) ; | | |
210 98: 90 1f 00 4c stw r0,76(r31) ; | filling struct with 3 int input args | |
211 9c: 80 1f 00 d0 lwz r0,208(r31) ; | | |
212 a0: 90 1f 00 50 stw r0,80(r31) ; | | |
213 a4: 38 1f 00 d8 addi r0,r31,216 ; | |
214 a8: f8 1f 00 40 std r0,64(r31) ; . | |
215 ac: 7f e0 00 08 trap ; . | |
216 ... ; . | |
217 b8: 80 01 00 01 lwz r0,1(r1) ; | |
218 | |
219 00000000000000bc <.main>: | |
220 bc: 7c 08 02 a6 mflr r0 ; | lr -> gpr0 | |
221 c0: fb e1 ff f8 std r31,-8(r1) ; | preseve gpr31 (as used in func as helper addr) | |
222 c4: f8 01 00 10 std r0,16(r1) ; | prolog store lr | |
223 c8: f8 21 ff 41 stdu r1,-192(r1) ; | open frame | |
224 cc: 7c 3f 0b 78 mr r31,r1 ; use gpr31 as sort of frame pointer, below | |
225 d0: 39 61 00 30 addi r11,r1,48 ; ptr to param area -> r11 | |
226 d4: e9 22 00 00 ld r9,0(r2) ; prep arg 3 (=explicit arg 2, b/c of implicit return value pointer), ... | |
227 d8: c1 a9 00 00 lfs f13,0(r9) ; ... load from static data -> f13 | |
228 dc: e9 22 00 08 ld r9,8(r2) ; prep arg 5, ... | |
229 e0: c1 89 00 00 lfs f12,0(r9) ; ... load from static data -> f12 | |
230 e4: e9 22 00 10 ld r9,16(r2) ; prep arg 7, ... | |
231 e8: c8 09 00 00 lfd f0,0(r9) ; ... load from static data -> f0 | |
232 ec: d8 1f 00 a0 stfd f0,160(r31) ; | | |
233 f0: e8 1f 00 a0 ld r0,160(r31) ; | | |
234 f4: 7c 09 03 78 mr r9,r0 ; | also hold it in f11 (temporarily, before copying to fpr3 below) | |
235 f8: 7d 2a 4b 78 mr r10,r9 ; | and gpr10 (instead of skipping that int reg, for straightforward spilling) | |
236 fc: f8 1f 00 a0 std r0,160(r31) ; | (uses temp space to copy between fpr and gpr regs) | |
237 100: c8 1f 00 a0 lfd f0,160(r31) ; | | |
238 104: fd 60 00 90 fmr f11,f0 ; | | |
239 108: e9 22 00 18 ld r9,24(r2) ; prep arg 8, ... | |
240 10c: c8 09 00 00 lfd f0,0(r9) ; ... load from static data -> fpr0, and ... | |
241 110: d8 0b 00 40 stfd f0,64(r11) ; ... "pushed" onto stack (in param area past spill area) and ... | |
242 114: c9 4b 00 40 lfd f10,64(r11) ; ... also held in f10 (prep, see where it's used below) | |
243 118: 38 00 00 08 li r0,8 ; arg 9, ... | |
244 11c: f8 0b 00 48 std r0,72(r11) ; ... "pushed" onto stack | |
245 120: e9 22 00 20 ld r9,32(r2) ; arg 10 (float, promoted to double), ... | |
246 124: c8 09 00 00 lfd f0,0(r9) ; ... load from static data -> fpr0, and ... | |
247 128: d8 0b 00 50 stfd f0,80(r11) ; ... "pushed" onto stack | |
248 12c: c8 0b 00 50 lfd f0,80(r11) ; ... also held in f0 (prep, see where it's used below), in theory pointless reload of arg10 -> fpr0 | |
249 130: 38 1f 00 90 addi r0,r31,144 ; ptr to return value struct in local space -> gpr0 | |
250 134: 7c 03 03 78 mr r3,r0 ; arg 0 (this is the pointer to the struct return value) | |
251 138: 38 80 00 00 li r4,0 ; arg 1 | |
252 13c: 38 a0 00 01 li r5,1 ; arg 2 | |
253 140: fc 20 68 90 fmr f1,f13 ; arg 3 (float, in 1st double reg) | |
254 144: 38 e0 00 03 li r7,3 ; arg 4 (skipping gpr6 b/c of float arg) | |
255 148: fc 40 60 90 fmr f2,f12 ; arg 5 (float, in 2nd double reg) | |
256 14c: 39 20 00 05 li r9,5 ; arg 6 (skipping gpr8 b/c of float arg, vararg) | |
257 150: fc 60 58 90 fmr f3,f11 ; arg 7 (float, in 3rd double reg, promoted to double anyways b/c vararg) | |
258 154: fc 80 50 90 fmr f4,f10 ; arg 8 (float, in 4th double reg, promoted to double anyways b/c vararg) | |
259 158: fc a0 00 90 fmr f5,f0 ; arg 10 (float, in 5th double reg, promoted to double anyways b/c vararg) | |
260 15c: 48 00 00 01 bl 15c <.main+0xa0> ; call and put return address -> lr | |
261 160: 38 00 00 00 li r0,0 ; return value ... | |
262 164: 7c 03 03 78 mr r3,r0 ; ... in gpr3 | |
263 168: e8 21 00 00 ld r1,0(r1) ; | | |
264 16c: e8 01 00 10 ld r0,16(r1) ; | | |
265 170: 7c 08 03 a6 mtlr r0 ; | epilog | |
266 174: eb e1 ff f8 ld r31,-8(r1) ; | | |
267 178: 4e 80 00 20 blr ; | | |
268 17c: 00 00 00 00 .long 0x0 ; data | |
269 180: 00 00 00 01 .long 0x1 ; data | |
270 184: 80 01 00 01 lwz r0,1(r1) ; unsure@@@. data? | |
327
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
271 |
473
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
272 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
273 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
274 ; ---------- structs by value ----------> |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
275 ; |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
276 ; struct A { int i, j; long long l; }; |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
277 ; |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
278 ; void leaf_call(int b, int c, int d, int e, struct A f, int g, int h) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
279 ; { |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
280 ; } |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
281 ; |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
282 ; void nonleaf_call(int a, int b, int c, int d, int e, struct A f, int g, int h) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
283 ; { |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
284 ; /* use some local data */ |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
285 ; char l[100] = { 'L' }; |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
286 ; leaf_call(b, c, d, e, f, g, h); |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
287 ; } |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
288 ; |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
289 ; int main() |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
290 ; { |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
291 ; nonleaf_call(0, 1, 2, 3, 4, (struct A){5, 6, 7ll}, 8, 9); |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
292 ; return 0; |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
293 ; } |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
294 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
295 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
296 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
297 ; output from freebsd-11.0-ppc64 w/ gcc 4.2.1 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
298 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
299 0000000000000000 <.leaf_call>: |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
300 0: fb e1 ff f8 std r31,-8(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
301 4: f8 21 ff c1 stdu r1,-64(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
302 8: 7c 3f 0b 78 mr r31,r1 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
303 c: 7c 60 1b 78 mr r0,r3 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
304 10: 39 7f 00 90 addi r11,r31,144 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
305 14: f8 eb 00 00 std r7,0(r11) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
306 18: f9 0b 00 08 std r8,8(r11) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
307 1c: 7d 4b 53 78 mr r11,r10 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
308 20: 90 1f 00 70 stw r0,112(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
309 24: 90 9f 00 78 stw r4,120(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
310 28: 90 bf 00 80 stw r5,128(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
311 2c: 90 df 00 88 stw r6,136(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
312 30: 91 3f 00 a0 stw r9,160(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
313 34: 91 7f 00 a8 stw r11,168(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
314 38: e8 21 00 00 ld r1,0(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
315 3c: eb e1 ff f8 ld r31,-8(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
316 40: 4e 80 00 20 blr |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
317 ... |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
318 4c: 80 01 00 01 lwz r0,1(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
319 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
320 0000000000000050 <.nonleaf_call>: |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
321 50: 7c 08 02 a6 mflr r0 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
322 54: fb a1 ff e8 std r29,-24(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
323 58: fb e1 ff f8 std r31,-8(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
324 5c: f8 01 00 10 std r0,16(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
325 60: f8 21 ff 01 stdu r1,-256(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
326 64: 7c 3f 0b 78 mr r31,r1 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
327 68: 7c 60 1b 78 mr r0,r3 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
328 6c: 39 7f 01 58 addi r11,r31,344 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
329 70: f9 0b 00 00 std r8,0(r11) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
330 74: f9 2b 00 08 std r9,8(r11) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
331 78: 7d 49 53 78 mr r9,r10 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
332 7c: 90 1f 01 30 stw r0,304(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
333 80: 90 9f 01 38 stw r4,312(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
334 84: 90 bf 01 40 stw r5,320(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
335 88: 90 df 01 48 stw r6,328(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
336 8c: 90 ff 01 50 stw r7,336(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
337 90: 91 3f 01 68 stw r9,360(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
338 94: 38 1f 00 70 addi r0,r31,112 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
339 98: 39 20 00 64 li r9,100 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
340 9c: 7c 03 03 78 mr r3,r0 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
341 a0: 38 80 00 00 li r4,0 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
342 a4: 7d 25 4b 78 mr r5,r9 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
343 a8: 48 00 00 01 bl a8 <.nonleaf_call+0x58> |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
344 ac: 4f ff fb 82 crmove 4*cr7+so,4*cr7+so |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
345 b0: 38 00 00 4c li r0,76 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
346 b4: 98 1f 00 70 stb r0,112(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
347 b8: 80 1f 01 38 lwz r0,312(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
348 bc: 7c 08 07 b4 extsw r8,r0 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
349 c0: 80 1f 01 40 lwz r0,320(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
350 c4: 7c 09 07 b4 extsw r9,r0 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
351 c8: 80 1f 01 48 lwz r0,328(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
352 cc: 7c 0b 07 b4 extsw r11,r0 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
353 d0: 80 1f 01 50 lwz r0,336(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
354 d4: 7c 0a 07 b4 extsw r10,r0 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
355 d8: 80 1f 01 68 lwz r0,360(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
356 dc: 7c 1d 07 b4 extsw r29,r0 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
357 e0: 80 1f 01 74 lwz r0,372(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
358 e4: 7c 00 07 b4 extsw r0,r0 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
359 e8: 7d 03 43 78 mr r3,r8 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
360 ec: 7d 24 4b 78 mr r4,r9 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
361 f0: 7d 65 5b 78 mr r5,r11 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
362 f4: 7d 46 53 78 mr r6,r10 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
363 f8: 39 3f 01 58 addi r9,r31,344 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
364 fc: e8 e9 00 00 ld r7,0(r9) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
365 100: e9 09 00 08 ld r8,8(r9) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
366 104: 7f a9 eb 78 mr r9,r29 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
367 108: 7c 0a 03 78 mr r10,r0 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
368 10c: 48 00 00 01 bl 10c <.nonleaf_call+0xbc> |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
369 110: e8 21 00 00 ld r1,0(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
370 114: e8 01 00 10 ld r0,16(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
371 118: 7c 08 03 a6 mtlr r0 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
372 11c: eb a1 ff e8 ld r29,-24(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
373 120: eb e1 ff f8 ld r31,-8(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
374 124: 4e 80 00 20 blr |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
375 128: 00 00 00 00 .long 0x0 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
376 12c: 00 00 00 01 .long 0x1 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
377 130: 80 03 00 01 lwz r0,1(r3) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
378 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
379 0000000000000134 <.main>: |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
380 134: 7c 08 02 a6 mflr r0 ; | lr -> gpr0 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
381 138: fb e1 ff f8 std r31,-8(r1) ; | preseve gpr31 (as used in func as helper addr) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
382 13c: f8 01 00 10 std r0,16(r1) ; | prolog store lr |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
383 140: f8 21 ff 61 stdu r1,-160(r1) ; | open frame |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
384 144: 7c 3f 0b 78 mr r31,r1 ; use gpr31 as sort of frame pointer, below |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
385 148: e9 22 00 00 ld r9,0(r2) ; | |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
386 14c: e9 49 00 08 ld r10,8(r9) ; | fetch local struct data's 2 doublewords (r2 = TOC ptr) -> r9/r10, and ... |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
387 150: e9 29 00 00 ld r9,0(r9) ; | |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
388 154: f9 3f 00 80 std r9,128(r31) ; | ... write to local area on stack |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
389 158: f9 5f 00 88 std r10,136(r31) ; / |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
390 15c: 38 00 00 09 li r0,9 ; \ arg 7, ... |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
391 160: f8 01 00 70 std r0,112(r1) ; | ... "pushed" onto stack |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
392 164: 38 60 00 00 li r3,0 ; arg 0 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
393 168: 38 80 00 01 li r4,1 ; arg 1 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
394 16c: 38 a0 00 02 li r5,2 ; arg 2 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
395 170: 38 c0 00 03 li r6,3 ; arg 3 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
396 174: 38 e0 00 04 li r7,4 ; arg 4 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
397 178: e9 1f 00 80 ld r8,128(r31) ; | |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
398 17c: e9 3f 00 88 ld r9,136(r31) ; | arg 5 (struct, fetch from local area, pass as 2 doublewords) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
399 180: 39 40 00 08 li r10,8 ; arg 6 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
400 184: 48 00 00 01 bl 184 <.main+0x50> ; call and put return address -> lr |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
401 188: 38 00 00 00 li r0,0 ; return value ... |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
402 18c: 7c 03 03 78 mr r3,r0 ; ... in gpr3 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
403 190: e8 21 00 00 ld r1,0(r1) ; | |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
404 194: e8 01 00 10 ld r0,16(r1) ; | |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
405 198: 7c 08 03 a6 mtlr r0 ; | epilog |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
406 19c: eb e1 ff f8 ld r31,-8(r1) ; | |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
407 1a0: 4e 80 00 20 blr ; | |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
408 1a4: 00 00 00 00 .long 0x0 ; data |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
409 1a8: 00 00 00 01 .long 0x1 ; data |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
410 1ac: 80 01 00 01 lwz r0,1(r1) ; unsure@@@. data? |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
411 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
412 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
413 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
414 ; ---------- structs by value, complex example (multiple structs) ----------> |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
415 ; |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
416 ; struct A { int i, j; float f; }; |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
417 ; struct B { double d; long long l; }; |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
418 ; |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
419 ; void leaf_call(int b, struct A c, struct B d, int e, int f, struct A g, struct B h, int i, int j) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
420 ; { |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
421 ; } |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
422 ; |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
423 ; void nonleaf_call(int a, int b, struct A c, struct B d, int e, int f, struct A g, struct B h, int i, int j) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
424 ; { |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
425 ; /* use some local data */ |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
426 ; char l[100] = { 'L' }; |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
427 ; leaf_call(b, c, d, e, f, g, h, i, j); |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
428 ; } |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
429 ; |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
430 ; int main() |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
431 ; { |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
432 ; nonleaf_call(0, 1, (struct A){2, 3, 4.f}, (struct B){5., 6ll}, 7, 8, (struct A){9, 10, 11.f}, (struct B){12., 13ll}, 14, 15); |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
433 ; return 0; |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
434 ; } |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
435 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
436 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
437 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
438 ; output from freebsd-11.0-ppc64 w/ gcc 4.2.1 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
439 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
440 0000000000000000 <.leaf_call>: |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
441 0: fb e1 ff f8 std r31,-8(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
442 4: f8 21 ff c1 stdu r1,-64(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
443 8: 7c 3f 0b 78 mr r31,r1 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
444 c: f8 9f 00 78 std r4,120(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
445 10: f8 bf 00 80 std r5,128(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
446 14: 39 7f 00 88 addi r11,r31,136 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
447 18: f8 cb 00 00 std r6,0(r11) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
448 1c: f8 eb 00 08 std r7,8(r11) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
449 20: 7d 00 43 78 mr r0,r8 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
450 24: f9 5f 00 a8 std r10,168(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
451 28: 90 7f 00 70 stw r3,112(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
452 2c: 90 1f 00 98 stw r0,152(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
453 30: 91 3f 00 a0 stw r9,160(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
454 34: e8 21 00 00 ld r1,0(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
455 38: eb e1 ff f8 ld r31,-8(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
456 3c: 4e 80 00 20 blr |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
457 ... |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
458 48: 80 01 00 01 lwz r0,1(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
459 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
460 000000000000004c <.nonleaf_call>: |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
461 4c: 7c 08 02 a6 mflr r0 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
462 50: fb 81 ff e0 std r28,-32(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
463 54: fb a1 ff e8 std r29,-24(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
464 58: fb e1 ff f8 std r31,-8(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
465 5c: f8 01 00 10 std r0,16(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
466 60: f8 21 fe d1 stdu r1,-304(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
467 64: 7c 3f 0b 78 mr r31,r1 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
468 68: f8 bf 01 70 std r5,368(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
469 6c: f8 df 01 78 std r6,376(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
470 70: 39 7f 01 80 addi r11,r31,384 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
471 74: f8 eb 00 00 std r7,0(r11) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
472 78: f9 0b 00 08 std r8,8(r11) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
473 7c: 7d 20 4b 78 mr r0,r9 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
474 80: 7d 49 53 78 mr r9,r10 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
475 84: 90 7f 01 60 stw r3,352(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
476 88: 90 9f 01 68 stw r4,360(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
477 8c: 90 1f 01 90 stw r0,400(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
478 90: 91 3f 01 98 stw r9,408(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
479 94: 38 1f 00 a0 addi r0,r31,160 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
480 98: 39 20 00 64 li r9,100 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
481 9c: 7c 03 03 78 mr r3,r0 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
482 a0: 38 80 00 00 li r4,0 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
483 a4: 7d 25 4b 78 mr r5,r9 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
484 a8: 48 00 00 01 bl a8 <.nonleaf_call+0x5c> |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
485 ac: 4f ff fb 82 crmove 4*cr7+so,4*cr7+so |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
486 b0: 38 00 00 4c li r0,76 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
487 b4: 98 1f 00 a0 stb r0,160(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
488 b8: 80 1f 01 68 lwz r0,360(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
489 bc: 7c 08 07 b4 extsw r8,r0 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
490 c0: 80 1f 01 90 lwz r0,400(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
491 c4: 7c 1d 07 b4 extsw r29,r0 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
492 c8: 80 1f 01 98 lwz r0,408(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
493 cc: 7c 1c 07 b4 extsw r28,r0 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
494 d0: 39 3f 01 b0 addi r9,r31,432 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
495 d4: e9 49 00 08 ld r10,8(r9) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
496 d8: e9 29 00 00 ld r9,0(r9) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
497 dc: 39 61 00 78 addi r11,r1,120 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
498 e0: f9 2b 00 00 std r9,0(r11) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
499 e4: f9 4b 00 08 std r10,8(r11) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
500 e8: 80 1f 01 c4 lwz r0,452(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
501 ec: 7c 00 07 b4 extsw r0,r0 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
502 f0: f8 01 00 88 std r0,136(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
503 f4: 80 1f 01 cc lwz r0,460(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
504 f8: 7c 00 07 b4 extsw r0,r0 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
505 fc: f8 01 00 90 std r0,144(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
506 100: 80 1f 01 a8 lwz r0,424(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
507 104: 90 01 00 70 stw r0,112(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
508 108: e9 5f 01 a0 ld r10,416(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
509 10c: 7d 03 43 78 mr r3,r8 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
510 110: e8 9f 01 70 ld r4,368(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
511 114: e8 bf 01 78 ld r5,376(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
512 118: 39 3f 01 80 addi r9,r31,384 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
513 11c: e8 c9 00 00 ld r6,0(r9) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
514 120: e8 e9 00 08 ld r7,8(r9) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
515 124: 7f a8 eb 78 mr r8,r29 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
516 128: 7f 89 e3 78 mr r9,r28 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
517 12c: 48 00 00 01 bl 12c <.nonleaf_call+0xe0> |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
518 130: e8 21 00 00 ld r1,0(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
519 134: e8 01 00 10 ld r0,16(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
520 138: 7c 08 03 a6 mtlr r0 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
521 13c: eb 81 ff e0 ld r28,-32(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
522 140: eb a1 ff e8 ld r29,-24(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
523 144: eb e1 ff f8 ld r31,-8(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
524 148: 4e 80 00 20 blr |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
525 14c: 00 00 00 00 .long 0x0 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
526 150: 00 00 00 01 .long 0x1 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
527 154: 80 04 00 01 lwz r0,1(r4) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
528 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
529 0000000000000158 <.main>: |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
530 158: 7c 08 02 a6 mflr r0 ; | lr -> gpr0 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
531 15c: fb e1 ff f8 std r31,-8(r1) ; | preseve gpr31 (as used in func as helper addr) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
532 160: f8 01 00 10 std r0,16(r1) ; | prolog store lr |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
533 164: f8 21 ff 11 stdu r1,-240(r1) ; | open frame |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
534 168: 7c 3f 0b 78 mr r31,r1 ; use gpr31 as sort of frame pointer, below |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
535 16c: e9 22 00 00 ld r9,0(r2) ; | |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
536 170: e8 09 00 00 ld r0,0(r9) ; | fetch local first struct A data's 2 doublewords (r2 = TOC ptr) -> r9/r10, and ... |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
537 174: 81 29 00 08 lwz r9,8(r9) ; | |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
538 178: f8 1f 00 d0 std r0,208(r31) ; | ... write to local area on stack |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
539 17c: 91 3f 00 d8 stw r9,216(r31) ; / |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
540 180: e9 22 00 08 ld r9,8(r2) ; \ |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
541 184: e9 49 00 08 ld r10,8(r9) ; | fetch local first struct B data's 2 doublewords (r2 = TOC ptr) -> r9/r10, and ... |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
542 188: e9 29 00 00 ld r9,0(r9) ; | |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
543 18c: 39 7f 00 c0 addi r11,r31,192 ; | ... write to local area on stack |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
544 190: f9 2b 00 00 std r9,0(r11) ; | |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
545 194: f9 4b 00 08 std r10,8(r11) ; / |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
546 198: e9 22 00 10 ld r9,16(r2) ; \ |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
547 19c: e8 09 00 00 ld r0,0(r9) ; | fetch local second struct A data's 2 doublewords (r2 = TOC ptr) -> r9/r10, and ... |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
548 1a0: 81 29 00 08 lwz r9,8(r9) ; | |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
549 1a4: f8 1f 00 b0 std r0,176(r31) ; | ... write to local area on stack |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
550 1a8: 91 3f 00 b8 stw r9,184(r31) ; / |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
551 1ac: e9 22 00 18 ld r9,24(r2) ; \ |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
552 1b0: e9 49 00 08 ld r10,8(r9) ; | fetch local second struct B data's 2 doublewords (r2 = TOC ptr) -> r9/r10, and ... |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
553 1b4: e9 29 00 00 ld r9,0(r9) ; | |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
554 1b8: f9 3f 00 a0 std r9,160(r31) ; | ... write to local area on stack |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
555 1bc: f9 5f 00 a8 std r10,168(r31) ; / |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
556 1c0: e8 1f 00 b0 ld r0,176(r31) ; \ |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
557 1c4: 81 3f 00 b8 lwz r9,184(r31) ; | arg 6 (second struct A, fetch from local area, pushed onto stack, pass as 2 doublewords) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
558 1c8: f8 01 00 70 std r0,112(r1) ; | |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
559 1cc: 91 21 00 78 stw r9,120(r1) ; / |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
560 1d0: e9 3f 00 a0 ld r9,160(r31) ; \ |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
561 1d4: e9 5f 00 a8 ld r10,168(r31) ; | |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
562 1d8: 39 61 00 80 addi r11,r1,128 ; | arg 7 (second struct A, fetch from local area, pushed onto stack, pass as 2 doublewords) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
563 1dc: f9 2b 00 00 std r9,0(r11) ; | |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
564 1e0: f9 4b 00 08 std r10,8(r11) ; / |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
565 1e4: 38 00 00 0e li r0,14 ; arg 8, ... |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
566 1e8: f8 01 00 90 std r0,144(r1) ; ... "pushed" onto stack |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
567 1ec: 38 00 00 0f li r0,15 ; arg 9, ... |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
568 1f0: f8 01 00 98 std r0,152(r1) ; ... "pushed" onto stack |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
569 1f4: 38 60 00 00 li r3,0 ; arg 0 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
570 1f8: 38 80 00 01 li r4,1 ; arg 1 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
571 1fc: e8 bf 00 d0 ld r5,208(r31) ; | arg 2 (first struct A, fetch from local area, pass as 2 doublewords) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
572 200: e8 df 00 d8 ld r6,216(r31) ; / |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
573 204: 39 3f 00 c0 addi r9,r31,192 ; \ |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
574 208: e8 e9 00 00 ld r7,0(r9) ; | arg 3 (first struct B, fetch from local area, pass as 2 doublewords) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
575 20c: e9 09 00 08 ld r8,8(r9) ; | |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
576 210: 39 20 00 07 li r9,7 ; arg 4 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
577 214: 39 40 00 08 li r10,8 ; arg 5 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
578 218: 48 00 00 01 bl 218 <.main+0xc0> ; call and put return address -> lr |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
579 21c: 38 00 00 00 li r0,0 ; return value ... |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
580 220: 7c 03 03 78 mr r3,r0 ; ... in gpr3 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
581 224: e8 21 00 00 ld r1,0(r1) ; | |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
582 228: e8 01 00 10 ld r0,16(r1) ; | |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
583 22c: 7c 08 03 a6 mtlr r0 ; | epilog |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
584 230: eb e1 ff f8 ld r31,-8(r1) ; | |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
585 234: 4e 80 00 20 blr ; | |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
586 238: 00 00 00 00 .long 0x0 ; data |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
587 23c: 00 00 00 01 .long 0x1 ; data |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
588 240: 80 01 00 01 lwz r0,1(r1) ; unsure@@@. data? |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
589 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
590 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
591 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
592 ; ---------- returning qwords ----------> |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
593 ; |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
594 ; long long f() |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
595 ; { |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
596 ; return 7171LL; |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
597 ; } |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
598 ; |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
599 ; int main() |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
600 ; { |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
601 ; return (int)f(); |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
602 ; } |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
603 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
604 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
605 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
606 ; output from freebsd-11.0-ppc64 w/ gcc 4.2.1 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
607 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
608 0000000000000000 <.f>: |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
609 0: fb e1 ff f8 std r31,-8(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
610 4: f8 21 ff c1 stdu r1,-64(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
611 8: 7c 3f 0b 78 mr r31,r1 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
612 c: 38 00 1c 03 li r0,7171 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
613 10: 7c 03 03 78 mr r3,r0 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
614 14: e8 21 00 00 ld r1,0(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
615 18: eb e1 ff f8 ld r31,-8(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
616 1c: 4e 80 00 20 blr |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
617 ... |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
618 28: 80 01 00 01 lwz r0,1(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
619 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
620 000000000000002c <.main>: |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
621 2c: 7c 08 02 a6 mflr r0 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
622 30: fb e1 ff f8 std r31,-8(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
623 34: f8 01 00 10 std r0,16(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
624 38: f8 21 ff 81 stdu r1,-128(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
625 3c: 7c 3f 0b 78 mr r31,r1 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
626 40: 48 00 00 01 bl 40 <.main+0x14> |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
627 44: 7c 60 1b 78 mr r0,r3 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
628 48: 7c 00 07 b4 extsw r0,r0 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
629 4c: 7c 03 03 78 mr r3,r0 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
630 50: e8 21 00 00 ld r1,0(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
631 54: e8 01 00 10 ld r0,16(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
632 58: 7c 08 03 a6 mtlr r0 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
633 5c: eb e1 ff f8 ld r31,-8(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
634 60: 4e 80 00 20 blr |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
635 64: 00 00 00 00 .long 0x0 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
636 68: 00 00 00 01 .long 0x1 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
637 6c: 80 01 00 01 lwz r0,1(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
638 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
639 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
640 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
641 ; ---------- returning structs by value ----------> |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
642 ; |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
643 ; struct Small { char x; }; |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
644 ; struct Big { long long i; long j; }; |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
645 ; |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
646 ; struct Small f0() |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
647 ; { |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
648 ; struct Small s = { 132 }; |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
649 ; return s; |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
650 ; } |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
651 ; |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
652 ; struct Big f1() |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
653 ; { |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
654 ; struct Big b = { 7171LL, 232 }; |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
655 ; return b; |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
656 ; } |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
657 ; |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
658 ; int main() |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
659 ; { |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
660 ; struct Small s = f0(); |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
661 ; struct Big b = f1(); |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
662 ; return b.j + s.x; |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
663 ; } |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
664 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
665 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
666 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
667 ; output from freebsd-11.0-ppc64 w/ gcc 4.2.1 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
668 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
669 0000000000000000 <.f0>: |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
670 0: fb e1 ff f8 std r31,-8(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
671 4: f8 21 ff b1 stdu r1,-80(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
672 8: 7c 3f 0b 78 mr r31,r1 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
673 c: 7c 69 1b 78 mr r9,r3 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
674 10: 38 00 ff 84 li r0,-124 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
675 14: 98 1f 00 30 stb r0,48(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
676 18: 88 1f 00 30 lbz r0,48(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
677 1c: 98 09 00 00 stb r0,0(r9) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
678 20: 7d 23 4b 78 mr r3,r9 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
679 24: e8 21 00 00 ld r1,0(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
680 28: eb e1 ff f8 ld r31,-8(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
681 2c: 4e 80 00 20 blr |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
682 ... |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
683 38: 80 01 00 01 lwz r0,1(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
684 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
685 000000000000003c <.f1>: |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
686 3c: fb e1 ff f8 std r31,-8(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
687 40: f8 21 ff b1 stdu r1,-80(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
688 44: 7c 3f 0b 78 mr r31,r1 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
689 48: 7c 6b 1b 78 mr r11,r3 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
690 4c: e9 22 00 00 ld r9,0(r2) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
691 50: e9 49 00 08 ld r10,8(r9) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
692 54: e9 29 00 00 ld r9,0(r9) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
693 58: f9 3f 00 30 std r9,48(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
694 5c: f9 5f 00 38 std r10,56(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
695 60: e9 3f 00 30 ld r9,48(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
696 64: e9 5f 00 38 ld r10,56(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
697 68: f9 2b 00 00 std r9,0(r11) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
698 6c: f9 4b 00 08 std r10,8(r11) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
699 70: 7d 63 5b 78 mr r3,r11 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
700 74: e8 21 00 00 ld r1,0(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
701 78: eb e1 ff f8 ld r31,-8(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
702 7c: 4e 80 00 20 blr |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
703 ... |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
704 88: 80 01 00 01 lwz r0,1(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
705 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
706 000000000000008c <.main>: |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
707 8c: 7c 08 02 a6 mflr r0 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
708 90: fb e1 ff f8 std r31,-8(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
709 94: f8 01 00 10 std r0,16(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
710 98: f8 21 ff 61 stdu r1,-160(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
711 9c: 7c 3f 0b 78 mr r31,r1 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
712 a0: 38 1f 00 70 addi r0,r31,112 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
713 a4: 7c 03 03 78 mr r3,r0 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
714 a8: 48 00 00 01 bl a8 <.main+0x1c> |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
715 ac: 38 1f 00 78 addi r0,r31,120 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
716 b0: 7c 03 03 78 mr r3,r0 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
717 b4: 48 00 00 01 bl b4 <.main+0x28> |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
718 b8: e8 1f 00 80 ld r0,128(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
719 bc: 78 09 00 20 clrldi r9,r0,32 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
720 c0: 88 1f 00 70 lbz r0,112(r31) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
721 c4: 78 00 06 20 clrldi r0,r0,56 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
722 c8: 7c 09 02 14 add r0,r9,r0 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
723 cc: 78 00 00 20 clrldi r0,r0,32 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
724 d0: 7c 00 07 b4 extsw r0,r0 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
725 d4: 7c 03 03 78 mr r3,r0 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
726 d8: e8 21 00 00 ld r1,0(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
727 dc: e8 01 00 10 ld r0,16(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
728 e0: 7c 08 03 a6 mtlr r0 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
729 e4: eb e1 ff f8 ld r31,-8(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
730 e8: 4e 80 00 20 blr |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
731 ec: 00 00 00 00 .long 0x0 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
732 f0: 00 00 00 01 .long 0x1 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
733 f4: 80 01 00 01 lwz r0,1(r1) |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
734 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
735 |
ead041d93e36
- ppc doc and disas examples related to aggregates
Tassilo Philipp
parents:
331
diff
changeset
|
736 |
497
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
737 ; ---------- C++ trivial and non-trivial aggrs passed to C funcs ----------> |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
738 ; |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
739 ; struct Trivial { int a; }; |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
740 ; struct NonTrivial { int a; NonTrivial() : a(0) {} NonTrivial(const NonTrivial& rhs) : a(rhs.a) { } }; |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
741 ; |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
742 ; extern "C" { |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
743 ; |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
744 ; void f1(struct Trivial s) { } |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
745 ; void f2(struct NonTrivial s) { } |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
746 ; |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
747 ; void f() |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
748 ; { |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
749 ; struct Trivial t; |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
750 ; struct NonTrivial n; |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
751 ; int a=1; |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
752 ; a += 123; |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
753 ; f1(t); |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
754 ; a -= 123; |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
755 ; f2(n); |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
756 ; a -= 12; |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
757 ; } |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
758 ; } |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
759 |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
760 |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
761 |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
762 ; output from freebsd-11.0-ppc64 w/ gcc 4.2.1 |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
763 |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
764 0000000010000828 <.f1>: |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
765 10000828: fb e1 ff f8 std r31,-8(r1) |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
766 1000082c: f8 21 ff c1 stdu r1,-64(r1) |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
767 10000830: 7c 3f 0b 78 mr r31,r1 |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
768 10000834: 90 7f 00 70 stw r3,112(r31) |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
769 10000838: e8 21 00 00 ld r1,0(r1) |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
770 1000083c: eb e1 ff f8 ld r31,-8(r1) |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
771 10000840: 4e 80 00 20 blr |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
772 10000844: 00 00 00 00 .long 0x0 |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
773 10000848: 00 09 00 00 .long 0x90000 |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
774 1000084c: 80 01 00 01 lwz r0,1(r1) |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
775 |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
776 0000000010000850 <.f2>: |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
777 10000850: fb e1 ff f8 std r31,-8(r1) |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
778 10000854: f8 21 ff c1 stdu r1,-64(r1) |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
779 10000858: 7c 3f 0b 78 mr r31,r1 |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
780 1000085c: f8 7f 00 70 std r3,112(r31) |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
781 10000860: e8 21 00 00 ld r1,0(r1) |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
782 10000864: eb e1 ff f8 ld r31,-8(r1) |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
783 10000868: 4e 80 00 20 blr |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
784 1000086c: 00 00 00 00 .long 0x0 |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
785 10000870: 00 09 00 00 .long 0x90000 |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
786 10000874: 80 01 00 01 lwz r0,1(r1) |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
787 |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
788 0000000010000878 <.f>: |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
789 10000878: 7c 08 02 a6 mflr r0 ; |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
790 1000087c: fb e1 ff f8 std r31,-8(r1) ; |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
791 10000880: f8 01 00 10 std r0,16(r1) ; |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
792 10000884: f8 21 ff 71 stdu r1,-144(r1) ; |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
793 10000888: 7c 3f 0b 78 mr r31,r1 ; |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
794 1000088c: 38 1f 00 7c addi r0,r31,124 ; |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
795 10000890: 7c 03 03 78 mr r3,r0 ; |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
796 10000894: 48 00 00 ad bl 10000940 <._ZN10NonTrivialC1Ev> ; NonTrivial::NonTrivial() / ctor |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
797 10000898: 4f ff fb 82 crmove 4*cr7+so,4*cr7+so ; |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
798 1000089c: 38 00 00 01 li r0,1 ; |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
799 100008a0: 90 1f 00 70 stw r0,112(r31) ; |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
800 100008a4: 81 3f 00 70 lwz r9,112(r31) ; |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
801 100008a8: 38 09 00 7b addi r0,r9,123 ; |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
802 100008ac: 90 1f 00 70 stw r0,112(r31) ; |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
803 100008b0: 80 7f 00 78 lwz r3,120(r31) ; |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
804 100008b4: 4b ff ff 75 bl 10000828 <.f1> ; call f1(struct Trivial) |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
805 100008b8: 81 3f 00 70 lwz r9,112(r31) ; |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
806 100008bc: 38 09 ff 85 addi r0,r9,-123 ; |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
807 100008c0: 90 1f 00 70 stw r0,112(r31) ; |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
808 100008c4: 38 1f 00 74 addi r0,r31,116 ; |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
809 100008c8: 39 3f 00 7c addi r9,r31,124 ; |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
810 100008cc: 7c 03 03 78 mr r3,r0 ; | ptr to dest of copy of n |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
811 100008d0: 7d 24 4b 78 mr r4,r9 ; | copy n ptr to n |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
812 100008d4: 48 00 00 a1 bl 10000974 <._ZN10NonTrivialC1ERKS_> ; | NonTrivial::NonTrivial(const NonTrivial&) / copy ctor |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
813 100008d8: 4f ff fb 82 crmove 4*cr7+so,4*cr7+so ; |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
814 100008dc: 38 1f 00 74 addi r0,r31,116 ; | |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
815 100008e0: 7c 03 03 78 mr r3,r0 ; | f2 arg 0 (ptr to copy of struct NonTrivial), via ptr as non-trivial |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
816 100008e4: 4b ff ff 6d bl 10000850 <.f2> ; call f2(struct NonTrivial) |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
817 100008e8: 81 3f 00 70 lwz r9,112(r31) ; |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
818 100008ec: 38 09 ff f4 addi r0,r9,-12 ; |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
819 100008f0: 90 1f 00 70 stw r0,112(r31) ; |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
820 100008f4: e8 21 00 00 ld r1,0(r1) ; |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
821 100008f8: e8 01 00 10 ld r0,16(r1) ; |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
822 100008fc: 7c 08 03 a6 mtlr r0 ; |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
823 10000900: eb e1 ff f8 ld r31,-8(r1) ; |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
824 10000904: 4e 80 00 20 blr ; |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
825 10000908: 00 00 00 00 .long 0x0 ; |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
826 1000090c: 00 09 00 01 .long 0x90001 ; |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
827 10000910: 80 01 00 01 lwz r0,1(r1) ; |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
828 |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
829 ; ... snip, removed code of ctor and copy ctor ... |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
830 |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
831 |
cb19b2fe2422
- more disas examples to check behaviour of passing C++ non-trivial aggregates by value; they all behave the same, calling the copy ctor first, passing a pointer then
Tassilo Philipp
parents:
473
diff
changeset
|
832 |
327
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
833 ; vim: ft=asm |
c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff
changeset
|
834 |