alpha: Use cfi_startproc instead of dual procedure descriptors

This commit is contained in:
Richard Henderson 2012-06-06 14:35:00 -07:00
parent a683563255
commit b2afe910fb
8 changed files with 73 additions and 131 deletions

View File

@ -1,5 +1,14 @@
2012-06-06 Richard Henderson <rth@twiddle.net> 2012-06-06 Richard Henderson <rth@twiddle.net>
* 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. * sysdeps/alpha/_mcount.S: Move .prologue after stack alloc.
2012-06-05 Richard Henderson <rth@twiddle.net> 2012-06-05 Richard Henderson <rth@twiddle.net>

View File

@ -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) Contributed by Richard Henderson (rth@tamu.edu)
EV6 optimized by Rick Gorton <rick.gorton@alpha-processor.com>. EV6 optimized by Rick Gorton <rick.gorton@alpha-processor.com>.
This file is part of the GNU C Library. This file is part of the GNU C Library.
@ -41,24 +41,20 @@
.arch ev6 .arch ev6
.set noat .set noat
.set noreorder .set noreorder
.text .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 cfi_startproc
doesn't like putting the entry point for a procedure somewhere in the cfi_return_column (t9)
middle of the procedure descriptor. Work around this by putting the
aligned copy in its own procedure descriptor */
.ent stxcpy_aligned
.align 4
stxcpy_aligned:
.frame sp, 0, t9
.prologue 0
/* On entry to this basic block: /* On entry to this basic block:
t0 == the first destination word for masking back in t0 == the first destination word for masking back in
t1 == the first source word. */ t1 == the first source word. */
.align 4
stxcpy_aligned:
/* Create the 1st output word and detect 0's in the 1st input word. */ /* Create the 1st output word and detect 0's in the 1st input word. */
lda t2, -1 # E : build a mask against false zero lda t2, -1 # E : build a mask against false zero
mskqh t2, a1, t2 # U : detection in the src word (stall) mskqh t2, a1, t2 # U : detection in the src word (stall)
@ -115,15 +111,8 @@ $a_eos:
nop nop
nop nop
.end stxcpy_aligned
.align 4 .align 4
.ent __stxcpy
.globl __stxcpy
__stxcpy: __stxcpy:
.frame sp, 0, t9
.prologue 0
/* Are source and destination co-aligned? */ /* Are source and destination co-aligned? */
xor a0, a1, t0 # E : xor a0, a1, t0 # E :
unop # E : unop # E :
@ -321,7 +310,5 @@ $unaligned:
or t0, t1, t1 # e1 : and put it there or t0, t1, t1 # e1 : and put it there
stq_u t1, 0(a0) # .. e0 : (stall) stq_u t1, 0(a0) # .. e0 : (stall)
ret (t9) # e1 : ret (t9) # e1 :
nop
.end __stxcpy
cfi_endproc

View File

