+2017-10-11 Joseph Myers <joseph@codesourcery.com>
+
+ * math/Makefile (test-types-basic): New variable.
+ (test-types): Likewise.
+ (libm-test-support): Use $(test-types) instead of $(types).
+ (libm-tests-base-normal): Likewise.
+ (libm-tests-base-finite): Likewise.
+ (libm-tests-base-inline): Likewise.
+ (generated): Likewise.
+ ($(objpfx)libm-test-support-$(t).c): Likewise.
+ (libm-tests-for-type iterator): Likewise.
+ (libm-test-support iterator): Likewise.
+ * math/libm-test-support.c (ulp_i_idx): Use ULP_I_IDX.
+ (ulp_idx): Use ULP_IDX.
+ * math/test-ldouble.h: Include <float.h>.
+ (TYPE_STR): Define conditional on [LDBL_MANT_DIG == DBL_MANT_DIG].
+ (ULP_IDX): New macro.
+ (ULP_I_IDX): Likewise.
+ * math/test-double.h (ULP_IDX): Likewise.
+ (ULP_I_IDX): Likewise.
+ * math/test-float.h (ULP_IDX): Likewise.
+ (ULP_I_IDX): Likewise.
+ * math/test-float128.h (ULP_IDX): Likewise.
+ (ULP_I_IDX): Likewise.
+
2017-10-11 Adhemerval Zanella <adhemerval.zanella@linaro.org>
* sysdeps/unix/sysv/linux/aarch64/sysdep-cancel.h: Remove file.
# after the Rules makefile has been parsed.
types-basic = $(type-ldouble-$(long-double-fcts)) double float
+# Like types, but includes types whose functions alias those for
+# another type.
+test-types-basic = ldouble double float
+
# long double support
type-ldouble-suffix := l
type-ldouble-routines := t_sincosl k_sincosl s_iscanonicall
type-float128-routines := t_sincosf128 k_sincosf128
type-float128-yes := float128
types = $(types-basic) $(type-float128-$(float128-fcts))
+test-types = $(test-types-basic) $(type-float128-$(float128-fcts))
# For each of the basic types (float, double, long double), replace the
# occurrences of 'F' in arg 1 with the appropriate suffix for the type.
ifneq (no,$(PERL))
libm-vec-tests = $(addprefix test-,$(libmvec-tests))
-libm-test-support = $(foreach t,$(types),libm-test-support-$(t))
+libm-test-support = $(foreach t,$(test-types),libm-test-support-$(t))
test-extras += $(libm-test-support)
extra-test-objs += $(addsuffix .o, $(libm-test-support))
libm-vec-test-wrappers = $(addsuffix -wrappers, $(libm-vec-tests))
libm-test-c-noauto = $(foreach f,$(libm-test-funcs-noauto),libm-test-$(f).c)
generated += libm-test-ulps.h $(libm-test-c-auto) $(libm-test-c-noauto)
-libm-tests-base-normal = $(foreach t,$(types),test-$(t))
-libm-tests-base-finite = $(foreach t,$(types),test-$(t)-finite)
-libm-tests-base-inline = $(foreach t,$(types),test-i$(t))
+libm-tests-base-normal = $(foreach t,$(test-types),test-$(t))
+libm-tests-base-finite = $(foreach t,$(test-types),test-$(t)-finite)
+libm-tests-base-inline = $(foreach t,$(test-types),test-i$(t))
libm-tests-base = $(libm-tests-base-normal) $(libm-tests-base-finite) \
$(libm-tests-base-inline) $(libm-vec-tests)
libm-tests-normal = $(foreach t,$(libm-tests-base-normal),\
tests += $(libm-tests)
generated += $(addsuffix .c,$(libm-tests)) \
- $(foreach t,$(types),libm-test-support-$(t).c)
+ $(foreach t,$(test-types),libm-test-support-$(t).c)
libm-test-c-auto-obj = $(addprefix $(objpfx),$(libm-test-c-auto))
libm-test-c-noauto-obj = $(addprefix $(objpfx),$(libm-test-c-noauto))
echo "#include <libm-test-$$func.c>"; \
) > $@
-$(foreach t,$(types),\
+$(foreach t,$(test-types),\
$(objpfx)libm-test-support-$(t).c): $(objpfx)libm-test-support-%.c:
( \
echo "#include <test-$*.h>"; \
$(addprefix $(objpfx),\
$(call libm-tests-for-type,$(o))): $(objpfx)libm-test-support-$(o).o
endef
-object-suffixes-left := $(types)
+object-suffixes-left := $(test-types)
include $(o-iterator)
define o-iterator-doit
$(objpfx)libm-test-support-$(o).o: CFLAGS += $(libm-test-no-inline-cflags)
endef
-object-suffixes-left := $(types)
+object-suffixes-left := $(test-types)
include $(o-iterator)
# Run the math programs to automatically generate ULPs files.
TYPE_STR: The name of the type as used in ulps files, as a string.
+ ULP_IDX, ULP_I_IDX: The array indexes for ulps values for this
+ function.
+
LIT: Append the correct suffix to a literal.
LITM: Append the correct suffix to an M_* macro name.
return strcmp (keystr, ulpdat->name);
}
-static const int ulp_i_idx = __CONCATX (ULP_I_, PREFIX);
-static const int ulp_idx = __CONCATX (ULP_, PREFIX);
+static const int ulp_i_idx = ULP_I_IDX;
+static const int ulp_idx = ULP_IDX;
/* Return the ulps for NAME in array DATA with NMEMB elements, or 0 if
no ulps listed. */
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <float.h>
+
#define FUNC(function) function##l
#define FLOAT long double
#define CFLOAT __complex__ long double
#define BUILD_COMPLEX(real, imag) (CMPLXL ((real), (imag)))
#define PREFIX LDBL
-#define TYPE_STR "ldouble"
+#if LDBL_MANT_DIG == DBL_MANT_DIG
+# define TYPE_STR "double"
+# define ULP_IDX ULP_DBL
+# define ULP_I_IDX ULP_I_DBL
+#else
+# define TYPE_STR "ldouble"
+# define ULP_IDX ULP_LDBL
+# define ULP_I_IDX ULP_I_LDBL
+#endif
#define LIT(x) (x ## L)
#define LITM(x) x ## l
#define FTOSTR strfroml