annotate doc/disas_examples/sparc.sparc.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 c73c59c8b553
children fc614cb865c6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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 debian-4.0_r3-sparc w/ gcc 4.1.2
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 00000000 <leaf_call>:
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
25 0: 9d e3 bf 98 save %sp, -104, %sp
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
26 4: f0 27 a0 44 st %i0, [ %fp + 0x44 ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
27 8: f2 27 a0 48 st %i1, [ %fp + 0x48 ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
28 c: f4 27 a0 4c st %i2, [ %fp + 0x4c ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
29 10: f6 27 a0 50 st %i3, [ %fp + 0x50 ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
30 14: f8 27 a0 54 st %i4, [ %fp + 0x54 ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
31 18: fa 27 a0 58 st %i5, [ %fp + 0x58 ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
32 1c: 81 e8 00 00 restore
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
33 20: 81 c3 e0 08 retl
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
34 24: 01 00 00 00 nop
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
35
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
36 00000028 <nonleaf_call>:
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
37 28: 9d e3 bf 88 save %sp, -120, %sp ; prolog
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
38 2c: f0 27 a0 44 st %i0, [ %fp + 0x44 ] ; |
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
39 30: f2 27 a0 48 st %i1, [ %fp + 0x48 ] ; |
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
40 34: f4 27 a0 4c st %i2, [ %fp + 0x4c ] ; | write input to prev frame's spill area
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
41 38: f6 27 a0 50 st %i3, [ %fp + 0x50 ] ; | (e.g. offset = 68 for i0, jumping over i*/l* save area and aggregate return pointer)
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
42 3c: f8 27 a0 54 st %i4, [ %fp + 0x54 ] ; |
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
43 40: fa 27 a0 58 st %i5, [ %fp + 0x58 ] ; |
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
44 44: 9c 03 bf 20 add %sp, -224, %sp ; alloca(220) - with 4b padding (multiple of 8), and ...
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
45 48: 82 03 a0 64 add %sp, 0x64, %g1 ; ... at least 100b at top of stack, via ...
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
46 4c: c2 27 bf f4 st %g1, [ %fp + -12 ] ; ... local space (pointlessly) ...
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
47 50: c4 07 bf f4 ld [ %fp + -12 ], %g2 ; ... to g2
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
48 54: 82 00 a0 07 add %g2, 7, %g1 ; |
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
49 58: 83 30 60 03 srl %g1, 3, %g1 ; | 8b alignment of alloca()'d space pointed to by g1
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
50 5c: 83 28 60 03 sll %g1, 3, %g1 ; |
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
51 60: c2 27 bf f4 st %g1, [ %fp + -12 ] ; free g1 again by copy via temp space, ...
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
52 64: c4 07 bf f4 ld [ %fp + -12 ], %g2 ; ... to g2
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
53 68: 82 10 20 4c mov 0x4c, %g1 ; 'L' -> g1, and ...
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
54 6c: c2 28 80 00 stb %g1, [ %g2 ] ; ... store in aligned alloca()'d space
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
55 70: c2 07 a0 60 ld [ %fp + 0x60 ], %g1 ; arg 6 (fetched from prev frame's stack param area), and ...
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
56 74: c2 23 a0 5c st %g1, [ %sp + 0x5c ] ; ... "pushed" onto stack
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
57 78: d0 07 a0 48 ld [ %fp + 0x48 ], %o0 ; |
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
58 7c: d2 07 a0 4c ld [ %fp + 0x4c ], %o1 ; |
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
59 80: d4 07 a0 50 ld [ %fp + 0x50 ], %o2 ; |
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
60 84: d6 07 a0 54 ld [ %fp + 0x54 ], %o3 ; | arg 0,1,2,3,4 (fetched from prev frame's spill area)
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
61 88: d8 07 a0 58 ld [ %fp + 0x58 ], %o4 ; |
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
62 8c: da 07 a0 5c ld [ %fp + 0x5c ], %o5 ; arg 5 (fetched from prev frame's stack param area)
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
63 90: 40 00 00 00 call 90 <nonleaf_call+0x68> ; call leaf_call (objdump not from final link but .o)
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
64 94: 01 00 00 00 nop ; branch delay slot
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
65 98: 81 e8 00 00 restore ; |
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
66 9c: 81 c3 e0 08 retl ; | epilog
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
67 a0: 01 00 00 00 nop ; | branch delay slot
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
68
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
69 000000a4 <main>:
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
70 a4: 9d e3 bf 90 save %sp, -112, %sp ; prolog
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
71 a8: 82 10 20 06 mov 6, %g1 ; arg 6, ...
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
72 ac: c2 23 a0 5c st %g1, [ %sp + 0x5c ] ; ... "pushed" onto stack
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
73 b0: 82 10 20 07 mov 7, %g1 ; arg 7, ...
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
74 b4: c2 23 a0 60 st %g1, [ %sp + 0x60 ] ; ... "pushed" onto stack
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
75 b8: 90 10 20 00 clr %o0 ; arg 0
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
76 bc: 92 10 20 01 mov 1, %o1 ; arg 1
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
77 c0: 94 10 20 02 mov 2, %o2 ; arg 2
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
78 c4: 96 10 20 03 mov 3, %o3 ; arg 3
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
79 c8: 98 10 20 04 mov 4, %o4 ; arg 4
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
80 cc: 9a 10 20 05 mov 5, %o5 ; arg 5
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
81 d0: 40 00 00 00 call d0 <main+0x2c> ; call nonleaf_call (objdump not from final link but .o)
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
82 d4: 01 00 00 00 nop ; branch delay slot
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
83 d8: 82 10 20 00 clr %g1 ! 0 <leaf_call> ; |
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
84 dc: b0 10 00 01 mov %g1, %i0 ; / return value
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
85 e0: 81 e8 00 00 restore ; \
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
86 e4: 81 c3 e0 08 retl ; | epilog
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
87 e8: 01 00 00 00 nop ; | branch delay slot
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
88
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
89
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
90
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
91 ; output from netbsd-6.0-sparc w/ gcc 4.5.3
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
92
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
93 00000000 <leaf_call>:
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
94 0: 9d e3 bf a0 save %sp, -96, %sp
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
95 4: f0 27 a0 44 st %i0, [ %fp + 0x44 ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
96 8: f2 27 a0 48 st %i1, [ %fp + 0x48 ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
97 c: f4 27 a0 4c st %i2, [ %fp + 0x4c ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
98 10: f6 27 a0 50 st %i3, [ %fp + 0x50 ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
99 14: f8 27 a0 54 st %i4, [ %fp + 0x54 ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
100 18: fa 27 a0 58 st %i5, [ %fp + 0x58 ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
101 1c: 81 e8 00 00 restore
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
102 20: 81 c3 e0 08 retl
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
103 24: 01 00 00 00 nop
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
104
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
105 00000028 <nonleaf_call>:
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
106 28: 9d e3 bf 98 save %sp, -104, %sp
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
107 2c: f0 27 a0 44 st %i0, [ %fp + 0x44 ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
108 30: f2 27 a0 48 st %i1, [ %fp + 0x48 ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
109 34: f4 27 a0 4c st %i2, [ %fp + 0x4c ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
110 38: f6 27 a0 50 st %i3, [ %fp + 0x50 ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
111 3c: f8 27 a0 54 st %i4, [ %fp + 0x54 ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
112 40: fa 27 a0 58 st %i5, [ %fp + 0x58 ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
113 44: 9c 03 bf 20 add %sp, -224, %sp
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
114 48: 82 03 a0 64 add %sp, 0x64, %g1
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
115 4c: 82 00 60 07 add %g1, 7, %g1
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
116 50: 83 30 60 03 srl %g1, 3, %g1
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
117 54: 83 28 60 03 sll %g1, 3, %g1
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
118 58: 84 10 20 4c mov 0x4c, %g2
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
119 5c: c4 28 40 00 stb %g2, [ %g1 ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
120 60: c2 07 a0 60 ld [ %fp + 0x60 ], %g1
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
121 64: c2 23 a0 5c st %g1, [ %sp + 0x5c ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
122 68: d0 07 a0 48 ld [ %fp + 0x48 ], %o0
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
123 6c: d2 07 a0 4c ld [ %fp + 0x4c ], %o1
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
124 70: d4 07 a0 50 ld [ %fp + 0x50 ], %o2
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
125 74: d6 07 a0 54 ld [ %fp + 0x54 ], %o3
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
126 78: d8 07 a0 58 ld [ %fp + 0x58 ], %o4
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
127 7c: da 07 a0 5c ld [ %fp + 0x5c ], %o5
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
128 80: 40 00 00 00 call 80 <nonleaf_call+0x58>
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
129 84: 01 00 00 00 nop
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
130 88: 81 e8 00 00 restore
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
131 8c: 81 c3 e0 08 retl
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
132 90: 01 00 00 00 nop
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
133
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
134 00000094 <main>:
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
135 94: 9d e3 bf 98 save %sp, -104, %sp
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
136 98: 82 10 20 06 mov 6, %g1
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
137 9c: c2 23 a0 5c st %g1, [ %sp + 0x5c ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
138 a0: 82 10 20 07 mov 7, %g1
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
139 a4: c2 23 a0 60 st %g1, [ %sp + 0x60 ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
140 a8: 90 10 20 00 clr %o0
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
141 ac: 92 10 20 01 mov 1, %o1
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
142 b0: 94 10 20 02 mov 2, %o2
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
143 b4: 96 10 20 03 mov 3, %o3
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
144 b8: 98 10 20 04 mov 4, %o4
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
145 bc: 9a 10 20 05 mov 5, %o5
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
146 c0: 40 00 00 00 call c0 <main+0x2c>
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
147 c4: 01 00 00 00 nop
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
148 c8: 82 10 20 00 clr %g1 ! 0 <leaf_call>
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
149 cc: b0 10 00 01 mov %g1, %i0
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
150 d0: 81 e8 00 00 restore
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
151 d4: 81 c3 e0 08 retl
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
152 d8: 01 00 00 00 nop
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
153
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
154
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
155
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
156 ; output from openbsd-5.8-sparc w/ gcc 4.2.1
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
157
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
158 00000000 <leaf_call>:
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
159 0: 9d e3 bf 90 save %sp, -112, %sp
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
160 4: f0 27 a0 44 st %i0, [ %fp + 0x44 ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
161 8: f2 27 a0 48 st %i1, [ %fp + 0x48 ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
162 c: f4 27 a0 4c st %i2, [ %fp + 0x4c ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
163 10: f6 27 a0 50 st %i3, [ %fp + 0x50 ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
164 14: f8 27 a0 54 st %i4, [ %fp + 0x54 ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
165 18: fa 27 a0 58 st %i5, [ %fp + 0x58 ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
166 1c: 81 e8 00 00 restore
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
167 20: 81 c3 e0 08 retl
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
168 24: 01 00 00 00 nop
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
169 28: ae 03 c0 17 add %o7, %l7, %l7
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
170 2c: 81 c3 e0 08 retl
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
171 30: 01 00 00 00 nop
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
172
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
173 00000034 <nonleaf_call>:
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
174 34: 9d e3 bf 80 save %sp, -128, %sp
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
175 38: 2f 00 00 00 sethi %hi(0), %l7
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
176 3c: ae 05 e0 00 add %l7, 0, %l7 ! 0 <leaf_call>
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
177 40: 7f ff ff fa call 28 <leaf_call+0x28>
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
178 44: 01 00 00 00 nop
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
179 48: f0 27 a0 44 st %i0, [ %fp + 0x44 ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
180 4c: f2 27 a0 48 st %i1, [ %fp + 0x48 ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
181 50: f4 27 a0 4c st %i2, [ %fp + 0x4c ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
182 54: f6 27 a0 50 st %i3, [ %fp + 0x50 ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
183 58: f8 27 a0 54 st %i4, [ %fp + 0x54 ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
184 5c: fa 27 a0 58 st %i5, [ %fp + 0x58 ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
185 60: 03 00 00 00 sethi %hi(0), %g1
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
186 64: 82 10 60 00 mov %g1, %g1 ! 0 <leaf_call>
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
187 68: c2 05 c0 01 ld [ %l7 + %g1 ], %g1
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
188 6c: c4 00 40 00 ld [ %g1 ], %g2
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
189 70: c4 27 bf f4 st %g2, [ %fp + -12 ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
190 74: 84 10 20 00 clr %g2
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
191 78: 9c 03 bf 20 add %sp, -224, %sp
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
192 7c: 86 03 a0 64 add %sp, 0x64, %g3
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
193 80: c6 27 bf ec st %g3, [ %fp + -20 ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
194 84: c4 07 bf ec ld [ %fp + -20 ], %g2
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
195 88: 82 00 a0 07 add %g2, 7, %g1
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
196 8c: 83 30 60 03 srl %g1, 3, %g1
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
197 90: 83 28 60 03 sll %g1, 3, %g1
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
198 94: c2 27 bf ec st %g1, [ %fp + -20 ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
199 98: c4 07 bf ec ld [ %fp + -20 ], %g2
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
200 9c: 82 10 20 4c mov 0x4c, %g1
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
201 a0: c2 28 80 00 stb %g1, [ %g2 ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
202 a4: c2 07 a0 60 ld [ %fp + 0x60 ], %g1
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
203 a8: c2 23 a0 5c st %g1, [ %sp + 0x5c ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
204 ac: d0 07 a0 48 ld [ %fp + 0x48 ], %o0
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
205 b0: d2 07 a0 4c ld [ %fp + 0x4c ], %o1
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
206 b4: d4 07 a0 50 ld [ %fp + 0x50 ], %o2
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
207 b8: d6 07 a0 54 ld [ %fp + 0x54 ], %o3
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
208 bc: d8 07 a0 58 ld [ %fp + 0x58 ], %o4
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
209 c0: da 07 a0 5c ld [ %fp + 0x5c ], %o5
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
210 c4: 40 00 00 00 call c4 <nonleaf_call+0x90>
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
211 c8: 01 00 00 00 nop
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
212 cc: 03 00 00 00 sethi %hi(0), %g1
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
213 d0: 82 10 60 00 mov %g1, %g1 ! 0 <leaf_call>
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
214 d4: c2 05 c0 01 ld [ %l7 + %g1 ], %g1
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
215 d8: c6 07 bf f4 ld [ %fp + -12 ], %g3
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
216 dc: c4 00 40 00 ld [ %g1 ], %g2
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
217 e0: 86 98 c0 02 xorcc %g3, %g2, %g3
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
218 e4: 84 10 20 00 clr %g2
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
219 e8: 02 80 00 08 be 108 <nonleaf_call+0xd4>
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
220 ec: 01 00 00 00 nop
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
221 f0: 03 00 00 00 sethi %hi(0), %g1
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
222 f4: 82 10 60 00 mov %g1, %g1 ! 0 <leaf_call>
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
223 f8: c2 05 c0 01 ld [ %l7 + %g1 ], %g1
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
224 fc: 90 10 00 01 mov %g1, %o0
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
225 100: 40 00 00 00 call 100 <nonleaf_call+0xcc>
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
226 104: 01 00 00 00 nop
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
227 108: 81 e8 00 00 restore
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
228 10c: 81 c3 e0 08 retl
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
229 110: 01 00 00 00 nop
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
230
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
231 00000114 <main>:
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
232 114: 9d e3 bf 88 save %sp, -120, %sp
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
233 118: 82 10 20 06 mov 6, %g1
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
234 11c: c2 23 a0 5c st %g1, [ %sp + 0x5c ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
235 120: 82 10 20 07 mov 7, %g1
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
236 124: c2 23 a0 60 st %g1, [ %sp + 0x60 ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
237 128: 90 10 20 00 clr %o0
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
238 12c: 92 10 20 01 mov 1, %o1
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
239 130: 94 10 20 02 mov 2, %o2
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
240 134: 96 10 20 03 mov 3, %o3
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
241 138: 98 10 20 04 mov 4, %o4
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
242 13c: 9a 10 20 05 mov 5, %o5
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
243 140: 40 00 00 00 call 140 <main+0x2c>
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
244 144: 01 00 00 00 nop
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
245 148: 82 10 20 00 clr %g1 ! 0 <leaf_call>
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
246 14c: b0 10 00 01 mov %g1, %i0
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
247 150: 81 e8 00 00 restore
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
248 154: 81 c3 e0 08 retl
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
249 158: 01 00 00 00 nop
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
250
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
251
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
252
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
253 ; --------------------- with float params and aggregate return value ------------------->
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
254
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
255 ; #include <stdlib.h>
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
256 ;
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
257 ; void leaf_call(int b, float c, int d, float 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
258 ; {
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
259 ; }
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
260 ;
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
261 ; struct aggr { int x; int y; int z; };
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
262 ;
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
263 ; struct aggr nonleaf_call(int a, int b, float c, int d, float 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
264 ; {
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
265 ; struct aggr st = { b, d, f };
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
266 ; /* use some local data */
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
267 ; *(char*)alloca(220) = 'L';
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
268 ; 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
269 ;
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
270 ; return st;
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
271 ; }
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
272 ;
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
273 ; int main()
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
274 ; {
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
275 ; struct aggr st = nonleaf_call(0, 1, 2.f, 3, 4.f, 5, 6, 7);
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
276 ; return 0;
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
277 ; }
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
278
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
279
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
280
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
281 ; output from debian-4.0_r3-sparc w/ gcc 4.1.2
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
282
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
283 00000000 <leaf_call>:
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
284 0: 9d e3 bf 98 save %sp, -104, %sp
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
285 4: f0 27 a0 44 st %i0, [ %fp + 0x44 ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
286 8: f2 27 a0 48 st %i1, [ %fp + 0x48 ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
287 c: f4 27 a0 4c st %i2, [ %fp + 0x4c ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
288 10: f6 27 a0 50 st %i3, [ %fp + 0x50 ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
289 14: f8 27 a0 54 st %i4, [ %fp + 0x54 ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
290 18: fa 27 a0 58 st %i5, [ %fp + 0x58 ]
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
291 1c: 81 e8 00 00 restore
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
292 20: 81 c3 e0 08 retl
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
293 24: 01 00 00 00 nop
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
294
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
295 00000028 <nonleaf_call>:
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
296 28: 9d e3 bf 78 save %sp, -136, %sp ; prolog
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
297 2c: e0 07 a0 40 ld [ %fp + 0x40 ], %l0 ; pointer to struct to return -> l0
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
298 30: f0 27 a0 44 st %i0, [ %fp + 0x44 ] ; |
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
299 34: f2 27 a0 48 st %i1, [ %fp + 0x48 ] ; |
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
300 38: f4 27 a0 4c st %i2, [ %fp + 0x4c ] ; |
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
301 3c: f6 27 a0 50 st %i3, [ %fp + 0x50 ] ; | write input to prev frame's spill area
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
302 40: f8 27 a0 54 st %i4, [ %fp + 0x54 ] ; |
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
303 44: fa 27 a0 58 st %i5, [ %fp + 0x58 ] ; /
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
304 48: c2 07 a0 48 ld [ %fp + 0x48 ], %g1 ; \
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
305 4c: c2 27 bf ec st %g1, [ %fp + -20 ] ; |
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
306 50: c2 07 a0 50 ld [ %fp + 0x50 ], %g1 ; | in arg 1,3,5 (the ints to be returned in struct), ...
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
307 54: c2 27 bf f0 st %g1, [ %fp + -16 ] ; | ... copied to temp space in local area for later use
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
308 58: c2 07 a0 58 ld [ %fp + 0x58 ], %g1 ; |
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
309 5c: c2 27 bf f4 st %g1, [ %fp + -12 ] ; |
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
310 60: 9c 03 bf 20 add %sp, -224, %sp ; alloca(220) - with 4b padding (multiple of 8), and ...
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
311 64: 82 03 a0 64 add %sp, 0x64, %g1 ; ... at least 100b at top of stack, via ...
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
312 68: c2 27 bf e4 st %g1, [ %fp + -28 ] ; ... local space (pointlessly) ...
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
313 6c: c4 07 bf e4 ld [ %fp + -28 ], %g2 ; ... to g2
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
314 70: 82 00 a0 07 add %g2, 7, %g1 ; |
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
315 74: 83 30 60 03 srl %g1, 3, %g1 ; | 8b alignment of alloca()'d space pointed to by g1
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
316 78: 83 28 60 03 sll %g1, 3, %g1 ; |
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
317 7c: c2 27 bf e4 st %g1, [ %fp + -28 ] ; free g1 again by copy via temp space, ...
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
318 80: c4 07 bf e4 ld [ %fp + -28 ], %g2 ; ... to g2
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
319 84: 82 10 20 4c mov 0x4c, %g1 ; 'L' -> g1, and ...
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
320 88: c2 28 80 00 stb %g1, [ %g2 ] ; ... store in aligned alloca()'d space
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
321 8c: c2 07 a0 60 ld [ %fp + 0x60 ], %g1 ; arg 6 (fetched from prev frame's stack param area), and ...
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
322 90: c2 23 a0 5c st %g1, [ %sp + 0x5c ] ; ... "pushed" onto stack
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
323 94: d0 07 a0 48 ld [ %fp + 0x48 ], %o0 ; |
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
324 98: d2 07 a0 4c ld [ %fp + 0x4c ], %o1 ; |
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
325 9c: d4 07 a0 50 ld [ %fp + 0x50 ], %o2 ; | arg 0,1,2,3,4 (fetched from prev frame's spill area)
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
326 a0: d6 07 a0 54 ld [ %fp + 0x54 ], %o3 ; |
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
327 a4: d8 07 a0 58 ld [ %fp + 0x58 ], %o4 ; |
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
328 a8: da 07 a0 5c ld [ %fp + 0x5c ], %o5 ; arg 5 (fetched from prev frame's stack param area)
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
329 ac: 40 00 00 00 call ac <nonleaf_call+0x84> ; call leaf_call (objdump not from final link but .o)
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
330 b0: 01 00 00 00 nop ; branch delay slot
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
331 b4: c2 07 bf ec ld [ %fp + -20 ], %g1 ; |
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
332 b8: c2 24 00 00 st %g1, [ %l0 ] ; |
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
333 bc: c2 07 bf f0 ld [ %fp + -16 ], %g1 ; |
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
334 c0: c2 24 20 04 st %g1, [ %l0 + 4 ] ; | store struct elements
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
335 c4: c2 07 bf f4 ld [ %fp + -12 ], %g1 ; |
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
336 c8: c2 24 20 08 st %g1, [ %l0 + 8 ] ; |
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
337 cc: b0 10 00 10 mov %l0, %i0 ; return value (pointer to struct)
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
338 d0: 81 e8 00 00 restore ; |
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
339 d4: 81 c3 e0 0c jmp %o7 + 0xc ; | epilog
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
340 d8: 01 00 00 00 nop ; | branch delay slot
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
341
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
342 000000dc <main>:
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
343 dc: 9d e3 bf 80 save %sp, -128, %sp ; prolog
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
344 e0: 03 00 00 00 sethi %hi(0), %g1 ; |
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
345 e4: 82 10 60 00 mov %g1, %g1 ! 0 <leaf_call> ; | prep arg 2, load from static data into f8 (addr = 0 b/c objdumped .o, not final linked)
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
346 e8: d1 00 40 00 ld [ %g1 ], %f8 ; /
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
347 ec: 03 00 00 00 sethi %hi(0), %g1 ; \
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
348 f0: 82 10 60 00 mov %g1, %g1 ! 0 <leaf_call> ; | prep arg 4, load from static data into f9 (addr = 0 b/c objdumped .o, not final linked)
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
349 f4: d3 00 40 00 ld [ %g1 ], %f9 ; |
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
350 f8: 82 10 20 06 mov 6, %g1 ; arg 6, ...
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
351 fc: c2 23 a0 5c st %g1, [ %sp + 0x5c ] ; ... "pushed" onto stack
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
352 100: 82 10 20 07 mov 7, %g1 ; arg 7, ...
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
353 104: c2 23 a0 60 st %g1, [ %sp + 0x60 ] ; ... "pushed" onto stack
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
354 108: 82 07 bf ec add %fp, -20, %g1 ; store pointer to some frame local data between ...
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
355 10c: c2 23 a0 40 st %g1, [ %sp + 0x40 ] ; ... spill and i*/l* save area to be used for struct return value
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
356 110: 90 10 20 00 clr %o0 ; arg 0
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
357 114: 92 10 20 01 mov 1, %o1 ; arg 1
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
358 118: d1 27 bf f8 st %f8, [ %fp + -8 ] ; | arg 2, from f8 via temp space ...
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
359 11c: d4 07 bf f8 ld [ %fp + -8 ], %o2 ; | ... to o2
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
360 120: 96 10 20 03 mov 3, %o3 ; arg 3
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
361 124: d3 27 bf f8 st %f9, [ %fp + -8 ] ; | arg 4, from f9 via temp space ...
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
362 128: d8 07 bf f8 ld [ %fp + -8 ], %o4 ; | ... to o4
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
363 12c: 9a 10 20 05 mov 5, %o5 ; arg 5
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
364 130: 40 00 00 00 call 130 <main+0x54> ; call nonleaf_call (objdump not from final link but .o)
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
365 134: 01 00 00 00 nop ; branch delay slot
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
366 138: 00 00 00 0c unimp 0xc ; sparc convention for returned aggregates: use unimp with field (here 0xc) specifiying size of returned struct (see sparc manual explanation)
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
367 13c: 82 10 20 00 clr %g1 ; |
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
368 140: b0 10 00 01 mov %g1, %i0 ; / return value
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
369 144: 81 e8 00 00 restore ; \
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
370 148: 81 c3 e0 08 retl ; | epilog
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
371 14c: 01 00 00 00 nop ; | branch delay slot
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
372
476
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
373
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
374
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
375
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
376 ; ---------- structs by value ---------->
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
377 ;
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
378 ; struct A { int i, j; long long l; };
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
379 ;
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
380 ; void leaf_call(int b, int c, int d, int e, struct A f, int g, int h)
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
381 ; {
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
382 ; }
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
383 ;
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
384 ; void nonleaf_call(int a, int b, int c, int d, int e, struct A f, int g, int h)
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
385 ; {
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
386 ; /* use some local data */
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
387 ; char l[100] ={ 'L'};
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
388 ; leaf_call(b, c, d, e, f, g, h);
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
389 ; }
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
390 ;
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
391 ; int main()
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
392 ; {
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
393 ; nonleaf_call(0, 1, 2, 3, 4, (struct A){5, 6, 7ll}, 8, 9);
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
394 ; return 0;
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
395 ; }
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
396
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
397
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
398 ; output from debian-4.0_r3-sparc w/ gcc 4.1.2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
399
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
400 00000000 <leaf_call>:
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
401 0: 9d e3 bf 98 save %sp, -104, %sp
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
402 4: f0 27 a0 44 st %i0, [ %fp + 0x44 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
403 8: f2 27 a0 48 st %i1, [ %fp + 0x48 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
404 c: f4 27 a0 4c st %i2, [ %fp + 0x4c ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
405 10: f6 27 a0 50 st %i3, [ %fp + 0x50 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
406 14: fa 27 a0 58 st %i5, [ %fp + 0x58 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
407 18: 81 e8 00 00 restore
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
408 1c: 81 c3 e0 08 retl
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
409 20: 01 00 00 00 nop
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
410
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
411 00000024 <nonleaf_call>:
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
412 24: 9d e3 bf 18 save %sp, -232, %sp
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
413 28: f0 27 a0 44 st %i0, [ %fp + 0x44 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
414 2c: f2 27 a0 48 st %i1, [ %fp + 0x48 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
415 30: f4 27 a0 4c st %i2, [ %fp + 0x4c ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
416 34: f6 27 a0 50 st %i3, [ %fp + 0x50 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
417 38: f8 27 a0 54 st %i4, [ %fp + 0x54 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
418 3c: a0 10 00 1d mov %i5, %l0
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
419 40: 82 07 bf 94 add %fp, -108, %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
420 44: 84 10 20 64 mov 0x64, %g2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
421 48: 90 10 00 01 mov %g1, %o0
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
422 4c: 92 10 20 00 clr %o1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
423 50: 94 10 00 02 mov %g2, %o2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
424 54: 40 00 00 00 call 54 <nonleaf_call+0x30>
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
425 58: 01 00 00 00 nop
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
426 5c: 82 10 20 4c mov 0x4c, %g1 ! 4c <nonleaf_call+0x28>
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
427 60: c2 2f bf 94 stb %g1, [ %fp + -108 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
428 64: c4 1c 00 00 ldd [ %l0 ], %g2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
429 68: c4 3f bf 80 std %g2, [ %fp + -128 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
430 6c: c4 1c 20 08 ldd [ %l0 + 8 ], %g2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
431 70: c4 3f bf 88 std %g2, [ %fp + -120 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
432 74: 84 07 bf 80 add %fp, -128, %g2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
433 78: c2 07 a0 60 ld [ %fp + 0x60 ], %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
434 7c: c2 23 a0 5c st %g1, [ %sp + 0x5c ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
435 80: d0 07 a0 48 ld [ %fp + 0x48 ], %o0
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
436 84: d2 07 a0 4c ld [ %fp + 0x4c ], %o1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
437 88: d4 07 a0 50 ld [ %fp + 0x50 ], %o2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
438 8c: d6 07 a0 54 ld [ %fp + 0x54 ], %o3
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
439 90: 98 10 00 02 mov %g2, %o4
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
440 94: da 07 a0 5c ld [ %fp + 0x5c ], %o5
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
441 98: 40 00 00 00 call 98 <nonleaf_call+0x74>
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
442 9c: 01 00 00 00 nop
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
443 a0: 81 e8 00 00 restore
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
444 a4: 81 c3 e0 08 retl
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
445 a8: 01 00 00 00 nop
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
446
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
447 000000ac <main>:
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
448 ac: 9d e3 bf 70 save %sp, -144, %sp
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
449 b0: 82 10 20 05 mov 5, %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
450 b4: c2 27 bf e8 st %g1, [ %fp + -24 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
451 b8: 82 10 20 06 mov 6, %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
452 bc: c2 27 bf ec st %g1, [ %fp + -20 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
453 c0: 84 10 20 00 clr %g2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
454 c4: 86 10 20 07 mov 7, %g3
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
455 c8: c4 3f bf f0 std %g2, [ %fp + -16 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
456 cc: c4 1f bf e8 ldd [ %fp + -24 ], %g2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
457 d0: c4 3f bf d8 std %g2, [ %fp + -40 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
458 d4: c4 1f bf f0 ldd [ %fp + -16 ], %g2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
459 d8: c4 3f bf e0 std %g2, [ %fp + -32 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
460 dc: 84 07 bf d8 add %fp, -40, %g2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
461 e0: 82 10 20 08 mov 8, %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
462 e4: c2 23 a0 5c st %g1, [ %sp + 0x5c ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
463 e8: 82 10 20 09 mov 9, %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
464 ec: c2 23 a0 60 st %g1, [ %sp + 0x60 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
465 f0: 90 10 20 00 clr %o0
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
466 f4: 92 10 20 01 mov 1, %o1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
467 f8: 94 10 20 02 mov 2, %o2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
468 fc: 96 10 20 03 mov 3, %o3
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
469 100: 98 10 20 04 mov 4, %o4
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
470 104: 9a 10 00 02 mov %g2, %o5
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
471 108: 40 00 00 00 call 108 <main+0x5c>
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
472 10c: 01 00 00 00 nop
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
473 110: 82 10 20 00 clr %g1 ! 0 <leaf_call>
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
474 114: b0 10 00 01 mov %g1, %i0
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
475 118: 81 e8 00 00 restore
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
476 11c: 81 c3 e0 08 retl
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
477 120: 01 00 00 00 nop
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
478
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
479
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
480
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
481 ; ---------- structs by value, complex example (multiple structs) ---------->
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
482 ;
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
483 ; struct A { int i, j; float f; };
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
484 ; struct B { double d; long long l; };
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
485 ;
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
486 ; 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)
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
487 ; {
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
488 ; }
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
489 ;
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
490 ; 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)
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
491 ; {
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
492 ; /* use some local data */
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
493 ; char l[100] ={ 'L'};
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
494 ; leaf_call(b, c, d, e, f, g, h, i, j);
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
495 ; }
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
496 ;
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
497 ; int main()
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
498 ; {
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
499 ; 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);
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
500 ; return 0;
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
501 ; }
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
502
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
503
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
504
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
505 ; output from debian-4.0_r3-sparc w/ gcc 4.1.2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
506
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
507 00000000 <leaf_call>:
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
508 0: 9d e3 bf 98 save %sp, -104, %sp
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
509 4: f0 27 a0 44 st %i0, [ %fp + 0x44 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
510 8: f6 27 a0 50 st %i3, [ %fp + 0x50 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
511 c: f8 27 a0 54 st %i4, [ %fp + 0x54 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
512 10: 81 e8 00 00 restore
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
513 14: 81 c3 e0 08 retl
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
514 18: 01 00 00 00 nop
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
515
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
516 0000001c <nonleaf_call>:
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
517 1c: 9d e3 be e0 save %sp, -288, %sp
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
518 20: f0 27 a0 44 st %i0, [ %fp + 0x44 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
519 24: f2 27 a0 48 st %i1, [ %fp + 0x48 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
520 28: a0 10 00 1a mov %i2, %l0
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
521 2c: a4 10 00 1b mov %i3, %l2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
522 30: f8 27 a0 54 st %i4, [ %fp + 0x54 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
523 34: fa 27 a0 58 st %i5, [ %fp + 0x58 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
524 38: e2 07 a0 5c ld [ %fp + 0x5c ], %l1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
525 3c: e6 07 a0 60 ld [ %fp + 0x60 ], %l3
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
526 40: 82 07 bf 94 add %fp, -108, %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
527 44: 84 10 20 64 mov 0x64, %g2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
528 48: 90 10 00 01 mov %g1, %o0
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
529 4c: 92 10 20 00 clr %o1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
530 50: 94 10 00 02 mov %g2, %o2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
531 54: 40 00 00 00 call 54 <nonleaf_call+0x38>
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
532 58: 01 00 00 00 nop
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
533 5c: 82 10 20 4c mov 0x4c, %g1 ! 4c <nonleaf_call+0x30>
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
534 60: c2 2f bf 94 stb %g1, [ %fp + -108 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
535 64: c2 04 00 00 ld [ %l0 ], %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
536 68: c2 27 bf 80 st %g1, [ %fp + -128 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
537 6c: c2 04 20 04 ld [ %l0 + 4 ], %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
538 70: c2 27 bf 84 st %g1, [ %fp + -124 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
539 74: c2 04 20 08 ld [ %l0 + 8 ], %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
540 78: c2 27 bf 88 st %g1, [ %fp + -120 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
541 7c: c4 1c 80 00 ldd [ %l2 ], %g2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
542 80: c4 3f bf 70 std %g2, [ %fp + -144 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
543 84: c4 1c a0 08 ldd [ %l2 + 8 ], %g2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
544 88: c4 3f bf 78 std %g2, [ %fp + -136 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
545 8c: c2 04 40 00 ld [ %l1 ], %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
546 90: c2 27 bf 60 st %g1, [ %fp + -160 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
547 94: c2 04 60 04 ld [ %l1 + 4 ], %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
548 98: c2 27 bf 64 st %g1, [ %fp + -156 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
549 9c: c2 04 60 08 ld [ %l1 + 8 ], %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
550 a0: c2 27 bf 68 st %g1, [ %fp + -152 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
551 a4: c4 1c c0 00 ldd [ %l3 ], %g2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
552 a8: c4 3f bf 50 std %g2, [ %fp + -176 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
553 ac: c4 1c e0 08 ldd [ %l3 + 8 ], %g2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
554 b0: c4 3f bf 58 std %g2, [ %fp + -168 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
555 b4: 84 07 bf 80 add %fp, -128, %g2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
556 b8: 86 07 bf 70 add %fp, -144, %g3
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
557 bc: 88 07 bf 60 add %fp, -160, %g4
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
558 c0: 82 07 bf 50 add %fp, -176, %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
559 c4: c2 23 a0 5c st %g1, [ %sp + 0x5c ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
560 c8: c2 07 a0 64 ld [ %fp + 0x64 ], %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
561 cc: c2 23 a0 60 st %g1, [ %sp + 0x60 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
562 d0: c2 07 a0 68 ld [ %fp + 0x68 ], %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
563 d4: c2 23 a0 64 st %g1, [ %sp + 0x64 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
564 d8: d0 07 a0 48 ld [ %fp + 0x48 ], %o0
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
565 dc: 92 10 00 02 mov %g2, %o1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
566 e0: 94 10 00 03 mov %g3, %o2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
567 e4: d6 07 a0 54 ld [ %fp + 0x54 ], %o3
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
568 e8: d8 07 a0 58 ld [ %fp + 0x58 ], %o4
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
569 ec: 9a 10 00 04 mov %g4, %o5
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
570 f0: 40 00 00 00 call f0 <nonleaf_call+0xd4>
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
571 f4: 01 00 00 00 nop
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
572 f8: 81 e8 00 00 restore
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
573 fc: 81 c3 e0 08 retl
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
574 100: 01 00 00 00 nop
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
575
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
576 00000104 <main>:
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
577 104: 9d e3 bf 08 save %sp, -248, %sp
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
578 108: 82 10 20 02 mov 2, %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
579 10c: c2 27 bf bc st %g1, [ %fp + -68 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
580 110: 82 10 20 03 mov 3, %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
581 114: c2 27 bf c0 st %g1, [ %fp + -64 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
582 118: 03 00 00 00 sethi %hi(0), %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
583 11c: 82 10 60 00 mov %g1, %g1 ! 0 <leaf_call>
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
584 120: d1 00 40 00 ld [ %g1 ], %f8
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
585 124: d1 27 bf c4 st %f8, [ %fp + -60 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
586 128: 03 00 00 00 sethi %hi(0), %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
587 12c: 82 10 60 00 mov %g1, %g1 ! 0 <leaf_call>
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
588 130: d1 18 40 00 ldd [ %g1 ], %f8
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
589 134: d1 3f bf c8 std %f8, [ %fp + -56 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
590 138: 84 10 20 00 clr %g2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
591 13c: 86 10 20 06 mov 6, %g3
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
592 140: c4 3f bf d0 std %g2, [ %fp + -48 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
593 144: 82 10 20 09 mov 9, %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
594 148: c2 27 bf dc st %g1, [ %fp + -36 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
595 14c: 82 10 20 0a mov 0xa, %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
596 150: c2 27 bf e0 st %g1, [ %fp + -32 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
597 154: 03 00 00 00 sethi %hi(0), %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
598 158: 82 10 60 00 mov %g1, %g1 ! 0 <leaf_call>
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
599 15c: d1 00 40 00 ld [ %g1 ], %f8
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
600 160: d1 27 bf e4 st %f8, [ %fp + -28 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
601 164: 03 00 00 00 sethi %hi(0), %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
602 168: 82 10 60 00 mov %g1, %g1 ! 0 <leaf_call>
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
603 16c: d1 18 40 00 ldd [ %g1 ], %f8
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
604 170: d1 3f bf e8 std %f8, [ %fp + -24 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
605 174: 84 10 20 00 clr %g2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
606 178: 86 10 20 0d mov 0xd, %g3
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
607 17c: c4 3f bf f0 std %g2, [ %fp + -16 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
608 180: c2 07 bf bc ld [ %fp + -68 ], %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
609 184: c2 27 bf a8 st %g1, [ %fp + -88 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
610 188: c2 07 bf c0 ld [ %fp + -64 ], %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
611 18c: c2 27 bf ac st %g1, [ %fp + -84 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
612 190: c2 07 bf c4 ld [ %fp + -60 ], %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
613 194: c2 27 bf b0 st %g1, [ %fp + -80 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
614 198: c4 1f bf c8 ldd [ %fp + -56 ], %g2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
615 19c: c4 3f bf 98 std %g2, [ %fp + -104 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
616 1a0: c4 1f bf d0 ldd [ %fp + -48 ], %g2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
617 1a4: c4 3f bf a0 std %g2, [ %fp + -96 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
618 1a8: c2 07 bf dc ld [ %fp + -36 ], %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
619 1ac: c2 27 bf 88 st %g1, [ %fp + -120 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
620 1b0: c2 07 bf e0 ld [ %fp + -32 ], %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
621 1b4: c2 27 bf 8c st %g1, [ %fp + -116 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
622 1b8: c2 07 bf e4 ld [ %fp + -28 ], %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
623 1bc: c2 27 bf 90 st %g1, [ %fp + -112 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
624 1c0: c4 1f bf e8 ldd [ %fp + -24 ], %g2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
625 1c4: c4 3f bf 78 std %g2, [ %fp + -136 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
626 1c8: c4 1f bf f0 ldd [ %fp + -16 ], %g2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
627 1cc: c4 3f bf 80 std %g2, [ %fp + -128 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
628 1d0: 84 07 bf a8 add %fp, -88, %g2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
629 1d4: 86 07 bf 98 add %fp, -104, %g3
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
630 1d8: 82 07 bf 88 add %fp, -120, %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
631 1dc: c2 23 a0 5c st %g1, [ %sp + 0x5c ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
632 1e0: 82 07 bf 78 add %fp, -136, %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
633 1e4: c2 23 a0 60 st %g1, [ %sp + 0x60 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
634 1e8: 82 10 20 0e mov 0xe, %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
635 1ec: c2 23 a0 64 st %g1, [ %sp + 0x64 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
636 1f0: 82 10 20 0f mov 0xf, %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
637 1f4: c2 23 a0 68 st %g1, [ %sp + 0x68 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
638 1f8: 90 10 20 00 clr %o0
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
639 1fc: 92 10 20 01 mov 1, %o1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
640 200: 94 10 00 02 mov %g2, %o2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
641 204: 96 10 00 03 mov %g3, %o3
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
642 208: 98 10 20 07 mov 7, %o4
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
643 20c: 9a 10 20 08 mov 8, %o5
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
644 210: 40 00 00 00 call 210 <main+0x10c>
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
645 214: 01 00 00 00 nop
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
646 218: 82 10 20 00 clr %g1 ! 0 <leaf_call>
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
647 21c: b0 10 00 01 mov %g1, %i0
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
648 220: 81 e8 00 00 restore
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
649 224: 81 c3 e0 08 retl
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
650 228: 01 00 00 00 nop
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
651
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
652
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
653
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
654 ; ---------- returning 64 bit value ---------->
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
655
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
656 ; long long f()
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
657 ; {
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
658 ; return 7171LL;
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
659 ; }
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
660 ;
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
661 ; int main()
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
662 ; {
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
663 ; return (int)f();
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
664 ; }
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
665
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
666
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
667
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
668 ; output from debian-4.0_r3-sparc w/ gcc 4.1.2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
669
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
670 00000000 <f>:
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
671 0: 9d e3 bf 98 save %sp, -104, %sp
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
672 4: 84 10 20 00 clr %g2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
673 8: 07 00 00 07 sethi %hi(0x1c00), %g3
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
674 c: 86 10 e0 03 or %g3, 3, %g3 ! 1c03 <main+0x1bdf>
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
675 10: b0 10 00 02 mov %g2, %i0
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
676 14: b2 10 00 03 mov %g3, %i1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
677 18: 81 e8 00 00 restore
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
678 1c: 81 c3 e0 08 retl
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
679 20: 01 00 00 00 nop
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
680
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
681 00000024 <main>:
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
682 24: 9d e3 bf 98 save %sp, -104, %sp
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
683 28: 40 00 00 00 call 28 <main+0x4>
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
684 2c: 01 00 00 00 nop
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
685 30: 84 10 00 08 mov %o0, %g2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
686 34: 86 10 00 09 mov %o1, %g3
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
687 38: 82 10 00 03 mov %g3, %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
688 3c: b0 10 00 01 mov %g1, %i0
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
689 40: 81 e8 00 00 restore
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
690 44: 81 c3 e0 08 retl
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
691 48: 01 00 00 00 nop
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
692
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
693
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
694
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
695 ; ---------- returning structs by value ---------->
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
696 ;
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
697 ; struct Small { char x; };
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
698 ; struct Big { long long i; long j; };
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
699 ;
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
700 ; struct Small f0()
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
701 ; {
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
702 ; struct Small s = { 132 };
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
703 ; return s;
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
704 ; }
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
705 ;
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
706 ; struct Big f1()
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
707 ; {
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
708 ; struct Big b = { 7171LL, 232 };
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
709 ; return b;
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
710 ; }
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
711 ;
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
712 ; int main()
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
713 ; {
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
714 ; struct Small s = f0();
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
715 ; struct Big b = f1();
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
716 ; return b.j + s.x;
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
717 ; }
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
718
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
719
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
720
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
721 ; output from debian-4.0_r3-sparc w/ gcc 4.1.2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
722
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
723 00000000 <f0>:
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
724 0: 9d e3 bf 90 save %sp, -112, %sp
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
725 4: c2 07 a0 40 ld [ %fp + 0x40 ], %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
726 8: 84 10 3f 84 mov -124, %g2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
727 c: c4 2f bf f7 stb %g2, [ %fp + -9 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
728 10: c4 0f bf f7 ldub [ %fp + -9 ], %g2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
729 14: c4 28 40 00 stb %g2, [ %g1 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
730 18: b0 10 00 01 mov %g1, %i0
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
731 1c: 81 e8 00 00 restore
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
732 20: 81 c3 e0 0c jmp %o7 + 0xc
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
733 24: 01 00 00 00 nop
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
734
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
735 00000028 <f1>:
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
736 28: 9d e3 bf 88 save %sp, -120, %sp
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
737 2c: c8 07 a0 40 ld [ %fp + 0x40 ], %g4
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
738 30: 84 10 20 00 clr %g2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
739 34: 07 00 00 07 sethi %hi(0x1c00), %g3
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
740 38: 86 10 e0 03 or %g3, 3, %g3 ! 1c03 <main+0x1b9b>
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
741 3c: c4 3f bf e8 std %g2, [ %fp + -24 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
742 40: 82 10 20 e8 mov 0xe8, %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
743 44: c2 27 bf f0 st %g1, [ %fp + -16 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
744 48: c4 1f bf e8 ldd [ %fp + -24 ], %g2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
745 4c: c4 39 00 00 std %g2, [ %g4 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
746 50: c4 1f bf f0 ldd [ %fp + -16 ], %g2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
747 54: c4 39 20 08 std %g2, [ %g4 + 8 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
748 58: b0 10 00 04 mov %g4, %i0
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
749 5c: 81 e8 00 00 restore
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
750 60: 81 c3 e0 0c jmp %o7 + 0xc
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
751 64: 01 00 00 00 nop
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
752
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
753 00000068 <main>:
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
754 68: 9d e3 bf 78 save %sp, -136, %sp
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
755 6c: 82 07 bf df add %fp, -33, %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
756 70: c2 23 a0 40 st %g1, [ %sp + 0x40 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
757 74: 40 00 00 00 call 74 <main+0xc>
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
758 78: 01 00 00 00 nop
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
759 7c: 00 00 00 01 unimp 0x1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
760 80: c2 0f bf df ldub [ %fp + -33 ], %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
761 84: c2 2f bf f7 stb %g1, [ %fp + -9 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
762 88: 82 07 bf e0 add %fp, -32, %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
763 8c: c2 23 a0 40 st %g1, [ %sp + 0x40 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
764 90: 40 00 00 00 call 90 <main+0x28>
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
765 94: 01 00 00 00 nop
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
766 98: 00 00 00 10 unimp 0x10
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
767 9c: c4 07 bf e8 ld [ %fp + -24 ], %g2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
768 a0: c2 0f bf f7 ldub [ %fp + -9 ], %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
769 a4: 83 28 60 18 sll %g1, 0x18, %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
770 a8: 83 38 60 18 sra %g1, 0x18, %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
771 ac: 82 00 80 01 add %g2, %g1, %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
772 b0: b0 10 00 01 mov %g1, %i0
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
773 b4: 81 e8 00 00 restore
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
774 b8: 81 c3 e0 08 retl
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
775 bc: 01 00 00 00 nop
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
776
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
777
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
778
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
779 ; ---------- passing structs with only fp parts ---------->
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
780 ;
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
781 ; struct A { float a; };
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
782 ; struct B { float a, b; };
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
783 ; struct C { float a, b, c; };
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
784 ; struct D { double a; };
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
785 ; struct E { double a, b; };
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
786 ; struct F { double a, b, c; };
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
787 ;
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
788 ; void leaf_call(struct A a, struct B b, struct C c, struct D d, struct E e, struct F f)
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
789 ; {
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
790 ; }
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
791 ;
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
792 ; int main()
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
793 ; {
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
794 ; leaf_call((struct A){1.f}, (struct B){2.f,3.f}, (struct C){4.f,5.f,6.f}, (struct D){1.}, (struct E){2.,3.}, (struct F){4.,5.,6.});
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
795 ; return 0;
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
796 ; }
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
797
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
798
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
799
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
800 ; output from debian-4.0_r3-sparc w/ gcc 4.1.2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
801
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
802 00000000 <leaf_call>:
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
803 0: 9d e3 bf 98 save %sp, -104, %sp
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
804 4: 81 e8 00 00 restore
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
805 8: 81 c3 e0 08 retl
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
806 c: 01 00 00 00 nop
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
807
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
808 00000010 <main>:
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
809 10: 9d e3 bf 00 save %sp, -256, %sp
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
810 14: 03 00 00 00 sethi %hi(0), %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
811 18: 82 10 60 00 mov %g1, %g1 ! 0 <leaf_call>
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
812 1c: d1 00 40 00 ld [ %g1 ], %f8
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
813 20: d1 27 bf b0 st %f8, [ %fp + -80 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
814 24: 03 00 00 00 sethi %hi(0), %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
815 28: 82 10 60 00 mov %g1, %g1 ! 0 <leaf_call>
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
816 2c: d1 00 40 00 ld [ %g1 ], %f8
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
817 30: d1 27 bf b4 st %f8, [ %fp + -76 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
818 34: 03 00 00 00 sethi %hi(0), %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
819 38: 82 10 60 00 mov %g1, %g1 ! 0 <leaf_call>
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
820 3c: d1 00 40 00 ld [ %g1 ], %f8
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
821 40: d1 27 bf b8 st %f8, [ %fp + -72 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
822 44: 03 00 00 00 sethi %hi(0), %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
823 48: 82 10 60 00 mov %g1, %g1 ! 0 <leaf_call>
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
824 4c: d1 00 40 00 ld [ %g1 ], %f8
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
825 50: d1 27 bf bc st %f8, [ %fp + -68 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
826 54: 03 00 00 00 sethi %hi(0), %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
827 58: 82 10 60 00 mov %g1, %g1 ! 0 <leaf_call>
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
828 5c: d1 00 40 00 ld [ %g1 ], %f8
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
829 60: d1 27 bf c0 st %f8, [ %fp + -64 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
830 64: 03 00 00 00 sethi %hi(0), %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
831 68: 82 10 60 00 mov %g1, %g1 ! 0 <leaf_call>
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
832 6c: d1 00 40 00 ld [ %g1 ], %f8
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
833 70: d1 27 bf c4 st %f8, [ %fp + -60 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
834 74: 03 00 00 00 sethi %hi(0), %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
835 78: 82 10 60 00 mov %g1, %g1 ! 0 <leaf_call>
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
836 7c: d1 18 40 00 ldd [ %g1 ], %f8
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
837 80: d1 3f bf c8 std %f8, [ %fp + -56 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
838 84: 03 00 00 00 sethi %hi(0), %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
839 88: 82 10 60 00 mov %g1, %g1 ! 0 <leaf_call>
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
840 8c: d1 18 40 00 ldd [ %g1 ], %f8
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
841 90: d1 3f bf d0 std %f8, [ %fp + -48 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
842 94: 03 00 00 00 sethi %hi(0), %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
843 98: 82 10 60 00 mov %g1, %g1 ! 0 <leaf_call>
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
844 9c: d1 18 40 00 ldd [ %g1 ], %f8
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
845 a0: d1 3f bf d8 std %f8, [ %fp + -40 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
846 a4: 03 00 00 00 sethi %hi(0), %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
847 a8: 82 10 60 00 mov %g1, %g1 ! 0 <leaf_call>
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
848 ac: d1 18 40 00 ldd [ %g1 ], %f8
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
849 b0: d1 3f bf e0 std %f8, [ %fp + -32 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
850 b4: 03 00 00 00 sethi %hi(0), %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
851 b8: 82 10 60 00 mov %g1, %g1 ! 0 <leaf_call>
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
852 bc: d1 18 40 00 ldd [ %g1 ], %f8
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
853 c0: d1 3f bf e8 std %f8, [ %fp + -24 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
854 c4: 03 00 00 00 sethi %hi(0), %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
855 c8: 82 10 60 00 mov %g1, %g1 ! 0 <leaf_call>
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
856 cc: d1 18 40 00 ldd [ %g1 ], %f8
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
857 d0: d1 3f bf f0 std %f8, [ %fp + -16 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
858 d4: d1 07 bf b0 ld [ %fp + -80 ], %f8
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
859 d8: d1 27 bf ac st %f8, [ %fp + -84 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
860 dc: c2 07 bf b4 ld [ %fp + -76 ], %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
861 e0: c2 27 bf a0 st %g1, [ %fp + -96 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
862 e4: c2 07 bf b8 ld [ %fp + -72 ], %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
863 e8: c2 27 bf a4 st %g1, [ %fp + -92 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
864 ec: c2 07 bf bc ld [ %fp + -68 ], %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
865 f0: c2 27 bf 90 st %g1, [ %fp + -112 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
866 f4: c2 07 bf c0 ld [ %fp + -64 ], %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
867 f8: c2 27 bf 94 st %g1, [ %fp + -108 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
868 fc: c2 07 bf c4 ld [ %fp + -60 ], %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
869 100: c2 27 bf 98 st %g1, [ %fp + -104 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
870 104: d1 1f bf c8 ldd [ %fp + -56 ], %f8
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
871 108: d1 3f bf 88 std %f8, [ %fp + -120 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
872 10c: c4 1f bf d0 ldd [ %fp + -48 ], %g2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
873 110: c4 3f bf 78 std %g2, [ %fp + -136 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
874 114: c4 1f bf d8 ldd [ %fp + -40 ], %g2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
875 118: c4 3f bf 80 std %g2, [ %fp + -128 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
876 11c: c4 1f bf e0 ldd [ %fp + -32 ], %g2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
877 120: c4 3f bf 60 std %g2, [ %fp + -160 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
878 124: c4 1f bf e8 ldd [ %fp + -24 ], %g2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
879 128: c4 3f bf 68 std %g2, [ %fp + -152 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
880 12c: c4 1f bf f0 ldd [ %fp + -16 ], %g2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
881 130: c4 3f bf 70 std %g2, [ %fp + -144 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
882 134: 82 07 bf ac add %fp, -84, %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
883 138: 84 07 bf a0 add %fp, -96, %g2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
884 13c: 86 07 bf 90 add %fp, -112, %g3
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
885 140: 88 07 bf 88 add %fp, -120, %g4
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
886 144: 9a 07 bf 78 add %fp, -136, %o5
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
887 148: 9e 07 bf 60 add %fp, -160, %o7
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
888 14c: 90 10 00 01 mov %g1, %o0
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
889 150: 92 10 00 02 mov %g2, %o1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
890 154: 94 10 00 03 mov %g3, %o2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
891 158: 96 10 00 04 mov %g4, %o3
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
892 15c: 98 10 00 0d mov %o5, %o4
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
893 160: 9a 10 00 0f mov %o7, %o5
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
894 164: 40 00 00 00 call 164 <main+0x154>
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
895 168: 01 00 00 00 nop
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
896 16c: 82 10 20 00 clr %g1 ! 0 <leaf_call>
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
897 170: b0 10 00 01 mov %g1, %i0
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
898 174: 81 e8 00 00 restore
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
899 178: 81 c3 e0 08 retl
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
900 17c: 01 00 00 00 nop
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
901
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
902
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
903
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
904 ; ---------- single-field structs by values (and small array fields) ---------->
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
905 ;
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
906 ; struct C { char c; };
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
907 ; struct S { short s; };
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
908 ; struct I { int i; };
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
909 ; struct F { float f; };
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
910 ; struct D { double d; };
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
911 ;
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
912 ; struct C2 { char c[2]; };
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
913 ; struct C3 { char c[3]; };
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
914 ;
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
915 ; void leaf_call(struct C2 a, struct C b, struct S c, struct I d, struct F e, struct D f, struct C3 g)
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
916 ; {
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
917 ; }
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
918 ;
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
919 ; int main()
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
920 ; {
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
921 ; leaf_call((struct C2){{0,1}}, (struct C){2}, (struct S){3}, (struct I){4}, (struct F){5.f}, (struct D){6.}, (struct C3){{7,8,9}});
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
922 ; return 0;
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
923 ; }
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
924
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
925
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
926
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
927 ; output from debian-4.0_r3-sparc w/ gcc 4.1.2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
928
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
929 00000000 <leaf_call>:
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
930 0: 9d e3 bf 98 save %sp, -104, %sp
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
931 4: 81 e8 00 00 restore
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
932 8: 81 c3 e0 08 retl
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
933 c: 01 00 00 00 nop
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
934
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
935 00000010 <main>:
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
936 10: 9d e3 bf 48 save %sp, -184, %sp
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
937 14: c0 2f bf db clrb [ %fp + -37 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
938 18: 82 10 20 01 mov 1, %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
939 1c: c2 2f bf dc stb %g1, [ %fp + -36 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
940 20: 82 10 20 02 mov 2, %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
941 24: c2 2f bf dd stb %g1, [ %fp + -35 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
942 28: 82 10 20 03 mov 3, %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
943 2c: c2 37 bf de sth %g1, [ %fp + -34 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
944 30: 82 10 20 04 mov 4, %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
945 34: c2 27 bf e0 st %g1, [ %fp + -32 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
946 38: 03 00 00 00 sethi %hi(0), %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
947 3c: 82 10 60 00 mov %g1, %g1 ! 0 <leaf_call>
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
948 40: d1 00 40 00 ld [ %g1 ], %f8
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
949 44: d1 27 bf e4 st %f8, [ %fp + -28 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
950 48: 03 00 00 00 sethi %hi(0), %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
951 4c: 82 10 60 00 mov %g1, %g1 ! 0 <leaf_call>
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
952 50: d1 18 40 00 ldd [ %g1 ], %f8
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
953 54: d1 3f bf e8 std %f8, [ %fp + -24 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
954 58: 82 10 20 07 mov 7, %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
955 5c: c2 2f bf f5 stb %g1, [ %fp + -11 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
956 60: 82 10 20 08 mov 8, %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
957 64: c2 2f bf f6 stb %g1, [ %fp + -10 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
958 68: 82 10 20 09 mov 9, %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
959 6c: c2 2f bf f7 stb %g1, [ %fp + -9 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
960 70: c2 0f bf db ldub [ %fp + -37 ], %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
961 74: c2 2f bf d0 stb %g1, [ %fp + -48 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
962 78: c2 0f bf dc ldub [ %fp + -36 ], %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
963 7c: c2 2f bf d1 stb %g1, [ %fp + -47 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
964 80: c2 0f bf dd ldub [ %fp + -35 ], %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
965 84: c2 2f bf cf stb %g1, [ %fp + -49 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
966 88: c2 17 bf de lduh [ %fp + -34 ], %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
967 8c: c2 37 bf cc sth %g1, [ %fp + -52 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
968 90: c2 07 bf e0 ld [ %fp + -32 ], %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
969 94: c2 27 bf c8 st %g1, [ %fp + -56 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
970 98: d1 07 bf e4 ld [ %fp + -28 ], %f8
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
971 9c: d1 27 bf c4 st %f8, [ %fp + -60 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
972 a0: d1 1f bf e8 ldd [ %fp + -24 ], %f8
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
973 a4: d1 3f bf b8 std %f8, [ %fp + -72 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
974 a8: c2 0f bf f5 ldub [ %fp + -11 ], %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
975 ac: c2 2f bf b0 stb %g1, [ %fp + -80 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
976 b0: c2 0f bf f6 ldub [ %fp + -10 ], %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
977 b4: c2 2f bf b1 stb %g1, [ %fp + -79 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
978 b8: c2 0f bf f7 ldub [ %fp + -9 ], %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
979 bc: c2 2f bf b2 stb %g1, [ %fp + -78 ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
980 c0: 84 07 bf d0 add %fp, -48, %g2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
981 c4: 86 07 bf cf add %fp, -49, %g3
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
982 c8: 88 07 bf cc add %fp, -52, %g4
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
983 cc: 9a 07 bf c8 add %fp, -56, %o5
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
984 d0: 98 07 bf c4 add %fp, -60, %o4
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
985 d4: 9e 07 bf b8 add %fp, -72, %o7
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
986 d8: 82 07 bf b0 add %fp, -80, %g1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
987 dc: c2 23 a0 5c st %g1, [ %sp + 0x5c ]
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
988 e0: 90 10 00 02 mov %g2, %o0
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
989 e4: 92 10 00 03 mov %g3, %o1
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
990 e8: 94 10 00 04 mov %g4, %o2
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
991 ec: 96 10 00 0d mov %o5, %o3
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
992 f0: 9a 10 00 0f mov %o7, %o5
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
993 f4: 40 00 00 00 call f4 <main+0xe4>
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
994 f8: 01 00 00 00 nop
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
995 fc: 82 10 20 00 clr %g1 ! 0 <leaf_call>
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
996 100: b0 10 00 01 mov %g1, %i0
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
997 104: 81 e8 00 00 restore
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
998 108: 81 c3 e0 08 retl
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
999 10c: 01 00 00 00 nop
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
1000
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
1001
c73c59c8b553 - sparc32 doc clarifications w/ respect to aggregate passing and returning
Tassilo Philipp
parents: 327
diff changeset
1002
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: 476
diff changeset
1003 ; ---------- 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: 476
diff changeset
1004 ;
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: 476
diff changeset
1005 ; 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: 476
diff changeset
1006 ; 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: 476
diff changeset
1007 ;
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: 476
diff changeset
1008 ; 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: 476
diff changeset
1009 ;
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: 476
diff changeset
1010 ; 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: 476
diff changeset
1011 ; 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: 476
diff changeset
1012 ;
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: 476
diff changeset
1013 ; 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: 476
diff changeset
1014 ; {
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: 476
diff changeset
1015 ; 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: 476
diff changeset
1016 ; 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: 476
diff changeset
1017 ; 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: 476
diff changeset
1018 ; 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: 476
diff changeset
1019 ; 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: 476
diff changeset
1020 ; 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: 476
diff changeset
1021 ; 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: 476
diff changeset
1022 ; 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: 476
diff changeset
1023 ; }
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: 476
diff changeset
1024 ; }
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: 476
diff changeset
1025
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: 476
diff changeset
1026
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: 476
diff changeset
1027
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: 476
diff changeset
1028 ; output from debian-4.0_r3-sparc w/ gcc 4.1.2
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: 476
diff changeset
1029
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: 476
diff changeset
1030 00010484 <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: 476
diff changeset
1031 10484: 9d e3 bf 98 save %sp, -104, %sp
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: 476
diff changeset
1032 10488: 81 e8 00 00 restore
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: 476
diff changeset
1033 1048c: 81 c3 e0 08 retl
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: 476
diff changeset
1034 10490: 01 00 00 00 nop
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: 476
diff changeset
1035
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: 476
diff changeset
1036 00010494 <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: 476
diff changeset
1037 10494: 9d e3 bf 98 save %sp, -104, %sp
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: 476
diff changeset
1038 10498: f0 27 a0 44 st %i0, [ %fp + 0x44 ]
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: 476
diff changeset
1039 1049c: 81 e8 00 00 restore
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: 476
diff changeset
1040 104a0: 81 c3 e0 08 retl
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: 476
diff changeset
1041 104a4: 01 00 00 00 nop
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: 476
diff changeset
1042
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: 476
diff changeset
1043 000104a8 <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: 476
diff changeset
1044 104a8: 9d e3 bf 80 save %sp, -128, %sp ;
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: 476
diff changeset
1045 104ac: 82 07 bf e8 add %fp, -24, %g1 ;
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: 476
diff changeset
1046 104b0: 90 10 00 01 mov %g1, %o0 ;
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: 476
diff changeset
1047 104b4: 40 00 00 26 call 1054c <_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: 476
diff changeset
1048 104b8: 01 00 00 00 nop ;
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: 476
diff changeset
1049 104bc: 82 10 20 01 mov 1, %g1 ! 1 <_init-0x102cb> ;
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: 476
diff changeset
1050 104c0: c2 27 bf f4 st %g1, [ %fp + -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: 476
diff changeset
1051 104c4: c2 07 bf f4 ld [ %fp + -12 ], %g1 ;
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: 476
diff changeset
1052 104c8: 82 00 60 7b add %g1, 0x7b, %g1 ;
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: 476
diff changeset
1053 104cc: c2 27 bf f4 st %g1, [ %fp + -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: 476
diff changeset
1054 104d0: c2 07 bf ec ld [ %fp + -20 ], %g1 ;
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: 476
diff changeset
1055 104d4: c2 27 bf e4 st %g1, [ %fp + -28 ] ;
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: 476
diff changeset
1056 104d8: 82 07 bf e4 add %fp, -28, %g1 ;
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: 476
diff changeset
1057 104dc: 90 10 00 01 mov %g1, %o0 ;
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: 476
diff changeset
1058 104e0: 7f ff ff e9 call 10484 <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: 476
diff changeset
1059 104e4: 01 00 00 00 nop ;
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: 476
diff changeset
1060 104e8: c2 07 bf f4 ld [ %fp + -12 ], %g1 ;
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: 476
diff changeset
1061 104ec: 82 00 7f 85 add %g1, -123, %g1 ;
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: 476
diff changeset
1062 104f0: c2 27 bf f4 st %g1, [ %fp + -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: 476
diff changeset
1063 104f4: 82 07 bf f0 add %fp, -16, %g1 ;
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: 476
diff changeset
1064 104f8: 84 07 bf e8 add %fp, -24, %g2 ;
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: 476
diff changeset
1065 104fc: 90 10 00 01 mov %g1, %o0 ; | 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: 476
diff changeset
1066 10500: 92 10 00 02 mov %g2, %o1 ; | 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: 476
diff changeset
1067 10504: 40 00 00 19 call 10568 <_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: 476
diff changeset
1068 10508: 01 00 00 00 nop ;
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: 476
diff changeset
1069 1050c: 82 07 bf f0 add %fp, -16, %g1 ; |
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: 476
diff changeset
1070 10510: 90 10 00 01 mov %g1, %o0 ; | 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: 476
diff changeset
1071 10514: 7f ff ff e0 call 10494 <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: 476
diff changeset
1072 10518: 01 00 00 00 nop ;
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: 476
diff changeset
1073 1051c: c2 07 bf f4 ld [ %fp + -12 ], %g1 ;
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: 476
diff changeset
1074 10520: 82 00 7f f4 add %g1, -12, %g1 ;
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: 476
diff changeset
1075 10524: c2 27 bf f4 st %g1, [ %fp + -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: 476
diff changeset
1076 10528: 81 e8 00 00 restore ;
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: 476
diff changeset
1077 1052c: 81 c3 e0 08 retl ;
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: 476
diff changeset
1078 10530: 01 00 00 00 nop ;
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: 476
diff changeset
1079
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: 476
diff changeset
1080 ; ... 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: 476
diff changeset
1081
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: 476
diff changeset
1082
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: 476
diff changeset
1083
327
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
1084 ; vim: ft=asm
c0390dc85a07 - doc: added disassembly examples for many platforms and calling conventions, for reference
Tassilo Philipp
parents:
diff changeset
1085