@ -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) Contributed by Richard Henderson (rth@tamu.edu)
EV6 optimized by Rick Gorton <rick.gorton@alpha-processor.com>. EV6 optimized by Rick Gorton <rick.gorton@alpha-processor.com>.
This file is part of the GNU C Library. This file is part of the GNU C Library.
@ -49,22 +49,19 @@
.set noat .set noat
.set noreorder .set noreorder
/* There is a problem with either gdb (as of 4.16) or gas (as of 2.7) that .text
doesn't like putting the entry point for a procedure somewhere in the .type __stxncpy, @function
middle of the procedure descriptor. Work around this by putting the .globl __stxncpy
aligned copy in its own procedure descriptor */ .usepv __stxncpy, no
cfi_startproc
.ent stxncpy_aligned cfi_return_column (t9)
.align 4
stxncpy_aligned:
.frame sp, 0, t9, 0
.prologue 0
/* On entry to this basic block: /* On entry to this basic block:
t0 == the first destination word for masking back in t0 == the first destination word for masking back in
t1 == the first source word. */ t1 == the first source word. */
.align 4
stxncpy_aligned:
/* Create the 1st output word and detect 0's in the 1st input word. */ /* Create the 1st output word and detect 0's in the 1st input word. */
lda t2, -1 # E : build a mask against false zero lda t2, -1 # E : build a mask against false zero
mskqh t2, a1, t2 # U : detection in the src word (stall) 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: On entry to this basic block we have:
t0 == the source word containing the null t0 == the source word containing the null
t7 == the cmpbge mask that found it. */ t7 == the cmpbge mask that found it. */
$a_eos: $a_eos:
negq t7, t8 # E : find low bit set negq t7, t8 # E : find low bit set
and t7, t8, t8 # E : (stall) and t7, t8, t8 # E : (stall)
@ -144,15 +140,8 @@ $a_eoc:
nop nop
nop nop
.end stxncpy_aligned
.align 4 .align 4
.ent __stxncpy
.globl __stxncpy
__stxncpy: __stxncpy:
.frame sp, 0, t9, 0
.prologue 0
/* Are source and destination co-aligned? */ /* Are source and destination co-aligned? */
xor a0, a1, t1 # E : xor a0, a1, t1 # E :
and a0, 7, t0 # E : find dest misalignment and a0, 7, t0 # E : find dest misalignment
@ -166,16 +155,14 @@ __stxncpy:
sll t10, t2, t10 # U : t10 = bitmask of last count byte sll t10, t2, t10 # U : t10 = bitmask of last count byte
bne t1, $unaligned # U : bne t1, $unaligned # U :
/* We are co-aligned; take care of a partial first word. */ /* We are co-aligned; take care of a partial first word. */
ldq_u t1, 0(a1) # L : load first src word ldq_u t1, 0(a1) # L : load first src word
addq a1, 8, a1 # E : 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 : ldq_u t0, 0(a0) # L :
nop
nop
br stxncpy_aligned # .. e1 : br stxncpy_aligned # U :
nop nop
nop nop
nop nop
@ -231,7 +218,7 @@ $u_head:
extqh t2, a1, t0 # U : position lo-bits of hi word (stall) extqh t2, a1, t0 # U : position lo-bits of hi word (stall)
cmpbge zero, t2, t7 # E : cmpbge zero, t2, t7 # E :
nop nop
bne t7, $u_eos # U : bne t7, $u_eos # U :
/* Unaligned copy main loop. In order to avoid reading too much, /* Unaligned copy main loop. In order to avoid reading too much,
@ -314,7 +301,7 @@ $u_final:
1: stq_u t0, 0(a0) # L : 1: stq_u t0, 0(a0) # L :
ret (t9) # L0 : Latency=3 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: On entry to this basic block:
t1 == the shifted high-order bits from the previous source word */ t1 == the shifted high-order bits from the previous source word */
$u_eoc: $u_eoc:
@ -325,7 +312,7 @@ $u_eoc:
ldq_u t2, 8(a1) # L : load final src word ldq_u t2, 8(a1) # L : load final src word
nop 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) or t1, t0, t1 # E : (stall)
1: cmpbge zero, t1, t7 # E : 1: cmpbge zero, t1, t7 # E :
@ -394,9 +381,5 @@ $unaligned:
stq_u t0, 0(a0) # L : (stall) stq_u t0, 0(a0) # L : (stall)
ret (t9) # L0 : Latency=3 ret (t9) # L0 : Latency=3
nop
nop
nop
.end __stxncpy
cfi_endproc

View File

