1 /*******************************************************************************
4 * Functions copysign and __signbitd. *
5 * For PowerPC based machines. *
7 * Copyright © 1991, 2001 Apple Computer, Inc. All rights reserved. *
9 * Written by Ali Sazegari, started on June 1991. *
11 * August 26 1991: no CFront Version 1.1d17 warnings. *
12 * September 06 1991: passes the test suite with invalid raised on *
13 * signaling nans. sane rom code behaves the same. *
14 * September 24 1992: took the Ò#include support.hÓ out. *
15 * Dcember 02 1992: PowerPC port. *
16 * July 20 1994: __fabs added *
17 * July 21 1994: deleted unnecessary functions: neg, COPYSIGNnew, *
19 * April 11 2001: first port to os x using gcc. *
20 * removed fabs and deffered to gcc for direct *
21 * instruction generation. *
23 *******************************************************************************/
26 #include "../fp_private.h"
28 /*******************************************************************************
30 * Function copysign. *
31 * Implementation of copysign for the PowerPC. *
33 ********************************************************************************
34 * Note: The order of the operands in this function is reversed from that *
35 * suggested in the IEEE standard 754. *
36 *******************************************************************************/
38 libm_hidden_proto(copysign)
39 double copysign ( double arg2, double arg1 )
47 /*******************************************************************************
48 * No need to flush NaNs out. *
49 *******************************************************************************/
54 y.hex.high = y.hex.high & 0x7FFFFFFF;
55 y.hex.high = ( y.hex.high | ( x.hex.high & dSgnMask ) );
59 libm_hidden_def(copysign)