From: John David Anglin <dave.anglin@bell.net>
To: Mike Frysinger <vapier@gentoo.org>
Cc: libc-alpha@sourceware.org, carlos@systemhalted.org
Subject: Re: [PATCH] hppa: fix __O_SYNC to match the kernel
Date: Sat, 07 Mar 2015 17:13:00 -0000 [thread overview]
Message-ID: <BLU437-SMTP89A288FA36C212A076A4A1971D0@phx.gbl> (raw)
In-Reply-To: <20150227065339.GO29461@vapier>
[-- Attachment #1: Type: text/plain, Size: 793 bytes --]
On 2015-02-27, at 1:53 AM, Mike Frysinger wrote:
> On 24 Feb 2015 09:48, John David Anglin wrote:
>> Mike, thanks for sending this change. Reminds me I should go through
>> the Debian glibc
>> patches and see what else needs sending.
>
> this should be an easy one:
> https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=1c1d3f4f11b4a911a3b6ffab0aac61d5f8e02873
>
> if you could provide context, i could shepherd it through.
> -mike
Attached is an updated patch. It fixes the saving and updating of the floating-point environment
in feholdexcept and fesetenv. The glibc test "test-fenv" passes with this change.
The patch has been tested with Debian glibc 2.19-15+b1 with no observed regressions.
Regards,
Dave
--
John David Anglin dave.anglin@bell.net
[-- Attachment #2: local-fpa-r2.diff.txt --]
[-- Type: text/plain, Size: 2212 bytes --]
2015-03-07 John David Anglin <danglin@gcc.gnu.org>
* ports/sysdeps/hppa/fpu/feholdexcpt.c (feholdexcept): Don't modify
bufptr in asms.
* ports/sysdeps/hppa/fpu/fesetenv.c (fesetenv): Likewise.
Index: glibc-2.19/ports/sysdeps/hppa/fpu/feholdexcpt.c
===================================================================
--- glibc-2.19.orig/ports/sysdeps/hppa/fpu/feholdexcpt.c
+++ glibc-2.19/ports/sysdeps/hppa/fpu/feholdexcpt.c
@@ -29,8 +29,8 @@ feholdexcept (fenv_t *envp)
/* Store the environment. */
bufptr = clear.buf;
__asm__ (
- "fstd,ma %%fr0,8(%1)\n"
- : "=m" (clear), "+r" (bufptr) : : "%r0");
+ "fstd %%fr0,0(%1)\n"
+ : "=m" (clear) : "r" (bufptr) : "%r0");
memcpy (envp, &clear.env, sizeof (fenv_t));
/* Clear exception queues */
@@ -40,11 +40,9 @@ feholdexcept (fenv_t *envp)
/* Now clear all flags */
clear.env.__status_word &= ~(FE_ALL_EXCEPT << 27);
- /* Load the new environment. Note: fr0 must load last to enable T-bit
- Thus we start bufptr at the end and work backwards */
- bufptr = (unsigned long long *)((unsigned int)(clear.buf) + sizeof(unsigned int)*4);
+ /* Load the new environment. Note: fr0 must load last to enable T-bit. */
__asm__ (
- "fldd,mb -8(%0),%%fr0\n"
+ "fldd 0(%0),%%fr0\n"
: : "r" (bufptr), "m" (clear) : "%r0");
return 0;
Index: glibc-2.19/ports/sysdeps/hppa/fpu/fesetenv.c
===================================================================
--- glibc-2.19.orig/ports/sysdeps/hppa/fpu/fesetenv.c
+++ glibc-2.19/ports/sysdeps/hppa/fpu/fesetenv.c
@@ -33,7 +33,7 @@ fesetenv (const fenv_t *envp)
we want to use from the environment specified by the parameter. */
bufptr = temp.buf;
__asm__ (
- "fstd,ma %%fr0,8(%1)\n"
+ "fstd %%fr0,0(%1)\n"
: "=m" (temp) : "r" (bufptr) : "%r0");
temp.env.__status_word &= ~(FE_ALL_EXCEPT
@@ -54,7 +54,7 @@ fesetenv (const fenv_t *envp)
we take advantage of that to load in reverse order so fr0
is loaded last and T-Bit is enabled. */
__asm__ (
- "fldd,mb -8(%1),%%fr0\n"
+ "fldd 0(%1),%%fr0\n"
: : "m" (temp), "r" (bufptr) : "%r0" );
/* Success. */
next prev parent reply other threads:[~2015-03-07 17:13 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-24 5:19 Mike Frysinger
2015-02-24 14:50 ` John David Anglin
2015-02-24 16:20 ` Joseph Myers
2015-02-27 5:06 ` Carlos O'Donell
2015-02-27 6:53 ` Mike Frysinger
2015-03-01 19:55 ` John David Anglin
2015-03-01 22:24 ` Joseph Myers
2015-03-02 13:18 ` John David Anglin
2015-03-02 14:09 ` Joseph Myers
2015-03-11 7:33 ` Mike Frysinger
2015-03-08 19:52 ` Carlos O'Donell
2015-03-08 21:30 ` John David Anglin
2015-03-09 12:36 ` Carlos O'Donell
2015-03-07 17:13 ` John David Anglin [this message]
2015-03-08 19:53 ` Carlos O'Donell
2015-03-11 6:29 ` Carlos O'Donell
2015-02-27 6:46 ` Mike Frysinger
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=BLU437-SMTP89A288FA36C212A076A4A1971D0@phx.gbl \
--to=dave.anglin@bell.net \
--cc=carlos@systemhalted.org \
--cc=libc-alpha@sourceware.org \
--cc=vapier@gentoo.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).