From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7258 invoked by alias); 6 Jun 2012 21:52:38 -0000 Received: (qmail 7042 invoked by uid 22791); 6 Jun 2012 21:52:33 -0000 X-SWARE-Spam-Status: No, hits=-4.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,TW_BL,TW_CP,TW_DD,TW_KQ,TW_LB,TW_PB,TW_SK,TW_TQ,TW_TX,TW_XN,TW_XT X-Spam-Check-By: sourceware.org Received: from mail-pb0-f41.google.com (HELO mail-pb0-f41.google.com) (209.85.160.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 06 Jun 2012 21:52:11 +0000 Received: by pbbrp2 with SMTP id rp2so116586pbb.0 for ; Wed, 06 Jun 2012 14:52:11 -0700 (PDT) Received: by 10.68.227.5 with SMTP id rw5mr1491108pbc.32.1339019530909; Wed, 06 Jun 2012 14:52:10 -0700 (PDT) Received: from anchor.twiddle.home ([173.160.232.49]) by mx.google.com with ESMTPS id to1sm1658307pbc.27.2012.06.06.14.52.10 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 06 Jun 2012 14:52:10 -0700 (PDT) From: Richard Henderson To: libc-ports@sourceware.org Subject: [PATCH 2/5] alpha: Use cfi_startproc instead of dual procedure descriptors Date: Wed, 06 Jun 2012 21:52:00 -0000 Message-Id: <1339019524-32478-2-git-send-email-rth@twiddle.net> In-Reply-To: <1339019524-32478-1-git-send-email-rth@twiddle.net> References: <1339019524-32478-1-git-send-email-rth@twiddle.net> X-IsSubscribed: yes Mailing-List: contact libc-ports-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: libc-ports-owner@sourceware.org X-SW-Source: 2012-06/txt/msg00017.txt.bz2 --- ChangeLog.alpha | 9 +++++++ sysdeps/alpha/alphaev6/stxcpy.S | 33 +++++++----------------- sysdeps/alpha/alphaev6/stxncpy.S | 49 ++++++++++++------------------------- sysdeps/alpha/bzero.S | 21 ++++----------- sysdeps/alpha/memset.S | 25 ++++++------------- sysdeps/alpha/stxcpy.S | 30 +++++++---------------- sysdeps/alpha/stxncpy.S | 31 +++++++----------------- sysdeps/unix/alpha/sysdep.h | 6 ++++ 8 files changed, 73 insertions(+), 131 deletions(-) diff --git a/ChangeLog.alpha b/ChangeLog.alpha index 2c107ad..ceee910 100644 --- a/ChangeLog.alpha +++ b/ChangeLog.alpha @@ -1,5 +1,14 @@ 2012-06-06 Richard Henderson + * sysdeps/alpha/alphaev6/stxcpy.S: Use cfi markup instead of + dual ecoff procedure descriptors. + * sysdeps/alpha/alphaev6/stxncpy.S: Likewise. + * sysdeps/alpha/bzero.S: Likewise. + * sysdeps/alpha/memset.S: Likewise. + * sysdeps/alpha/stxcpy.S: Likewise. + * sysdeps/alpha/stxncpy.S: Likewise. + * sysdeps/unix/alpha/sysdep.h (USEPV_PROF): New. + * sysdeps/alpha/_mcount.S: Move .prologue after stack alloc. 2012-06-05 Richard Henderson diff --git a/sysdeps/alpha/alphaev6/stxcpy.S b/sysdeps/alpha/alphaev6/stxcpy.S index 37ad737..bdc8e72 100644 --- a/sysdeps/alpha/alphaev6/stxcpy.S +++ b/sysdeps/alpha/alphaev6/stxcpy.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 Free Software Foundation, Inc. +/* Copyright (C) 2000-2012 Free Software Foundation, Inc. Contributed by Richard Henderson (rth@tamu.edu) EV6 optimized by Rick Gorton . This file is part of the GNU C Library. @@ -41,24 +41,20 @@ .arch ev6 .set noat .set noreorder - .text - -/* There is a problem with either gdb (as of 4.16) or gas (as of 2.7) that - doesn't like putting the entry point for a procedure somewhere in the - middle of the procedure descriptor. Work around this by putting the - aligned copy in its own procedure descriptor */ + .text + .type __stxcpy, @function + .globl __stxcpy + .usepv __stxcpy, no - .ent stxcpy_aligned - .align 4 -stxcpy_aligned: - .frame sp, 0, t9 - .prologue 0 + cfi_startproc + cfi_return_column (t9) /* On entry to this basic block: t0 == the first destination word for masking back in t1 == the first source word. */ - + .align 4 +stxcpy_aligned: /* Create the 1st output word and detect 0's in the 1st input word. */ lda t2, -1 # E : build a mask against false zero mskqh t2, a1, t2 # U : detection in the src word (stall) @@ -115,15 +111,8 @@ $a_eos: nop nop - .end stxcpy_aligned - .align 4 - .ent __stxcpy - .globl __stxcpy __stxcpy: - .frame sp, 0, t9 - .prologue 0 - /* Are source and destination co-aligned? */ xor a0, a1, t0 # E : unop # E : @@ -321,7 +310,5 @@ $unaligned: or t0, t1, t1 # e1 : and put it there stq_u t1, 0(a0) # .. e0 : (stall) ret (t9) # e1 : - nop - - .end __stxcpy + cfi_endproc diff --git a/sysdeps/alpha/alphaev6/stxncpy.S b/sysdeps/alpha/alphaev6/stxncpy.S index 31f8570..d134eb8 100644 --- a/sysdeps/alpha/alphaev6/stxncpy.S +++ b/sysdeps/alpha/alphaev6/stxncpy.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2000, 2002 Free Software Foundation, Inc. +/* Copyright (C) 2000-2012 Free Software Foundation, Inc. Contributed by Richard Henderson (rth@tamu.edu) EV6 optimized by Rick Gorton . This file is part of the GNU C Library. @@ -49,22 +49,19 @@ .set noat .set noreorder -/* There is a problem with either gdb (as of 4.16) or gas (as of 2.7) that - doesn't like putting the entry point for a procedure somewhere in the - middle of the procedure descriptor. Work around this by putting the - aligned copy in its own procedure descriptor */ + .text + .type __stxncpy, @function + .globl __stxncpy + .usepv __stxncpy, no - - .ent stxncpy_aligned - .align 4 -stxncpy_aligned: - .frame sp, 0, t9, 0 - .prologue 0 + cfi_startproc + cfi_return_column (t9) /* On entry to this basic block: t0 == the first destination word for masking back in t1 == the first source word. */ - + .align 4 +stxncpy_aligned: /* Create the 1st output word and detect 0's in the 1st input word. */ lda t2, -1 # E : build a mask against false zero mskqh t2, a1, t2 # U : detection in the src word (stall) @@ -111,7 +108,6 @@ $a_loop: On entry to this basic block we have: t0 == the source word containing the null t7 == the cmpbge mask that found it. */ - $a_eos: negq t7, t8 # E : find low bit set and t7, t8, t8 # E : (stall) @@ -144,15 +140,8 @@ $a_eoc: nop nop - .end stxncpy_aligned - .align 4 - .ent __stxncpy - .globl __stxncpy __stxncpy: - .frame sp, 0, t9, 0 - .prologue 0 - /* Are source and destination co-aligned? */ xor a0, a1, t1 # E : and a0, 7, t0 # E : find dest misalignment @@ -166,16 +155,14 @@ __stxncpy: sll t10, t2, t10 # U : t10 = bitmask of last count byte bne t1, $unaligned # U : + /* We are co-aligned; take care of a partial first word. */ ldq_u t1, 0(a1) # L : load first src word addq a1, 8, a1 # E : - - beq t0, stxncpy_aligned # U : avoid loading dest word if not needed + beq t0, stxncpy_aligned # U : avoid loading dest word if not needed ldq_u t0, 0(a0) # L : - nop - nop - br stxncpy_aligned # .. e1 : + br stxncpy_aligned # U : nop nop nop @@ -231,7 +218,7 @@ $u_head: extqh t2, a1, t0 # U : position lo-bits of hi word (stall) cmpbge zero, t2, t7 # E : - nop + nop bne t7, $u_eos # U : /* Unaligned copy main loop. In order to avoid reading too much, @@ -314,7 +301,7 @@ $u_final: 1: stq_u t0, 0(a0) # L : ret (t9) # L0 : Latency=3 - /* Got to end-of-count before end of string. + /* Got to end-of-count before end of string. On entry to this basic block: t1 == the shifted high-order bits from the previous source word */ $u_eoc: @@ -325,7 +312,7 @@ $u_eoc: ldq_u t2, 8(a1) # L : load final src word nop - extqh t2, a1, t0 # U : extract low bits for last word (stall) + extqh t2, a1, t0 # U : extract low bits for last word (stall) or t1, t0, t1 # E : (stall) 1: cmpbge zero, t1, t7 # E : @@ -394,9 +381,5 @@ $unaligned: stq_u t0, 0(a0) # L : (stall) ret (t9) # L0 : Latency=3 - nop - nop - nop - - .end __stxncpy + cfi_endproc diff --git a/sysdeps/alpha/bzero.S b/sysdeps/alpha/bzero.S index 091024b..a691ff6 100644 --- a/sysdeps/alpha/bzero.S +++ b/sysdeps/alpha/bzero.S @@ -36,23 +36,19 @@ .set noreorder .text + .type __bzero, @function + .globl __bzero + .usepv __bzero, USEPV_PROF -/* There is a problem with either gdb (as of 4.16) or gas (as of 2.7) that - doesn't like putting the entry point for a procedure somewhere in the - middle of the procedure descriptor. Work around this by putting the main - loop in its own procedure descriptor. */ + cfi_startproc /* On entry to this basic block: t3 == loop counter t4 == bytes in partial final word a0 == possibly misaligned destination pointer */ - .ent bzero_loop .align 3 bzero_loop: - .frame sp, 0, ra, 0 - .prologue 0 - beq t3, $tail # blbc t3, 0f # skip single store if count even @@ -75,16 +71,11 @@ $tail: bne t4, 1f # is there a tail to do? stq_u t0, 0(a0) # ret # - .end bzero_loop - -ENTRY(__bzero) +__bzero: #ifdef PROF ldgp gp, 0(pv) lda AT, _mcount jsr AT, (AT), _mcount - .prologue 1 -#else - .prologue 0 #endif mov a0, v0 # e0 : move return value in place @@ -115,5 +106,5 @@ $oneq: $done: ret - END(__bzero) + cfi_endproc weak_alias (__bzero, bzero) diff --git a/sysdeps/alpha/memset.S b/sysdeps/alpha/memset.S index 4ac7092..db92771 100644 --- a/sysdeps/alpha/memset.S +++ b/sysdeps/alpha/memset.S @@ -1,4 +1,4 @@ -/* Copyright (C) 1996, 1997, 2003 Free Software Foundation, Inc. +/* Copyright (C) 1996-2012 Free Software Foundation, Inc. Contributed by Richard Henderson (rth@tamu.edu) This file is part of the GNU C Library. @@ -37,11 +37,11 @@ .set noreorder .text + .type memset, @function + .globl memset + .usepv memset, USEPV_PROF -/* There is a problem with either gdb (as of 4.16) or gas (as of 2.7) that - doesn't like putting the entry point for a procedure somewhere in the - middle of the procedure descriptor. Work around this by putting the main - loop in its own procedure descriptor. */ + cfi_startproc /* On entry to this basic block: t3 == loop counter @@ -49,12 +49,8 @@ a0 == possibly misaligned destination pointer a1 == replicated source character */ - .ent memset_loop .align 3 memset_loop: - .frame sp, 0, ra, 0 - .prologue 0 - beq t3, $tail blbc t3, 0f # skip single store if count even @@ -80,19 +76,14 @@ $tail: bne t4, 1f # is there a tail to do? stq_u t0, 0(a0) # e0 : ret # .. e1 : - .end memset_loop - -ENTRY(memset) +memset: #ifdef PROF ldgp gp, 0(pv) lda AT, _mcount jsr AT, (AT), _mcount - .prologue 1 -#else - .prologue 0 #endif - zapnot a1, 1, a1 # e0 : zero extend input character + and a1, 0xff, a1 # e0 : zero extend input character mov a0, v0 # .. e1 : move return value in place sll a1, 8, t0 # e0 : begin replicating the char beq a2, $done # .. e1 : early exit for zero-length store @@ -132,5 +123,5 @@ $oneq: $done: ret - END(memset) + cfi_endproc libc_hidden_builtin_def (memset) diff --git a/sysdeps/alpha/stxcpy.S b/sysdeps/alpha/stxcpy.S index 46f19a9..c55d005 100644 --- a/sysdeps/alpha/stxcpy.S +++ b/sysdeps/alpha/stxcpy.S @@ -1,4 +1,4 @@ -/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. +/* Copyright (C) 1996-2012 Free Software Foundation, Inc. Contributed by Richard Henderson (rth@tamu.edu) This file is part of the GNU C Library. @@ -43,22 +43,18 @@ .set noreorder .text + .type __stxcpy, @function + .globl __stxcpy + .usepv __stxcpy, no -/* There is a problem with either gdb (as of 4.16) or gas (as of 2.7) that - doesn't like putting the entry point for a procedure somewhere in the - middle of the procedure descriptor. Work around this by putting the - aligned copy in its own procedure descriptor */ - - .ent stxcpy_aligned - .align 3 -stxcpy_aligned: - .frame sp, 0, t9 - .prologue 0 + cfi_startproc + cfi_return_column (t9) /* On entry to this basic block: t0 == the first destination word for masking back in t1 == the first source word. */ - + .align 3 +stxcpy_aligned: /* Create the 1st output word and detect 0's in the 1st input word. */ lda t2, -1 # e1 : build a mask against false zero mskqh t2, a1, t2 # e0 : detection in the src word @@ -72,7 +68,6 @@ stxcpy_aligned: /* On entry to this basic block: t0 == the first destination word for masking back in t1 == a source word not containing a null. */ - $a_loop: stq_u t1, 0(a0) # e0 : addq a0, 8, a0 # .. e1 : @@ -106,15 +101,8 @@ $a_eos: 1: stq_u t1, 0(a0) # e0 : ret (t9) # .. e1 : - .end stxcpy_aligned - .align 3 - .ent __stxcpy - .globl __stxcpy __stxcpy: - .frame sp, 0, t9 - .prologue 0 - /* Are source and destination co-aligned? */ xor a0, a1, t0 # e0 : unop # : @@ -303,4 +291,4 @@ $unaligned: stq_u t1, 0(a0) # .. e0 : ret (t9) - .end __stxcpy + cfi_endproc diff --git a/sysdeps/alpha/stxncpy.S b/sysdeps/alpha/stxncpy.S index 5b81ac9..f8b494a 100644 --- a/sysdeps/alpha/stxncpy.S +++ b/sysdeps/alpha/stxncpy.S @@ -1,4 +1,4 @@ -/* Copyright (C) 1996, 1997, 2002 Free Software Foundation, Inc. +/* Copyright (C) 1996-2012 Free Software Foundation, Inc. Contributed by Richard Henderson (rth@tamu.edu) This file is part of the GNU C Library. @@ -52,22 +52,18 @@ .set noreorder .text + .type __stxncpy, @function + .globl __stxncpy + .usepv __stxncpy, no -/* There is a problem with either gdb (as of 4.16) or gas (as of 2.7) that - doesn't like putting the entry point for a procedure somewhere in the - middle of the procedure descriptor. Work around this by putting the - aligned copy in its own procedure descriptor */ - - .ent stxncpy_aligned - .align 3 -stxncpy_aligned: - .frame sp, 0, t9, 0 - .prologue 0 + cfi_startproc + cfi_return_column (t9) /* On entry to this basic block: t0 == the first destination word for masking back in t1 == the first source word. */ - + .align 3 +stxncpy_aligned: /* Create the 1st output word and detect 0's in the 1st input word. */ lda t2, -1 # e1 : build a mask against false zero mskqh t2, a1, t2 # e0 : detection in the src word @@ -81,7 +77,6 @@ stxncpy_aligned: /* On entry to this basic block: t0 == a source word not containing a null. */ - $a_loop: stq_u t0, 0(a0) # e0 : addq a0, 8, a0 # .. e1 : @@ -98,7 +93,6 @@ $a_loop: On entry to this basic block we have: t0 == the source word containing the null t7 == the cmpbge mask that found it. */ - $a_eos: negq t7, t8 # e0 : find low bit set and t7, t8, t8 # e1 (stall) @@ -126,15 +120,8 @@ $a_eoc: or t10, t7, t7 br $a_eos - .end stxncpy_aligned - .align 3 - .ent __stxncpy - .globl __stxncpy __stxncpy: - .frame sp, 0, t9, 0 - .prologue 0 - /* Are source and destination co-aligned? */ xor a0, a1, t1 # e0 : and a0, 7, t0 # .. e1 : find dest misalignment @@ -359,4 +346,4 @@ $unaligned: stq_u t0, 0(a0) # e0 : ret (t9) # .. e1 : - .end __stxncpy + cfi_endproc diff --git a/sysdeps/unix/alpha/sysdep.h b/sysdeps/unix/alpha/sysdep.h index e17bf21..4ee0746 100644 --- a/sysdeps/unix/alpha/sysdep.h +++ b/sysdeps/unix/alpha/sysdep.h @@ -71,6 +71,12 @@ .prologue 1 #endif /* PROF */ +#ifdef PROF +# define USEPV_PROF std +#else +# define USEPV_PROF no +#endif + #if RTLD_PRIVATE_ERRNO # define SYSCALL_ERROR_LABEL $syscall_error # define SYSCALL_ERROR_HANDLER \ -- 1.7.7.6