Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libm/arch/hppa Update {read, write}fpsr to work everywhere



details:   https://anonhg.NetBSD.org/src/rev/ec0ff21d6ed0
branches:  trunk
changeset: 344290:ec0ff21d6ed0
user:      skrll <skrll%NetBSD.org@localhost>
date:      Sun Mar 20 14:22:46 2016 +0000

description:
Update {read,write}fpsr to work everywhere

diffstat:

 lib/libm/arch/hppa/fenv.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 1564cdc07ccc -r ec0ff21d6ed0 lib/libm/arch/hppa/fenv.c
--- a/lib/libm/arch/hppa/fenv.c Sun Mar 20 14:11:49 2016 +0000
+++ b/lib/libm/arch/hppa/fenv.c Sun Mar 20 14:22:46 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fenv.c,v 1.2 2015/01/13 11:16:06 martin Exp $  */
+/*     $NetBSD: fenv.c,v 1.3 2016/03/20 14:22:46 skrll Exp $   */
 
 /*-
  * Copyright (c) 2004-2005 David Schultz <das%FreeBSD.ORG@localhost>
@@ -24,7 +24,7 @@
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: fenv.c,v 1.2 2015/01/13 11:16:06 martin Exp $");
+__RCSID("$NetBSD: fenv.c,v 1.3 2016/03/20 14:22:46 skrll Exp $");
 
 #include <assert.h>
 #include <fenv.h>
@@ -47,7 +47,7 @@
 {
        uint32_t rv;
 
-       __asm__ __volatile__ ("fstws    %%fr0, %0" : "=m"(rv));
+       __asm__ __volatile__ ("fstw     %%fr0, 0(%1)" : "=m" (rv) : "r"(&rv));
        return rv;
 }
 
@@ -55,7 +55,7 @@
 static inline void
 writefpsr(uint32_t val)
 {
-       __asm__ __volatile__("fldws     %0,%%fr0" : : "m"(val));
+       __asm__ __volatile__("fldw      0(%1),%%fr0" : : "m" (val), "r"(&val));
 }
 
 /*



Home | Main Index | Thread Index | Old Index