From 24c177a07995adcb0057ad3504ef997a246ee3a1 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Thu, 23 May 1996 05:32:12 +0000 Subject: [PATCH] Wed May 22 00:40:50 1996 David Mosberger-Tang * sysdeps/alpha/_mcount.S, sysdeps/alpha/bb_init_func.S, sysdeps/alpha/bsd-setjmp.S, sysdeps/alpha/ffs.S, sysdeps/alpha/htonl.S, sysdeps/alpha/htons.S, sysdeps/alpha/memchr.S, sysdeps/alpha/setjmp.S, sysdeps/alpha/strlen.S, sysdeps/alpha/udiv_qrnnd.S, sysdeps/unix/sysv/linux/alpha/brk.S, sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S, sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S, sysdeps/unix/sysv/linux/alpha/pipe.S, sysdeps/unix/sysv/linux/sigsuspend.S, sysdeps/unix/sysv/linux/alpha/syscall.S, sysdeps/unix/sysv/linux/alpha/sysdep.S: Remove include of regdef.h. sysdep.h includes it now. Replace ENTRY by LEAF with appropriate framesize declaration. Replace "lda pv,sym/jsr pv" by "jsr sym". --- sysdeps/alpha/_mcount.S | 9 +++---- sysdeps/alpha/bb_init_func.S | 18 +++++++------ sysdeps/alpha/bsd-setjmp.S | 8 +++--- sysdeps/alpha/ffs.S | 5 ---- sysdeps/alpha/htonl.S | 24 ++++++++---------- sysdeps/alpha/htons.S | 12 +++------ sysdeps/alpha/memchr.S | 7 ++---- sysdeps/alpha/strlen.S | 5 ---- sysdeps/alpha/udiv_qrnnd.S | 12 ++++----- sysdeps/unix/sysv/linux/alpha/brk.S | 11 ++++---- .../sysv/linux/alpha/ieee_get_fp_control.S | 10 +++++--- .../sysv/linux/alpha/ieee_set_fp_control.S | 10 ++++---- sysdeps/unix/sysv/linux/alpha/pipe.S | 5 ++-- sysdeps/unix/sysv/linux/alpha/syscall.S | 25 +++++++++---------- sysdeps/unix/sysv/linux/alpha/sysdep.S | 7 +++--- 15 files changed, 73 insertions(+), 95 deletions(-) diff --git a/sysdeps/alpha/_mcount.S b/sysdeps/alpha/_mcount.S index 2d6e2ed532..7944544e18 100644 --- a/sysdeps/alpha/_mcount.S +++ b/sysdeps/alpha/_mcount.S @@ -34,18 +34,15 @@ holds the return address of the function's caller (selfpc and frompc, respectively in gmon.c language...). */ #include -#ifdef __linux__ -# include -#else -# include -#endif #undef ret /* discard `ret' as defined in sysdep.h */ .set noat .set noreorder -ENTRY(_mcount) +LEAF(_mcount, 0xb0) + .prologue 0 + subq sp, 0xb0, sp stq a0, 0x00(sp) mov ra, a0 # a0 = caller-pc diff --git a/sysdeps/alpha/bb_init_func.S b/sysdeps/alpha/bb_init_func.S index 9bf985ccc0..cd860b8303 100644 --- a/sysdeps/alpha/bb_init_func.S +++ b/sysdeps/alpha/bb_init_func.S @@ -24,11 +24,6 @@ caller-saved (call-used) registers (except for argument registers a1-a5). */ #include -#ifdef __linux__ -# include -#else -# include -#endif /* * These offsets should match with "struct bb" declared in gcc/libgcc2.c. @@ -40,12 +35,19 @@ a1-a5). */ .set noreorder ENTRY(__bb_init_func) + .prologue 0 + ldq t0, ZERO_WORD(a0) /* t0 <- blocks->zero_word */ beq t0, init /* not initialized yet -> */ ret + + .end __bb_init_func -init: subq sp, 0x38, sp +LEAF(init, 0x38) + subq sp, 0x38, sp + .prologue 0 + stq pv, 0x30(sp) br pv, 1f 1: ldgp gp, 0(pv) @@ -81,5 +83,5 @@ init: subq sp, 0x38, sp leave: ldq pv, 0x30(sp) addq sp, 0x38, sp ret - - .end __bb_init_func + + .end init diff --git a/sysdeps/alpha/bsd-setjmp.S b/sysdeps/alpha/bsd-setjmp.S index 470f7bc47d..113bc47c88 100644 --- a/sysdeps/alpha/bsd-setjmp.S +++ b/sysdeps/alpha/bsd-setjmp.S @@ -23,8 +23,8 @@ Cambridge, MA 02139, USA. */ #include -ENTRY (setjmp) - lda $27, __sigsetjmp /* Load address to jump to. */ - bis $31, 1, $17 /* Pass a second argument of one. */ - jmp $31, ($27), __sigsetjmp /* Call __sigsetjmp. */ +ENTRY(setjmp) + lda $27, __sigsetjmp /* Load address to jump to. */ + bis $31, 1, $17 /* Pass a second argument of one. */ + jmp $31, ($27), __sigsetjmp /* Call __sigsetjmp. */ .end setjmp diff --git a/sysdeps/alpha/ffs.S b/sysdeps/alpha/ffs.S index 7676b85aaa..7cf6281682 100644 --- a/sysdeps/alpha/ffs.S +++ b/sysdeps/alpha/ffs.S @@ -22,11 +22,6 @@ Cambridge, MA 02139, USA. */ architecture. */ #include -#ifdef __linux__ -# include -#else -#include -#endif .set noreorder .set noat diff --git a/sysdeps/alpha/htonl.S b/sysdeps/alpha/htonl.S index d0bf7e1718..8c1c700212 100644 --- a/sysdeps/alpha/htonl.S +++ b/sysdeps/alpha/htonl.S @@ -17,22 +17,18 @@ not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include -#ifdef __linux__ -# include -#else -#include -#endif ENTRY(__htonl) - extlh a0,5,t1 # t1 = dd000000 - zap a0,0xfd,t2 # t2 = 0000cc00 - sll t2,5,t2 # t2 = 00198000 - s8addl t2,t1,t1 # t1 = ddcc0000 - zap a0,0xfb,t2 # t2 = 00bb0000 - srl t2,8,t2 # t2 = 0000bb00 - extbl a0,3,v0 # v0 = 000000aa - or t1,v0,v0 # v0 = ddcc00aa - or t2,v0,v0 # v0 = ddccbbaa + .prologue 0 + extlh a0, 5, t1 # t1 = dd000000 + zap a0, 0xfd, t2 # t2 = 0000cc00 + sll t2, 5, t2 # t2 = 00198000 + s8addl t2, t1, t1 # t1 = ddcc0000 + zap a0, 0xfb, t2 # t2 = 00bb0000 + srl t2, 8, t2 # t2 = 0000bb00 + extbl a0, 3, v0 # v0 = 000000aa + or t1, v0, v0 # v0 = ddcc00aa + or t2, v0, v0 # v0 = ddccbbaa ret .end __htonl diff --git a/sysdeps/alpha/htons.S b/sysdeps/alpha/htons.S index 6e18c7c441..cb22b21661 100644 --- a/sysdeps/alpha/htons.S +++ b/sysdeps/alpha/htons.S @@ -17,16 +17,12 @@ not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include -#ifdef __linux__ -# include -#else -#include -#endif ENTRY(__htons) - extwh a0,7,t1 # t1 = bb00 - extbl a0,1,v0 # v0 = 00aa - bis v0,t1,v0 # v0 = bbaa + .prologue 0 + extwh a0, 7, t1 # t1 = bb00 + extbl a0, 1, v0 # v0 = 00aa + bis v0, t1, v0 # v0 = bbaa ret .end __htons diff --git a/sysdeps/alpha/memchr.S b/sysdeps/alpha/memchr.S index 118a1f13d1..2f78697418 100644 --- a/sysdeps/alpha/memchr.S +++ b/sysdeps/alpha/memchr.S @@ -35,16 +35,13 @@ For correctness consider that: */ #include -#ifdef __linux__ -# include -#else -#include -#endif .set noreorder .set noat ENTRY(memchr) + .prologue 0 + beq a2, not_found ldq_u t0, 0(a0) # load first quadword (a0 may be misaligned) addq a0, a2, t4 diff --git a/sysdeps/alpha/strlen.S b/sysdeps/alpha/strlen.S index 7e6a61be8c..c64126164a 100644 --- a/sysdeps/alpha/strlen.S +++ b/sysdeps/alpha/strlen.S @@ -29,11 +29,6 @@ architecture: binary search needs). */ #include -#ifdef __linux__ -# include -#else -#include -#endif .set noreorder .set noat diff --git a/sysdeps/alpha/udiv_qrnnd.S b/sysdeps/alpha/udiv_qrnnd.S index d3d2cee93d..eb134f25c7 100644 --- a/sysdeps/alpha/udiv_qrnnd.S +++ b/sysdeps/alpha/udiv_qrnnd.S @@ -19,15 +19,15 @@ # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, # MA 02111-1307, USA. +#include .set noreorder .set noat -.text - .align 3 - .globl __udiv_qrnnd - .ent __udiv_qrnnd -__udiv_qrnnd: - .frame $30,0,$26,0 + + .text + +LEAF(__udiv_qrnnd, 0) + .prologue 0 #define cnt $2 #define tmp $3 diff --git a/sysdeps/unix/sysv/linux/alpha/brk.S b/sysdeps/unix/sysv/linux/alpha/brk.S index afd2e3203c..4582539bc1 100644 --- a/sysdeps/unix/sysv/linux/alpha/brk.S +++ b/sysdeps/unix/sysv/linux/alpha/brk.S @@ -36,24 +36,23 @@ __curbrk: .quad _end .text -ENTRY(__brk) +LEAF(__brk, 0) ldgp gp, 0(t12) .prologue 1 ldi v0, __NR_brk call_pal PAL_callsys subq a0, v0, t0 - bne t0, error + bne t0, error /* Update __curbrk and return cleanly. */ - stl a0, __curbrk - mov zero, v0 + stl a0, __curbrk + mov zero, v0 ret /* What a horrible way to die. */ error: ldi v0, ENOMEM - lda pv, syscall_error - jmp zero,(pv) + jmp zero, syscall_error .end __brk diff --git a/sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S b/sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S index 4c86e398d8..c3486acc1a 100644 --- a/sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S +++ b/sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S @@ -21,9 +21,10 @@ Cambridge, MA 02139, USA. */ #define GSI_IEEE_FP_CONTROL 45 .text -ENTRY(__ieee_get_fp_control) + +LEAF(__ieee_get_fp_control, 8) lda sp, -8(sp) - .prologue 1 + .prologue 0 mov sp, a1 ldi a0, GSI_IEEE_FP_CONTROL @@ -36,8 +37,9 @@ ENTRY(__ieee_get_fp_control) ret error: lda sp, 8(sp) - lda pv, syscall_error - jmp zero,(pv) + br gp, 1f +1: ldgp gp, 0(gp) + jmp zero, syscall_error .end __ieee_get_fp_control diff --git a/sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S b/sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S index d10e9bc24c..507b5d5cab 100644 --- a/sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S +++ b/sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S @@ -20,10 +20,9 @@ Cambridge, MA 02139, USA. */ #define SSI_IEEE_FP_CONTROL 14 - .text -ENTRY(__ieee_set_fp_control) +LEAF(__ieee_set_fp_control, 8) lda sp, -8(sp) - .prologue 1 + .prologue 0 stq a0, 0(sp) mov sp, a1 @@ -36,8 +35,9 @@ ENTRY(__ieee_set_fp_control) bne a3, error ret -error: lda pv, syscall_error - jmp zero,(pv) +error: br gp, 1f +1: ldgp gp, 0(gp) + jmp zero, syscall_error .end __ieee_set_fp_control diff --git a/sysdeps/unix/sysv/linux/alpha/pipe.S b/sysdeps/unix/sysv/linux/alpha/pipe.S index f613b08fe0..40958466a4 100644 --- a/sysdeps/unix/sysv/linux/alpha/pipe.S +++ b/sysdeps/unix/sysv/linux/alpha/pipe.S @@ -21,7 +21,7 @@ Cambridge, MA 02139, USA. */ #include .text -ENTRY(__pipe) +LEAF(__pipe, 0) .prologue 0 ldi v0, __NR_pipe @@ -35,8 +35,7 @@ ENTRY(__pipe) error: br gp, 1f 1: ldgp gp, 0(gp) - lda pv, syscall_error - jmp zero, (pv) + jmp zero, syscall_error .end __pipe diff --git a/sysdeps/unix/sysv/linux/alpha/syscall.S b/sysdeps/unix/sysv/linux/alpha/syscall.S index 54a8484c58..c80a523239 100644 --- a/sysdeps/unix/sysv/linux/alpha/syscall.S +++ b/sysdeps/unix/sysv/linux/alpha/syscall.S @@ -41,21 +41,20 @@ Cambridge, MA 02139, USA. */ */ -1: br gp,2f -2: ldgp gp,0(gp) - jmp zero,syscall_error - - -ENTRY (__syscall) - bis a0,a0,v0 # Syscall number -> v0 - bis a1,a1,a0 # arg1-arg5 -> a0-a4 - bis a2,a2,a1 - bis a3,a3,a2 - bis a4,a4,a3 - bis a5,a5,a4 +LEAF(__syscall, 0) + bis a0, a0, v0 # Syscall number -> v0 + bis a1, a1, a0 # arg1-arg5 -> a0-a4 + bis a2, a2, a1 + bis a3, a3, a2 + bis a4, a4, a3 + bis a5, a5, a4 call_pal PAL_callsys # Invoke system call - bne a3,1b + bne a3, error ret +error: br gp, 2f +2: ldgp gp, 0(gp) + jmp zero, syscall_error + weak_alias(__syscall, syscall) diff --git a/sysdeps/unix/sysv/linux/alpha/sysdep.S b/sysdeps/unix/sysv/linux/alpha/sysdep.S index 74b153e7b9..84582f404e 100644 --- a/sysdeps/unix/sysv/linux/alpha/sysdep.S +++ b/sysdeps/unix/sysv/linux/alpha/sysdep.S @@ -20,11 +20,12 @@ Cambridge, MA 02139, USA. */ #define _ERRNO_H #include -ENTRY(syscall_error) +LEAF(syscall_error, 0) + .prologue 1 + /* Store return value in errno... */ ldgp gp, 0(t12) - lda t0, errno - stl v0, 0(t0) + stl v0, errno /* And just kick back a -1. */ ldi v0, -1