Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2015-02-06 19:14:04 +0300
committerNick Clifton <nickc@redhat.com>2015-02-06 19:14:04 +0300
commitb9e7cd9a846cf584049a719bbd0e4cabe3c50bea (patch)
tree33bb86b0a39693a67106d740062bc5975285b87f /newlib/libm/complex
parentdb004c5d7af31d9a56321d7780621b1df6a1559e (diff)
* libc/include/complex.h (cabsl): Add prototype.
(cimagl): Add prototype. (creall): Add prototype. * libc/include/ieeefp.h: Include float.h. (EXT_EXPBITS, EXT_FRACHBITS, EXT_FRACLBITS) (EXT_EXP_INFNAN. EXT_EXP_BIAS, EXT_FRACBITS): Define. (struct ieee_ext, union ieee_ext_u): New types for long double support. * libc/include/math.h (finitel): Add prototype. (hypotl): Add prototype. (sqrtl): Add prototype. * libm/common/Makefile.am (lsrc): Add sl_finite.c. * libm/common/Makefile.in: Regenerate. * libm/common/fdlibm.h (__ieee754_hypotl): Add prototype. * libm/common/hypotl.c (hypotl): Add implementation for when long double is larger than double. * libm/common/sqrtl.c (sqrtl): Likewise. * libm/common/sl_finite.c: New file. Adds implementation of the finitel function. * libm/complex/Makefile.am (lsrc): Define. (libcomplex_la_SOURCES): Add lsrc. (lib_a_SOURCES): Add lsrc. * libm/complex/Makefile.in: Regenerate. * libm/complex/cabs.c: Add documentation of cabsl function. * libm/complex/cimag.c: Add documentation of cimagl function. * libm/complex/creall.c: Add documentation of creall function. * libm/complex/cabsl.c: New file. Adds implementation of the cabsl function. * libm/complex/cimagl.c: New file. Adds implementation of the cimagl function. * libm/complex/creall.c: New file. Adds implementation of the creall function. * libm/math/Makefile.am (lsrc): Define. (libmath_la_SOURCES): Add lsrc. (lib_a_SOURCES): Add lsrc. * libm/math/Makefile.in: Regenerate. * libm/math/el_hypot.c: New file. Adds implementation of the __ieee754_hypotl function.
Diffstat (limited to 'newlib/libm/complex')
-rw-r--r--newlib/libm/complex/Makefile.am7
-rw-r--r--newlib/libm/complex/Makefile.in36
-rw-r--r--newlib/libm/complex/cabs.c16
-rw-r--r--newlib/libm/complex/cabsl.c18
-rw-r--r--newlib/libm/complex/cimag.c16
-rw-r--r--newlib/libm/complex/cimagl.c16
-rw-r--r--newlib/libm/complex/creal.c18
-rw-r--r--newlib/libm/complex/creall.c16
8 files changed, 120 insertions, 23 deletions
diff --git a/newlib/libm/complex/Makefile.am b/newlib/libm/complex/Makefile.am
index dbbe759be..1c4a50255 100644
--- a/newlib/libm/complex/Makefile.am
+++ b/newlib/libm/complex/Makefile.am
@@ -9,7 +9,8 @@ src = cabs.c cacos.c cacosh.c carg.c casin.c casinh.c \
cexp.c cimag.c clog.c conj.c \
cpow.c cproj.c creal.c \
csin.c csinh.c csqrt.c ctan.c ctanh.c
-
+
+lsrc = cabsl.c creall.c cimagl.c
fsrc = cabsf.c casinf.c ccosf.c cimagf.c cprojf.c \
csqrtf.c cacosf.c casinhf.c ccoshf.c clogf.c \
@@ -21,11 +22,11 @@ libcomplex_la_LDFLAGS = -Xcompiler -nostdlib
if USE_LIBTOOL
noinst_LTLIBRARIES = libcomplex.la
-libcomplex_la_SOURCES = $(src) $(fsrc)
+libcomplex_la_SOURCES = $(src) $(fsrc) $(lsrc)
noinst_DATA = objectlist.awk.in
else
noinst_LIBRARIES = lib.a
-lib_a_SOURCES = $(src) $(fsrc)
+lib_a_SOURCES = $(src) $(fsrc) $(lsrc)
lib_a_CFLAGS = $(AM_CFLAGS)
noinst_DATA =
endif # USE_LIBTOOL
diff --git a/newlib/libm/complex/Makefile.in b/newlib/libm/complex/Makefile.in
index 8a0d4b468..cf731e72f 100644
--- a/newlib/libm/complex/Makefile.in
+++ b/newlib/libm/complex/Makefile.in
@@ -79,8 +79,11 @@ am__objects_2 = lib_a-cabsf.$(OBJEXT) lib_a-casinf.$(OBJEXT) \
lib_a-cargf.$(OBJEXT) lib_a-catanhf.$(OBJEXT) \
lib_a-cexpf.$(OBJEXT) lib_a-cpowf.$(OBJEXT) \
lib_a-csinhf.$(OBJEXT)
+am__objects_5 = lib_a-cabsl.$(OBJEXT) lib_a-creall.$(OBJEXT) \
+ lib_a-cimagl.$(OBJEXT)
@USE_LIBTOOL_FALSE@am_lib_a_OBJECTS = $(am__objects_1) \
-@USE_LIBTOOL_FALSE@ $(am__objects_2)
+@USE_LIBTOOL_FALSE@ $(am__objects_2) \
+@USE_LIBTOOL_FALSE@ $(am__objects_5)
lib_a_OBJECTS = $(am_lib_a_OBJECTS)
LTLIBRARIES = $(noinst_LTLIBRARIES)
libcomplex_la_LIBADD =
@@ -93,8 +96,10 @@ am__objects_4 = cabsf.lo casinf.lo ccosf.lo cimagf.lo cprojf.lo \
ctanf.lo cacoshf.lo catanf.lo cephes_subrf.lo conjf.lo \
csinf.lo ctanhf.lo cargf.lo catanhf.lo cexpf.lo cpowf.lo \
csinhf.lo
+am__objects_6 = cabsl.lo creall.lo ciamgl.lo
@USE_LIBTOOL_TRUE@am_libcomplex_la_OBJECTS = $(am__objects_3) \
-@USE_LIBTOOL_TRUE@ $(am__objects_4)
+@USE_LIBTOOL_TRUE@ $(am__objects_4) \
+@USE_LIBTOOL_TRUE@ $(am__objects_6)
libcomplex_la_OBJECTS = $(am_libcomplex_la_OBJECTS)
libcomplex_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
@@ -249,6 +254,8 @@ src = cabs.c cacos.c cacosh.c carg.c casin.c casinh.c \
cpow.c cproj.c creal.c \
csin.c csinh.c csqrt.c ctan.c ctanh.c
+lsrc = cabsl.c creall.c cimagl.c
+
fsrc = cabsf.c casinf.c ccosf.c cimagf.c cprojf.c \
csqrtf.c cacosf.c casinhf.c ccoshf.c clogf.c \
crealf.c ctanf.c cacoshf.c catanf.c \
@@ -257,11 +264,11 @@ fsrc = cabsf.c casinf.c ccosf.c cimagf.c cprojf.c \
libcomplex_la_LDFLAGS = -Xcompiler -nostdlib
@USE_LIBTOOL_TRUE@noinst_LTLIBRARIES = libcomplex.la
-@USE_LIBTOOL_TRUE@libcomplex_la_SOURCES = $(src) $(fsrc)
+@USE_LIBTOOL_TRUE@libcomplex_la_SOURCES = $(src) $(fsrc) $(lsrc)
@USE_LIBTOOL_FALSE@noinst_DATA =
@USE_LIBTOOL_TRUE@noinst_DATA = objectlist.awk.in
@USE_LIBTOOL_FALSE@noinst_LIBRARIES = lib.a
-@USE_LIBTOOL_FALSE@lib_a_SOURCES = $(src) $(fsrc)
+@USE_LIBTOOL_FALSE@lib_a_SOURCES = $(src) $(fsrc) $(lsrc)
@USE_LIBTOOL_FALSE@lib_a_CFLAGS = $(AM_CFLAGS)
chobj = cabs.def cacos.def cacosh.def carg.def \
casin.def casinh.def catan.def catanh.def \
@@ -617,6 +624,27 @@ lib_a-csinhf.o: csinhf.c
lib_a-csinhf.obj: csinhf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-csinhf.obj `if test -f 'csinhf.c'; then $(CYGPATH_W) 'csinhf.c'; else $(CYGPATH_W) '$(srcdir)/csinhf.c'; fi`
+lib_a-cabsl.o: cabsl.c
+ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-cabsl.o `test -f 'cabsl.c' || echo '$(srcdir)/'`cabsl.c
+
+lib_a-cabsl.obj: cabsl.c
+ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-cabsl.obj `if test -f 'cabsl.c'; then $(CYGPATH_W) 'cabsl.c'; else $(CYGPATH_W) '$(srcdir)/cabsl.c'; fi`
+
+lib_a-creall.o: creall.c
+ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-creall.o `test -f 'creall.c' || echo '$(srcdir)/'`creall.c
+
+lib_a-creall.obj: creall.c
+ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-creall.obj `if test -f 'creall.c'; then $(CYGPATH_W) 'creall.c'; else $(CYGPATH_W) '$(srcdir)/creall.c'; fi`
+
+lib_a-cimagl.o: cimagl.c
+ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-cimagl.o `test -f 'cimagl.c' || echo '$(srcdir)/'`cimagl.c
+
+lib_a-cimagl.obj: cimagl.c
+ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-cimagl.obj `if test -f 'cimagl.c'; then $(CYGPATH_W) 'cimagl.c'; else $(CYGPATH_W) '$(srcdir)/cimagl.c'; fi`
+
+
+
+
mostlyclean-libtool:
-rm -f *.lo
diff --git a/newlib/libm/complex/cabs.c b/newlib/libm/complex/cabs.c
index 2750fab9a..69091d71a 100644
--- a/newlib/libm/complex/cabs.c
+++ b/newlib/libm/complex/cabs.c
@@ -10,17 +10,20 @@
/*
FUNCTION
- <<cabs>>, <<cabsf>>---complex absolute-value
+ <<cabs>>, <<cabsf>>, <<cabsl>>---complex absolute-value
INDEX
cabs
INDEX
cabsf
+INDEX
+ cabsl
ANSI_SYNOPSIS
#include <complex.h>
double cabs(double complex <[z]>);
float cabsf(float complex <[z]>);
+ long double cabsl(long double complex <[z]>);
DESCRIPTION
@@ -28,16 +31,19 @@ DESCRIPTION
(also called norm, modulus, or magnitude) of <[z]>.
<<cabsf>> is identical to <<cabs>>, except that it performs
- its calculations on <<floats complex>>.
+ its calculations on <<float complex>>.
+
+ <<cabsl>> is identical to <<cabs>>, except that it performs
+ its calculations on <<long double complex>>.
RETURNS
- The cabs functions return the complex absolute value.
+ The cabs* functions return the complex absolute value.
PORTABILITY
- <<cabs>> and <<cabsf>> are ISO C99
+ <<cabs>>, <<cabsf>> and <<cabsl>> are ISO C99
QUICKREF
- <<cabs>> and <<cabsf>> are ISO C99
+ <<cabs>>, <<cabsf>> and <<cabsl>> are ISO C99
*/
diff --git a/newlib/libm/complex/cabsl.c b/newlib/libm/complex/cabsl.c
new file mode 100644
index 000000000..091f2cd53
--- /dev/null
+++ b/newlib/libm/complex/cabsl.c
@@ -0,0 +1,18 @@
+/* Copyright (C) 2015 by Red Hat, Incorporated. All rights reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * is freely granted, provided that this notice is preserved.
+ */
+
+#include <complex.h>
+#include <math.h>
+
+long double
+cabsl (long double complex z)
+{
+#ifdef _LDBL_EQ_DBL
+ return cabs (z);
+#else
+ return hypotl (creall (z), cimagl (z));
+#endif
+}
diff --git a/newlib/libm/complex/cimag.c b/newlib/libm/complex/cimag.c
index 1d2d77414..959dbc9a4 100644
--- a/newlib/libm/complex/cimag.c
+++ b/newlib/libm/complex/cimag.c
@@ -10,33 +10,39 @@
/*
FUNCTION
- <<cimag>>, <<cimagf>>---imaginary part
+ <<cimag>>, <<cimagf>>, <<cimagl>>---imaginary part
INDEX
cimag
INDEX
cimagf
+INDEX
+ cimagl
ANSI_SYNOPSIS
#include <complex.h>
double cimag(double complex <[z]>);
float cimagf(float complex <[z]>);
+ long double cimagl(long double complex <[z]>);
DESCRIPTION
These functions compute the imaginary part of <[z]>.
<<cimagf>> is identical to <<cimag>>, except that it performs
- its calculations on <<floats complex>>.
+ its calculations on <<float complex>>.
+
+ <<cimagl>> is identical to <<cimag>>, except that it performs
+ its calculations on <<long double complex>>.
RETURNS
- The cimag functions return the imaginary part value (as a real).
+ The cimag* functions return the imaginary part value (as a real).
PORTABILITY
- <<cimag>> and <<cimagf>> are ISO C99
+ <<cimag>>, <<cimagf>> and <<cimagl>> are ISO C99
QUICKREF
- <<cimag>> and <<cimagf>> are ISO C99
+ <<cimag>>, <<cimagf>> and <<cimagl>> are ISO C99
*/
diff --git a/newlib/libm/complex/cimagl.c b/newlib/libm/complex/cimagl.c
new file mode 100644
index 000000000..a5afdc456
--- /dev/null
+++ b/newlib/libm/complex/cimagl.c
@@ -0,0 +1,16 @@
+/* Copyright (C) 2015 by Red Hat, Incorporated. All rights reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * is freely granted, provided that this notice is preserved.
+ */
+
+#include <complex.h>
+#include "../common/fdlibm.h"
+
+long double
+cimagl (long double complex z)
+{
+ long_double_complex w = { .z = z };
+
+ return IMAG_PART (w);
+}
diff --git a/newlib/libm/complex/creal.c b/newlib/libm/complex/creal.c
index c621561ae..1652a5f8e 100644
--- a/newlib/libm/complex/creal.c
+++ b/newlib/libm/complex/creal.c
@@ -10,33 +10,39 @@
/*
FUNCTION
- <<creal>>, <<crealf>>---real part
+ <<creal>>, <<crealf>>, <<creall>>---real part
INDEX
creal
INDEX
crealf
+INDEX
+ creall
ANSI_SYNOPSIS
#include <complex.h>
double creal(double complex <[z]>);
float crealf(float complex <[z]>);
+ double long creall(long double complex <[z]>);
-
+
DESCRIPTION
These functions compute the real part of <[z]>.
<<crealf>> is identical to <<creal>>, except that it performs
- its calculations on <<floats complex>>.
+ its calculations on <<float complex>>.
+
+ <<creall>> is identical to <<creal>>, except that it performs
+ its calculations on <<long double complex>>.
RETURNS
- The creal functions return the real part value.
+ The creal* functions return the real part value.
PORTABILITY
- <<creal>> and <<crealf>> are ISO C99
+ <<creal>>, <<crealf>> and <<creall>> are ISO C99
QUICKREF
- <<creal>> and <<crealf>> are ISO C99
+ <<creal>>, <<crealf>> and <<creall>> are ISO C99
*/
diff --git a/newlib/libm/complex/creall.c b/newlib/libm/complex/creall.c
new file mode 100644
index 000000000..7aa88c272
--- /dev/null
+++ b/newlib/libm/complex/creall.c
@@ -0,0 +1,16 @@
+/* Copyright (C) 2015 by Red Hat, Incorporated. All rights reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * is freely granted, provided that this notice is preserved.
+ */
+
+#include <complex.h>
+#include "../common/fdlibm.h"
+
+long double
+creall (long double complex z)
+{
+ long_double_complex w = { .z = z };
+
+ return (REAL_PART(w));
+}