public inbox for libc-ports@sourceware.org
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: libc-ports@sourceware.org
Subject: [PATCH 2/3] alpha: Tidy up ieee_get/set_fp_control syscalls
Date: Wed, 08 Aug 2012 14:56:00 -0000	[thread overview]
Message-ID: <1344437762-3593-3-git-send-email-rth@twiddle.net> (raw)
In-Reply-To: <1344437762-3593-1-git-send-email-rth@twiddle.net>

---
 ports/ChangeLog.alpha                              |    5 +++
 .../unix/sysv/linux/alpha/ieee_get_fp_control.S    |   38 +++++++------------
 .../unix/sysv/linux/alpha/ieee_set_fp_control.S    |   38 ++++++-------------
 3 files changed, 31 insertions(+), 50 deletions(-)

diff --git a/ports/ChangeLog.alpha b/ports/ChangeLog.alpha
index 282900a..719fc6a 100644
--- a/ports/ChangeLog.alpha
+++ b/ports/ChangeLog.alpha
@@ -1,5 +1,10 @@
 2012-08-08  Richard Henderson  <rth@redhat.com>
 
+	* sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S: Use dwarf2
+	cfi markup for unwind.  Adjust stack early so that the normal
+	syscall error path can be used.
+	* sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S: Likewise.
+
 	* sysdeps/unix/sysv/linux/alpha/kernel-features.h
 	(__ASSUME_STAT64_SYSCALL): Remove.
 	* sysdeps/unix/sysv/linux/alpha/fxstat.c: Remove test
diff --git a/ports/sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S b/ports/sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S
index ec24297..74ad499 100644
--- a/ports/sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S
+++ b/ports/sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1995, 1996, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by David Mosberger <davidm@azstarnet.com>, 1995.
 
@@ -22,39 +22,29 @@
 
 	.text
 
-LEAF(__ieee_get_fp_control, 16)
-#ifdef PROF
-	ldgp	gp, 0(pv)
-	lda	sp, -16(sp)
-	.set noat
-	lda	AT, _mcount
-	jsr	AT, (AT), _mcount
-	.set at
-	.prologue 1
-#elif defined PIC
-	lda	sp, -16(sp)
-	.prologue 0
-#else
-	ldgp	gp, 0(pv)
+ENTRY(__ieee_get_fp_control)
+	cfi_startproc
+	PSEUDO_PROLOGUE
+
 	lda	sp, -16(sp)
-	.prologue 1
-#endif
+	cfi_adjust_cfa_offset(16)
 
 	mov	sp, a1
 	ldi	a0, GSI_IEEE_FP_CONTROL
 	ldi	v0, __NR_osf_getsysinfo
 	call_pal PAL_callsys
-	bne	a3, $error
 
-	ldq	v0, 0(sp)
+	ldq	t0, 0(sp)
 	lda	sp, 16(sp)
-	ret
+	cfi_adjust_cfa_offset(-16)
 
-$error:
-	lda	sp, 16(sp)
-	SYSCALL_ERROR_HANDLER
+	bne	a3, SYSCALL_ERROR_LABEL
+
+	mov	t0, v0
+	ret
 
-	END(__ieee_get_fp_control)
+PSEUDO_END(__ieee_get_fp_control)
+	cfi_endproc
 
 libc_hidden_def(__ieee_get_fp_control)
 weak_alias (__ieee_get_fp_control, ieee_get_fp_control)
diff --git a/ports/sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S b/ports/sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S
index 1d42524..f022b42 100644
--- a/ports/sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S
+++ b/ports/sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993, 1995, 1996, 1997, 2003, 2004
-   Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by David Mosberger <davidm@azstarnet.com>, 1995.
 
@@ -21,40 +20,27 @@
 #include "kernel_sysinfo.h"
 
 
-LEAF(__ieee_set_fp_control, 16)
-#ifdef PROF
-	ldgp	gp, 0(pv)
-	lda	sp, -16(sp)
-	.set noat
-	lda	AT, _mcount
-	jsr	AT, (AT), _mcount
-	.set at
-	.prologue 1
-#elif defined PIC
-	lda	sp, -16(sp)
-	.prologue 0
-#else
-	ldgp	gp, 0(pv)
+ENTRY(__ieee_set_fp_control)
+	cfi_startproc
+	PSEUDO_PROLOGUE
+
 	lda	sp, -16(sp)
-	.prologue 1
-#endif
+	cfi_adjust_cfa_offset(16)
 
+	ldi	v0, __NR_osf_setsysinfo
 	stq	a0, 0(sp)
 	mov	sp, a1
 	ldi	a0, SSI_IEEE_FP_CONTROL
-	ldi	v0, __NR_osf_setsysinfo
 	call_pal PAL_callsys
 
-	bne	a3, $error
-
 	lda	sp, 16(sp)
-	ret
+	cfi_adjust_cfa_offset(-16)
 
-$error:
-	lda	sp, 16(sp)
-	SYSCALL_ERROR_HANDLER
+	bne	a3, SYSCALL_ERROR_LABEL
+	ret
 
-	END(__ieee_set_fp_control)
+PSEUDO_END(__ieee_set_fp_control)
+	cfi_endproc
 
 libc_hidden_def(__ieee_set_fp_control)
 weak_alias (__ieee_set_fp_control, ieee_set_fp_control)
-- 
1.7.7.6

  parent reply	other threads:[~2012-08-08 14:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-08 14:56 [PATCH 0/3] alpha: post kernel version bump cleanup Richard Henderson
2012-08-08 14:56 ` [PATCH 1/3] alpha: Purge __ASSUME_STAT64_SYSCALL Richard Henderson
2012-08-08 14:56 ` Richard Henderson [this message]
2012-08-08 14:56 ` [PATCH 3/3] alpha: Purge __ASSUME_IEEE_RAISE_EXCEPTION Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1344437762-3593-3-git-send-email-rth@twiddle.net \
    --to=rth@twiddle.net \
    --cc=libc-ports@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).