@ -36,23 +36,19 @@
.set noreorder .set noreorder
.text .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 cfi_startproc
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. */
/* On entry to this basic block: /* On entry to this basic block:
t3 == loop counter t3 == loop counter
t4 == bytes in partial final word t4 == bytes in partial final word
a0 == possibly misaligned destination pointer */ a0 == possibly misaligned destination pointer */
.ent bzero_loop
.align 3 .align 3
bzero_loop: bzero_loop:
.frame sp, 0, ra, 0
.prologue 0
beq t3, $tail # beq t3, $tail #
blbc t3, 0f # skip single store if count even 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) # stq_u t0, 0(a0) #
ret # ret #
.end bzero_loop __bzero:
ENTRY(__bzero)
#ifdef PROF #ifdef PROF
ldgp gp, 0(pv) ldgp gp, 0(pv)
lda AT, _mcount lda AT, _mcount
jsr AT, (AT), _mcount jsr AT, (AT), _mcount
.prologue 1
#else
.prologue 0
#endif #endif
mov a0, v0 # e0 : move return value in place mov a0, v0 # e0 : move return value in place
@ -115,5 +106,5 @@ $oneq:
$done: ret $done: ret
END(__bzero) cfi_endproc
weak_alias (__bzero, bzero) weak_alias (__bzero, bzero)

View File

@ -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) Contributed by Richard Henderson (rth@tamu.edu)
This file is part of the GNU C Library. This file is part of the GNU C Library.
@ -37,11 +37,11 @@
.set noreorder .set noreorder
.text .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 cfi_startproc
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. */
/* On entry to this basic block: /* On entry to this basic block:
t3 == loop counter t3 == loop counter
@ -49,12 +49,8 @@
a0 == possibly misaligned destination pointer a0 == possibly misaligned destination pointer
a1 == replicated source character */ a1 == replicated source character */
.ent memset_loop
.align 3 .align 3
memset_loop: memset_loop:
.frame sp, 0, ra, 0
.prologue 0
beq t3, $tail beq t3, $tail
blbc t3, 0f # skip single store if count even 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 : stq_u t0, 0(a0) # e0 :
ret # .. e1 : ret # .. e1 :
.end memset_loop memset:
ENTRY(memset)
#ifdef PROF #ifdef PROF
ldgp gp, 0(pv) ldgp gp, 0(pv)
lda AT, _mcount lda AT, _mcount
jsr AT, (AT), _mcount jsr AT, (AT), _mcount
.prologue 1
#else
.prologue 0
#endif #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 mov a0, v0 # .. e1 : move return value in place
sll a1, 8, t0 # e0 : begin replicating the char sll a1, 8, t0 # e0 : begin replicating the char
beq a2, $done # .. e1 : early exit for zero-length store beq a2, $done # .. e1 : early exit for zero-length store
@ -132,5 +123,5 @@ $oneq:
$done: ret $done: ret
END(memset) cfi_endproc
libc_hidden_builtin_def (memset) libc_hidden_builtin_def (memset)

View File

@ -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) Contributed by Richard Henderson (rth@tamu.edu)
This file is part of the GNU C Library. This file is part of the GNU C Library.
@ -43,22 +43,18 @@
.set noreorder .set noreorder
.text .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 cfi_startproc
doesn't like putting the entry point for a procedure somewhere in the cfi_return_column (t9)
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
/* On entry to this basic block: /* On entry to this basic block:
t0 == the first destination word for masking back in t0 == the first destination word for masking back in
t1 == the first source word. */ t1 == the first source word. */
.align 3
stxcpy_aligned:
/* Create the 1st output word and detect 0's in the 1st input word. */ /* Create the 1st output word and detect 0's in the 1st input word. */
lda t2, -1 # e1 : build a mask against false zero lda t2, -1 # e1 : build a mask against false zero
mskqh t2, a1, t2 # e0 : detection in the src word mskqh t2, a1, t2 # e0 : detection in the src word
@ -72,7 +68,6 @@ stxcpy_aligned:
/* On entry to this basic block: /* On entry to this basic block:
t0 == the first destination word for masking back in t0 == the first destination word for masking back in
t1 == a source word not containing a null. */ t1 == a source word not containing a null. */
$a_loop: $a_loop:
stq_u t1, 0(a0) # e0 : stq_u t1, 0(a0) # e0 :
addq a0, 8, a0 # .. e1 : addq a0, 8, a0 # .. e1 :
@ -106,15 +101,8 @@ $a_eos:
1: stq_u t1, 0(a0) # e0 : 1: stq_u t1, 0(a0) # e0 :
ret (t9) # .. e1 : ret (t9) # .. e1 :
.end stxcpy_aligned
.align 3 .align 3
.ent __stxcpy
.globl __stxcpy
__stxcpy: __stxcpy:
.frame sp, 0, t9
.prologue 0
/* Are source and destination co-aligned? */ /* Are source and destination co-aligned? */
xor a0, a1, t0 # e0 : xor a0, a1, t0 # e0 :
unop # : unop # :
@ -303,4 +291,4 @@ $unaligned:
stq_u t1, 0(a0) # .. e0 : stq_u t1, 0(a0) # .. e0 :
ret (t9) ret (t9)
.end __stxcpy cfi_endproc

