From f82996f8159981619ac7ed8a4c1838c2ad72ab61 Mon Sep 17 00:00:00 2001 From: Stefan Liebler Date: Wed, 11 Dec 2019 15:09:24 +0100 Subject: Use GCC builtins for round functions if desired. This patch is using the corresponding GCC builtin for roundf, round, roundl and roundf128 if the USE_FUNCTION_BUILTIN macros are defined to one in math-use-builtins.h. This is the case for s390 if build with at least --march=z196 --mzarch. Otherwise the generic implementation is used. The code of the generic implementation is not changed. Reviewed-by: Adhemerval Zanella --- sysdeps/ieee754/ldbl-128/s_roundl.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sysdeps/ieee754/ldbl-128') diff --git a/sysdeps/ieee754/ldbl-128/s_roundl.c b/sysdeps/ieee754/ldbl-128/s_roundl.c index d41c9a04dc..8c7ae82217 100644 --- a/sysdeps/ieee754/ldbl-128/s_roundl.c +++ b/sysdeps/ieee754/ldbl-128/s_roundl.c @@ -23,11 +23,16 @@ #include #include +#include _Float128 __roundl (_Float128 x) { +#if USE_ROUNDL_BUILTIN + return __builtin_roundl (x); +#else + /* Use generic implementation. */ int32_t j0; uint64_t i1, i0; @@ -78,5 +83,6 @@ __roundl (_Float128 x) SET_LDOUBLE_WORDS64 (x, i0, i1); return x; +#endif /* ! USE_ROUNDL_BUILTIN */ } libm_alias_ldouble (__round, round) -- cgit 1.4.1