Provide copysignf and copysignl

This commit is contained in:
martin 2014-03-15 12:20:09 +00:00
parent b836c6ccfa
commit 89434fa764
1 changed files with 11 additions and 1 deletions

View File

@ -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);
*/