View File

@ -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) Contributed by Richard Henderson (rth@tamu.edu)
This file is part of the GNU C Library. This file is part of the GNU C Library.
@ -52,22 +52,18 @@
.set noreorder .set noreorder
.text .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 cfi_startproc
doesn't like putting the entry point for a procedure somewhere in the cfi_return_column (t9)
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
/* On entry to this basic block: /* On entry to this basic block:
t0 == the first destination word for masking back in t0 == the first destination word for masking back in
t1 == the first source word. */ t1 == the first source word. */
.align 3
stxncpy_aligned:
/* Create the 1st output word and detect 0's in the 1st input word. */ /* Create the 1st output word and detect 0's in the 1st input word. */
lda t2, -1 # e1 : build a mask against false zero lda t2, -1 # e1 : build a mask against false zero
mskqh t2, a1, t2 # e0 : detection in the src word mskqh t2, a1, t2 # e0 : detection in the src word
@ -81,7 +77,6 @@ stxncpy_aligned:
/* On entry to this basic block: /* On entry to this basic block:
t0 == a source word not containing a null. */ t0 == a source word not containing a null. */
$a_loop: $a_loop:
stq_u t0, 0(a0) # e0 : stq_u t0, 0(a0) # e0 :
addq a0, 8, a0 # .. e1 : addq a0, 8, a0 # .. e1 :
@ -98,7 +93,6 @@ $a_loop:
On entry to this basic block we have: On entry to this basic block we have:
t0 == the source word containing the null t0 == the source word containing the null
t7 == the cmpbge mask that found it. */ t7 == the cmpbge mask that found it. */
$a_eos: $a_eos:
negq t7, t8 # e0 : find low bit set negq t7, t8 # e0 : find low bit set
and t7, t8, t8 # e1 (stall) and t7, t8, t8 # e1 (stall)
@ -126,15 +120,8 @@ $a_eoc:
or t10, t7, t7 or t10, t7, t7
br $a_eos br $a_eos
.end stxncpy_aligned
.align 3 .align 3
.ent __stxncpy
.globl __stxncpy
__stxncpy: __stxncpy:
.frame sp, 0, t9, 0
.prologue 0
/* Are source and destination co-aligned? */ /* Are source and destination co-aligned? */
xor a0, a1, t1 # e0 : xor a0, a1, t1 # e0 :
and a0, 7, t0 # .. e1 : find dest misalignment and a0, 7, t0 # .. e1 : find dest misalignment
@ -359,4 +346,4 @@ $unaligned:
stq_u t0, 0(a0) # e0 : stq_u t0, 0(a0) # e0 :
ret (t9) # .. e1 : ret (t9) # .. e1 :
.end __stxncpy cfi_endproc

View File

@ -71,6 +71,12 @@
.prologue 1 .prologue 1
#endif /* PROF */ #endif /* PROF */
#ifdef PROF
# define USEPV_PROF std
#else
# define USEPV_PROF no
#endif
#if RTLD_PRIVATE_ERRNO #if RTLD_PRIVATE_ERRNO
# define SYSCALL_ERROR_LABEL $syscall_error # define SYSCALL_ERROR_LABEL $syscall_error
# define SYSCALL_ERROR_HANDLER \ # define SYSCALL_ERROR_HANDLER \