Module Name: src
Committed By: martin
Date: Sat Mar 15 12:20:09 UTC 2014
Modified Files:
src/lib/libm/arch/vax: n_support.S
Log Message:
Provide copysignf and copysignl
To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libm/arch/vax/n_support.S
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libm/arch/vax/n_support.S
diff -u src/lib/libm/arch/vax/n_support.S:1.7 src/lib/libm/arch/vax/n_support.S:1.8
--- src/lib/libm/arch/vax/n_support.S:1.7 Mon Feb 3 21:22:21 2014
+++ src/lib/libm/arch/vax/n_support.S Sat Mar 15 12:20:09 2014
@@ -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 @@ ENTRY(copysign, 0)
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);
*/