Source-Changes-HG archive

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

[src/trunk]: src/lib/libm/arch/vax Provide copysignf and copysignl



details:   https://anonhg.NetBSD.org/src/rev/e0209cb4b7e3
branches:  trunk
changeset: 327724:e0209cb4b7e3
user:      martin <martin%NetBSD.org@localhost>
date:      Sat Mar 15 12:20:09 2014 +0000

description:
Provide copysignf and copysignl

diffstat:

 lib/libm/arch/vax/n_support.S |  12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diffs (33 lines):

diff -r b3b5a3eb2268 -r e0209cb4b7e3 lib/libm/arch/vax/n_support.S
--- a/lib/libm/arch/vax/n_support.S     Sat Mar 15 12:04:22 2014 +0000
+++ b/lib/libm/arch/vax/n_support.S     Sat Mar 15 12:20:09 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: n_support.S,v 1.7 2014/02/03 21:22:21 martin Exp $     */
+/*     $NetBSD: n_support.S,v 1.8 2014/03/15 12:20:09 martin Exp $     */
 /*
  * Copyright (c) 1985, 1993
  *     The Regents of the University of California.  All rights reserved.
@@ -32,6 +32,7 @@
 #include <machine/asm.h>
 
 WEAK_ALIAS(logbl,logb)
+WEAK_ALIAS(copysignl, copysign)
 
        .text
 _sccsid:
@@ -60,6 +61,15 @@
        bisw2   %r2,%r0                 # copy the sign bit of y to x
 Lz:    ret
 
+ENTRY(copysignf, 0)
+       movw    4(%ap),%r0              # load x into %r0
+       bicw3   $0x807f,%r0,%r2         # mask off the exponent of x
+       beql    1f                      # if zero or reserved op then return x
+       bicw3   $0x7fff,8(%ap),%r2      # copy the sign bit of y into %r2
+       bicw2   $0x8000,%r0             # replace x by |x|
+       bisw2   %r2,%r0                 # copy the sign bit of y to x
+1:     ret
+
 /*
  * float logbf(float x);
  */



Home | Main Index | Thread Index | Old Index