Deleted Added
full compact
math_private.h (255361) math_private.h (275819)
1/*
2 * ====================================================
3 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
4 *
5 * Developed at SunPro, a Sun Microsystems, Inc. business.
6 * Permission to use, copy, modify, and distribute this
7 * software is freely granted, provided that this notice
8 * is preserved.
9 * ====================================================
10 */
11
12/*
13 * from: @(#)fdlibm.h 5.1 93/09/24
1/*
2 * ====================================================
3 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
4 *
5 * Developed at SunPro, a Sun Microsystems, Inc. business.
6 * Permission to use, copy, modify, and distribute this
7 * software is freely granted, provided that this notice
8 * is preserved.
9 * ====================================================
10 */
11
12/*
13 * from: @(#)fdlibm.h 5.1 93/09/24
14 * $FreeBSD: head/lib/msun/src/math_private.h 255361 2013-09-07 14:04:10Z andrew $
14 * $FreeBSD: head/lib/msun/src/math_private.h 275819 2014-12-16 09:21:56Z ed $
15 */
16
17#ifndef _MATH_PRIVATE_H_
18#define _MATH_PRIVATE_H_
19
20#include <sys/types.h>
21#include <machine/endian.h>
22

--- 426 unchanged lines hidden (view full) ---

449 * Inline functions that can be used to construct complex values.
450 *
451 * The C99 standard intends x+I*y to be used for this, but x+I*y is
452 * currently unusable in general since gcc introduces many overflow,
453 * underflow, sign and efficiency bugs by rewriting I*y as
454 * (0.0+I)*(y+0.0*I) and laboriously computing the full complex product.
455 * In particular, I*Inf is corrupted to NaN+I*Inf, and I*-0 is corrupted
456 * to -0.0+I*0.0.
15 */
16
17#ifndef _MATH_PRIVATE_H_
18#define _MATH_PRIVATE_H_
19
20#include <sys/types.h>
21#include <machine/endian.h>
22

--- 426 unchanged lines hidden (view full) ---

449 * Inline functions that can be used to construct complex values.
450 *
451 * The C99 standard intends x+I*y to be used for this, but x+I*y is
452 * currently unusable in general since gcc introduces many overflow,
453 * underflow, sign and efficiency bugs by rewriting I*y as
454 * (0.0+I)*(y+0.0*I) and laboriously computing the full complex product.
455 * In particular, I*Inf is corrupted to NaN+I*Inf, and I*-0 is corrupted
456 * to -0.0+I*0.0.
457 *
458 * The C11 standard introduced the macros CMPLX(), CMPLXF() and CMPLXL()
459 * to construct complex values. The functions below are modelled after
460 * these macros, with the exception that they cannot be used to
461 * construct compile-time complex values.
457 */
462 */
463
464#ifndef CMPLXF
458static __inline float complex
465static __inline float complex
459cpackf(float x, float y)
466CMPLXF(float x, float y)
460{
461 float_complex z;
462
463 REALPART(z) = x;
464 IMAGPART(z) = y;
465 return (z.f);
466}
467{
468 float_complex z;
469
470 REALPART(z) = x;
471 IMAGPART(z) = y;
472 return (z.f);
473}
474#endif
467
475
476#ifndef CMPLX
468static __inline double complex
477static __inline double complex
469cpack(double x, double y)
478CMPLX(double x, double y)
470{
471 double_complex z;
472
473 REALPART(z) = x;
474 IMAGPART(z) = y;
475 return (z.f);
476}
479{
480 double_complex z;
481
482 REALPART(z) = x;
483 IMAGPART(z) = y;
484 return (z.f);
485}
486#endif
477
487
488#ifndef CMPLXL
478static __inline long double complex
489static __inline long double complex
479cpackl(long double x, long double y)
490CMPLXL(long double x, long double y)
480{
481 long_double_complex z;
482
483 REALPART(z) = x;
484 IMAGPART(z) = y;
485 return (z.f);
486}
491{
492 long_double_complex z;
493
494 REALPART(z) = x;
495 IMAGPART(z) = y;
496 return (z.f);
497}
498#endif
499
487#endif /* _COMPLEX_H */
488
489#ifdef __GNUCLIKE_ASM
490
491/* Asm versions of some functions. */
492
493#ifdef __amd64__
494static __inline int

--- 270 unchanged lines hidden ---
500#endif /* _COMPLEX_H */
501
502#ifdef __GNUCLIKE_ASM
503
504/* Asm versions of some functions. */
505
506#ifdef __amd64__
507static __inline int

--- 270 unchanged lines hidden ---