aboutsummaryrefslogtreecommitdiff
path: root/boehm-gc
diff options
context:
space:
mode:
authorIain Sandoe <iains@gcc.gnu.org>2010-12-10 10:09:10 +0000
committerIain Sandoe <iains@gcc.gnu.org>2010-12-10 10:09:10 +0000
commit8b3ce867611b50b1dac712026e4627923a8aed37 (patch)
treef55901893a1534081c19939aa6fcd70e3569958e /boehm-gc
parent5de552697632114407ce2c1e5d2fd69e7a13658b (diff)
update boehm-gc for powerpc m64 darwin.
boehm-gc: * powerpc_darwin_mach_dep.s: Update for m64. Add eh frames. Do not build or use the picsymbol stub for Darwin >= 9. * tests/test.c (reverse_test): Modify count for ppc64-darwin. * pthread_support.c (GC_get_thread_stack_base): Correct a debug statement. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@167681 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'boehm-gc')
-rw-r--r--boehm-gc/ChangeLog8
-rw-r--r--boehm-gc/powerpc_darwin_mach_dep.s151
-rw-r--r--boehm-gc/pthread_support.c2
-rw-r--r--boehm-gc/tests/test.c7
4 files changed, 132 insertions, 36 deletions
diff --git a/boehm-gc/ChangeLog b/boehm-gc/ChangeLog
index 8a1abca8ba8..1712ffbc5cd 100644
--- a/boehm-gc/ChangeLog
+++ b/boehm-gc/ChangeLog
@@ -1,3 +1,11 @@
+2010-12-10 Iain Sandoe <iains@gcc.gnu.org>
+
+ * powerpc_darwin_mach_dep.s: Update for m64. Add eh frames.
+ Do not build or use the picsymbol stub for Darwin >= 9.
+ * tests/test.c (reverse_test): Modify count for ppc64-darwin.
+ * pthread_support.c (GC_get_thread_stack_base): Correct a debug
+ statement.
+
2010-11-29 Iain Sandoe <iains@gcc.gnu.org>
Mike Stump <mrs@gcc.gnu.org>
diff --git a/boehm-gc/powerpc_darwin_mach_dep.s b/boehm-gc/powerpc_darwin_mach_dep.s
index 1121ee89c6e..d61acc034c4 100644
--- a/boehm-gc/powerpc_darwin_mach_dep.s
+++ b/boehm-gc/powerpc_darwin_mach_dep.s
@@ -4,11 +4,37 @@
#define MODE_CHOICE(x, y) x
#endif
-#define lgu MODE_CHOICE(lwzu, ldu)
+#define machine_choice MODE_CHOICE(ppc7400,ppc64)
-#define g_long MODE_CHOICE(long, quad) /* usage is ".g_long" */
+; Define some pseudo-opcodes for size-independent load & store of GPRs ...
+#define lgu MODE_CHOICE(lwzu, ldu)
+#define lg MODE_CHOICE(lwz,ld)
+#define sg MODE_CHOICE(stw,std)
+#define sgu MODE_CHOICE(stwu,stdu)
-#define LOG2_GPR_BYTES MODE_CHOICE(2,3) /* log2(GPR_BYTES) */
+; ... and the size of GPRs and their storage indicator.
+#define GPR_BYTES MODE_CHOICE(4,8)
+#define LOG2_GPR_BYTES MODE_CHOICE(2,3) /* log2(GPR_BYTES) */
+#define g_long MODE_CHOICE(long, quad) /* usage is ".g_long" */
+
+; From the ABI doc: "Mac OS X ABI Function Call Guide" Version 2009-02-04.
+#define LINKAGE_SIZE MODE_CHOICE(24,48)
+#define PARAM_AREA MODE_CHOICE(32,64)
+#define SAVED_LR_OFFSET MODE_CHOICE(8,16) /* save position for lr */
+
+; The whole stack frame **MUST** be 16byte-aligned.
+#define SAVE_SIZE (LINKAGE_SIZE+PARAM_AREA)
+
+#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050
+; We no longer need the pic symbol stub for Darwin >= 9.
+#define BLGCP1 _GC_push_one
+#undef WANT_STUB
+#else
+#define BLGCP1 L_GC_push_one$stub
+#define WANT_STUB
+#endif
+
+ .machine machine_choice
; GC_push_regs function. Under some optimization levels GCC will clobber
; some of the non-volatile registers before we get a chance to save them
@@ -21,61 +47,116 @@ _GC_push_regs:
; Prolog
mflr r0
- stw r0,8(r1)
- stwu r1,-80(r1)
+ sg r0,SAVED_LR_OFFSET(r1)
+ sgu r1,-SAVE_SIZE(r1)
- ; Push r13-r31
+L_body:
+ ; 'Push' r13-r31
mr r3,r13
- bl L_GC_push_one$stub
+ bl BLGCP1
mr r3,r14
- bl L_GC_push_one$stub
+ bl BLGCP1
mr r3,r15
- bl L_GC_push_one$stub
+ bl BLGCP1
mr r3,r16
- bl L_GC_push_one$stub
+ bl BLGCP1
mr r3,r17
- bl L_GC_push_one$stub
+ bl BLGCP1
mr r3,r18
- bl L_GC_push_one$stub
+ bl BLGCP1
mr r3,r19
- bl L_GC_push_one$stub
+ bl BLGCP1
mr r3,r20
- bl L_GC_push_one$stub
+ bl BLGCP1
mr r3,r21
- bl L_GC_push_one$stub
+ bl BLGCP1
mr r3,r22
- bl L_GC_push_one$stub
+ bl BLGCP1
mr r3,r23
- bl L_GC_push_one$stub
+ bl BLGCP1
mr r3,r24
- bl L_GC_push_one$stub
+ bl BLGCP1
mr r3,r25
- bl L_GC_push_one$stub
+ bl BLGCP1
mr r3,r26
- bl L_GC_push_one$stub
+ bl BLGCP1
mr r3,r27
- bl L_GC_push_one$stub
+ bl BLGCP1
mr r3,r28
- bl L_GC_push_one$stub
+ bl BLGCP1
mr r3,r29
- bl L_GC_push_one$stub
+ bl BLGCP1
mr r3,r30
- bl L_GC_push_one$stub
+ bl BLGCP1
mr r3,r31
- bl L_GC_push_one$stub
+ bl BLGCP1
- ;
- lwz r0,88(r1)
- addi r1,r1,80
+L_epilog:
+ ; Epilog
+ lg r0,SAVE_SIZE+SAVED_LR_OFFSET(r1)
+ addi r1,r1,SAVE_SIZE
mtlr r0
- ; Return
+ ; Return
blr
+LFE0:
-; PIC stuff, generated by GCC
+; eh frames, for those that want 'em.
-.data
-.section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
+#define EH_DATA_ALIGN_FACT MODE_CHOICE(0x7c,0x78)
+#define EH_FRAME_OFFSET MODE_CHOICE(0x40,0x70)
+
+ .section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support
+EH_frame1:
+ .set L$set$0,LECIE1-LSCIE1
+ .long L$set$0 ; Length of Common Information Entry
+LSCIE1:
+ .long 0 ; CIE Identifier Tag
+ .byte 0x1 ; CIE Version
+ .ascii "zR\0" ; CIE Augmentation
+ .byte 0x1 ; uleb128 0x1; CIE Code Alignment Factor
+ .byte EH_DATA_ALIGN_FACT ; sleb128 -4/-8; CIE Data Alignment Factor
+ .byte 0x41 ; CIE RA Column
+ .byte 0x1 ; uleb128 0x1; Augmentation size
+ .byte 0x10 ; FDE Encoding (pcrel)
+ .byte 0xc ; DW_CFA_def_cfa
+ .byte 0x1 ; uleb128 0x1
+ .byte 0 ; uleb128 0
+ .align LOG2_GPR_BYTES
+LECIE1:
+
+ .globl _GC_push_regs.eh
+_GC_push_regs.eh:
+LSFDE1:
+ .set L$set$1,LEFDE1-LASFDE1
+ .long L$set$1 ; FDE Length
+LASFDE1:
+ .long LASFDE1-EH_frame1 ; FDE CIE offset
+ .g_long _GC_push_regs-. ; FDE initial location
+ .set L$set$2,LFE0-_GC_push_regs
+ .g_long L$set$2 ; FDE address range
+ .byte 0 ; uleb128 0; Augmentation size
+ .byte 0x4 ; DW_CFA_advance_loc4
+ .set L$set$3,L_body-_GC_push_regs
+ .long L$set$3
+ .byte 0xe ; DW_CFA_def_cfa_offset
+ .byte EH_FRAME_OFFSET ; uleb128 0x40/0x70
+ .byte 0x11 ; DW_CFA_offset_extended_sf
+ .byte 0x41 ; uleb128 0x41
+ .byte 0x7e ; sleb128 -2
+ .byte 0x4 ; DW_CFA_advance_loc4
+ .set L$set$4,L_epilog-L_body
+ .long L$set$4
+ .byte 0xe ; DW_CFA_def_cfa_offset
+ .byte 0 ; uleb128 0
+ .align LOG2_GPR_BYTES
+LEFDE1:
+
+ .data
+#ifdef WANT_STUB
+; PIC stub stuff, generated by GCC
+
+ .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
.align LOG2_GPR_BYTES
L_GC_push_one$stub:
.indirect_symbol _GC_push_one
@@ -88,8 +169,10 @@ L0$_GC_push_one:
lgu r12,lo16(L_GC_push_one$lazy_ptr-L0$_GC_push_one)(r11)
mtctr r12
bctr
-.data
-.lazy_symbol_pointer
+
+ .data
+ .lazy_symbol_pointer
L_GC_push_one$lazy_ptr:
.indirect_symbol _GC_push_one
.g_long dyld_stub_binding_helper
+#endif
diff --git a/boehm-gc/pthread_support.c b/boehm-gc/pthread_support.c
index fd961f5d802..b3abc69e68b 100644
--- a/boehm-gc/pthread_support.c
+++ b/boehm-gc/pthread_support.c
@@ -1158,7 +1158,7 @@ GC_PTR GC_get_thread_stack_base()
# else
# ifdef DEBUG_THREADS
- GC_printf1("Can not determine stack base for attached thread");
+ GC_printf0("Can not determine stack base for attached thread");
# endif
return 0;
# endif
diff --git a/boehm-gc/tests/test.c b/boehm-gc/tests/test.c
index f4431739382..1180ab152ad 100644
--- a/boehm-gc/tests/test.c
+++ b/boehm-gc/tests/test.c
@@ -624,7 +624,12 @@ void reverse_test()
/* OSF has limited stack space by default, and large frames. */
# define BIG 200
# else
-# define BIG 4500
+# if defined(__MACH__) && defined(__ppc64__)
+ /* Small stack and largish frames. */
+# define BIG 2500
+# else
+# define BIG 4500
+# endif
# endif
# endif
# endif