]> git.ipfire.org Git - thirdparty/gcc.git/blame - boehm-gc/powerpc_darwin_mach_dep.s
tree.h (OMP_CLAUSE_LINEAR_GIMPLE_SEQ): Define.
[thirdparty/gcc.git] / boehm-gc / powerpc_darwin_mach_dep.s
CommitLineData
97e095fd
MS
1#if defined(__ppc64__)
2#define MODE_CHOICE(x, y) y
3#else
4#define MODE_CHOICE(x, y) x
5#endif
6
48f854c7 7#define machine_choice MODE_CHOICE(ppc7400,ppc64)
97e095fd 8
48f854c7
IS
9; Define some pseudo-opcodes for size-independent load & store of GPRs ...
10#define lgu MODE_CHOICE(lwzu, ldu)
11#define lg MODE_CHOICE(lwz,ld)
12#define sg MODE_CHOICE(stw,std)
13#define sgu MODE_CHOICE(stwu,stdu)
97e095fd 14
48f854c7
IS
15; ... and the size of GPRs and their storage indicator.
16#define GPR_BYTES MODE_CHOICE(4,8)
17#define LOG2_GPR_BYTES MODE_CHOICE(2,3) /* log2(GPR_BYTES) */
18#define g_long MODE_CHOICE(long, quad) /* usage is ".g_long" */
19
20; From the ABI doc: "Mac OS X ABI Function Call Guide" Version 2009-02-04.
21#define LINKAGE_SIZE MODE_CHOICE(24,48)
22#define PARAM_AREA MODE_CHOICE(32,64)
23#define SAVED_LR_OFFSET MODE_CHOICE(8,16) /* save position for lr */
24
25; The whole stack frame **MUST** be 16byte-aligned.
26#define SAVE_SIZE (LINKAGE_SIZE+PARAM_AREA)
27
28#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050
29; We no longer need the pic symbol stub for Darwin >= 9.
30#define BLGCP1 _GC_push_one
31#undef WANT_STUB
32#else
33#define BLGCP1 L_GC_push_one$stub
34#define WANT_STUB
35#endif
36
37 .machine machine_choice
6991c6c9
JS
38
39; GC_push_regs function. Under some optimization levels GCC will clobber
40; some of the non-volatile registers before we get a chance to save them
54f28c21 41; therefore, this cannot be inline asm.
6991c6c9
JS
42
43.text
97e095fd 44 .align LOG2_GPR_BYTES
6991c6c9
JS
45 .globl _GC_push_regs
46_GC_push_regs:
47
48 ; Prolog
49 mflr r0
48f854c7
IS
50 sg r0,SAVED_LR_OFFSET(r1)
51 sgu r1,-SAVE_SIZE(r1)
6991c6c9 52
48f854c7
IS
53L_body:
54 ; 'Push' r13-r31
6991c6c9 55 mr r3,r13
48f854c7 56 bl BLGCP1
6991c6c9 57 mr r3,r14
48f854c7 58 bl BLGCP1
6991c6c9 59 mr r3,r15
48f854c7 60 bl BLGCP1
6991c6c9 61 mr r3,r16
48f854c7 62 bl BLGCP1
6991c6c9 63 mr r3,r17
48f854c7 64 bl BLGCP1
6991c6c9 65 mr r3,r18
48f854c7 66 bl BLGCP1
6991c6c9 67 mr r3,r19
48f854c7 68 bl BLGCP1
6991c6c9 69 mr r3,r20
48f854c7 70 bl BLGCP1
6991c6c9 71 mr r3,r21
48f854c7 72 bl BLGCP1
6991c6c9 73 mr r3,r22
48f854c7 74 bl BLGCP1
6991c6c9 75 mr r3,r23
48f854c7 76 bl BLGCP1
6991c6c9 77 mr r3,r24
48f854c7 78 bl BLGCP1
6991c6c9 79 mr r3,r25
48f854c7 80 bl BLGCP1
6991c6c9 81 mr r3,r26
48f854c7 82 bl BLGCP1
6991c6c9 83 mr r3,r27
48f854c7 84 bl BLGCP1
6991c6c9 85 mr r3,r28
48f854c7 86 bl BLGCP1
6991c6c9 87 mr r3,r29
48f854c7 88 bl BLGCP1
6991c6c9 89 mr r3,r30
48f854c7 90 bl BLGCP1
6991c6c9 91 mr r3,r31
48f854c7 92 bl BLGCP1
6991c6c9 93
48f854c7
IS
94L_epilog:
95 ; Epilog
96 lg r0,SAVE_SIZE+SAVED_LR_OFFSET(r1)
97 addi r1,r1,SAVE_SIZE
6991c6c9
JS
98 mtlr r0
99
48f854c7 100 ; Return
6991c6c9 101 blr
48f854c7 102LFE0:
6991c6c9 103
48f854c7 104; eh frames, for those that want 'em.
6991c6c9 105
48f854c7
IS
106#define EH_DATA_ALIGN_FACT MODE_CHOICE(0x7c,0x78)
107#define EH_FRAME_OFFSET MODE_CHOICE(0x40,0x70)
108
109 .section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support
110EH_frame1:
111 .set L$set$0,LECIE1-LSCIE1
112 .long L$set$0 ; Length of Common Information Entry
113LSCIE1:
114 .long 0 ; CIE Identifier Tag
115 .byte 0x1 ; CIE Version
116 .ascii "zR\0" ; CIE Augmentation
117 .byte 0x1 ; uleb128 0x1; CIE Code Alignment Factor
118 .byte EH_DATA_ALIGN_FACT ; sleb128 -4/-8; CIE Data Alignment Factor
119 .byte 0x41 ; CIE RA Column
120 .byte 0x1 ; uleb128 0x1; Augmentation size
121 .byte 0x10 ; FDE Encoding (pcrel)
122 .byte 0xc ; DW_CFA_def_cfa
123 .byte 0x1 ; uleb128 0x1
124 .byte 0 ; uleb128 0
125 .align LOG2_GPR_BYTES
126LECIE1:
127
128 .globl _GC_push_regs.eh
129_GC_push_regs.eh:
130LSFDE1:
131 .set L$set$1,LEFDE1-LASFDE1
132 .long L$set$1 ; FDE Length
133LASFDE1:
134 .long LASFDE1-EH_frame1 ; FDE CIE offset
135 .g_long _GC_push_regs-. ; FDE initial location
136 .set L$set$2,LFE0-_GC_push_regs
137 .g_long L$set$2 ; FDE address range
138 .byte 0 ; uleb128 0; Augmentation size
139 .byte 0x4 ; DW_CFA_advance_loc4
140 .set L$set$3,L_body-_GC_push_regs
141 .long L$set$3
142 .byte 0xe ; DW_CFA_def_cfa_offset
143 .byte EH_FRAME_OFFSET ; uleb128 0x40/0x70
144 .byte 0x11 ; DW_CFA_offset_extended_sf
145 .byte 0x41 ; uleb128 0x41
146 .byte 0x7e ; sleb128 -2
147 .byte 0x4 ; DW_CFA_advance_loc4
148 .set L$set$4,L_epilog-L_body
149 .long L$set$4
150 .byte 0xe ; DW_CFA_def_cfa_offset
151 .byte 0 ; uleb128 0
152 .align LOG2_GPR_BYTES
153LEFDE1:
154
155 .data
156#ifdef WANT_STUB
157; PIC stub stuff, generated by GCC
158
159 .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
97e095fd 160 .align LOG2_GPR_BYTES
6991c6c9
JS
161L_GC_push_one$stub:
162 .indirect_symbol _GC_push_one
163 mflr r0
164 bcl 20,31,L0$_GC_push_one
165L0$_GC_push_one:
166 mflr r11
167 addis r11,r11,ha16(L_GC_push_one$lazy_ptr-L0$_GC_push_one)
168 mtlr r0
97e095fd 169 lgu r12,lo16(L_GC_push_one$lazy_ptr-L0$_GC_push_one)(r11)
6991c6c9 170 mtctr r12
6991c6c9 171 bctr
48f854c7
IS
172
173 .data
174 .lazy_symbol_pointer
6991c6c9
JS
175L_GC_push_one$lazy_ptr:
176 .indirect_symbol _GC_push_one
97e095fd 177 .g_long dyld_stub_binding_helper
48f854c7 178#endif