From patchwork Tue Mar 17 19:01:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 38569 Return-Path: X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) by sourceware.org (Postfix) with ESMTPS id AE199393741D for ; Tue, 17 Mar 2020 19:01:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org AE199393741D Received: by mail-qk1-x730.google.com with SMTP id j2so21575326qkl.7 for ; Tue, 17 Mar 2020 12:01:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=zy8cBAEi2UvBpDTn1nGa0gSPlelnwupe+Y/fd7RqB0A=; b=k/qp3qB8CFaKFHPOoE3BTZ1y8neGx8ffu+OqLwgRBTKeEVPMEiCcw7Phium9zUqmWH OLgOLpa828RfmnLcicckoJ8U8Pbl+zCW1lSN5ndwzylfEHe4Gz/fJuw8sTzKnePV1nQm Zmy9IW85cHs8NZwpDAVf70dXJQLrWGXlhVfJ5vbgBVC3shJCiFwwtH7no6dQHUocEyhg 0qswyrRNaWSAuhpuqZVDAqcbwlKxEZ0xoPdpjIoCgPkAxlwvTuvPB6lBalEwxNOjgpn1 vdO3Qv35jEG+Clf92glK1nHDuz0BiObfwA7scEA1RgDaMUcEpmUv8ogDzSgx9Hqracem nzeA== X-Gm-Message-State: ANhLgQ1iRTMCqo4a5lWEzQndxZeuDgxYqwJs7SpGD6NkYjBMpC/ck2F9 rOnvvJYqTiy97IRcEJNP3+71lSRlVG4= X-Google-Smtp-Source: ADFU+vu8kvcaDK+R5xedb80CPaPAW888N4+y7rygVMx4MZbjSZvrRIR0365SCUvRwo9hbTHp75kIhA== X-Received: by 2002:a37:4cd1:: with SMTP id z200mr304465qka.324.1584471698657; Tue, 17 Mar 2020 12:01:38 -0700 (PDT) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id 68sm2481486qkh.75.2020.03.17.12.01.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Mar 2020 12:01:38 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 1/4] m68k: Remove mathinline.h Date: Tue, 17 Mar 2020 16:01:30 -0300 Message-Id: <20200317190133.29644-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.17.1 X-Spam-Status: No, score=-25.2 required=5.0 tests=DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Mar 2020 19:01:44 -0000 This is similar to x86 (da75c1b180f9355a) and powerpc (32ea72999693b98e) mathinline.h removal. The requires macros to build the fpu routines are moved to mathimpl.h, while the inline optimization macros for atan, tanh, rint, log1p, significand, trunc, floor, ceil, isinf, finite, scalbn, isnan, scalbln, nearbyint, lrint, and sincos are removed. The gcc bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94204 was created to track builtin support. Checked with a build against m68k-linux-gnu, resulting binaries are similar with and without the patch. --- sysdeps/m68k/m680x0/fpu/bits/mathinline.h | 378 ------------------ sysdeps/m68k/m680x0/fpu/mathimpl.h | 224 +++++++++++ sysdeps/m68k/m680x0/fpu/s_atan_template.c | 1 + sysdeps/m68k/m680x0/fpu/s_ceil_template.c | 1 + sysdeps/m68k/m680x0/fpu/s_fabs_template.c | 1 + sysdeps/m68k/m680x0/fpu/s_floor_template.c | 1 + sysdeps/m68k/m680x0/fpu/s_isinf.c | 1 + sysdeps/m68k/m680x0/fpu/s_log1p.c | 1 + sysdeps/m68k/m680x0/fpu/s_lrint_template.c | 1 + .../m68k/m680x0/fpu/s_nearbyint_template.c | 1 + sysdeps/m68k/m680x0/fpu/s_rint_template.c | 1 + sysdeps/m68k/m680x0/fpu/s_scalbn.c | 2 + sysdeps/m68k/m680x0/fpu/s_sincos_template.c | 1 + sysdeps/m68k/m680x0/fpu/s_tanh_template.c | 1 + sysdeps/m68k/m680x0/fpu/s_trunc_template.c | 1 + 15 files changed, 238 insertions(+), 378 deletions(-) delete mode 100644 sysdeps/m68k/m680x0/fpu/bits/mathinline.h diff --git a/sysdeps/m68k/m680x0/fpu/bits/mathinline.h b/sysdeps/m68k/m680x0/fpu/bits/mathinline.h deleted file mode 100644 index 2b71679ca4..0000000000 --- a/sysdeps/m68k/m680x0/fpu/bits/mathinline.h +++ /dev/null @@ -1,378 +0,0 @@ -/* Definitions of inline math functions implemented by the m68881/2. - Copyright (C) 1991-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -#ifndef _MATH_H -# error "Never use directly; include instead." -#endif - -#ifndef __extern_inline -# define __MATH_INLINE __inline -#else -# define __MATH_INLINE __extern_inline -#endif - -#ifdef __GNUC__ - -#if (!defined __NO_MATH_INLINES && defined __OPTIMIZE__) \ - || defined __LIBC_INTERNAL_MATH_INLINES - -#ifdef __LIBC_INTERNAL_MATH_INLINES -/* This is used when defining the functions themselves. Define them with - __ names, and with `static inline' instead of `extern inline' so the - bodies will always be used, never an external function call. - Note: GCC 6 objects to __attribute__ ((__leaf__)) on static functions. */ -# define __m81_u(x) __CONCAT(__,x) -# define __m81_inline static __inline -# define __m81_nth(fn) __NTHNL (fn) -#else -# define __m81_u(x) x -# define __m81_inline __MATH_INLINE -# define __m81_nth(fn) __NTH (fn) -# define __M81_MATH_INLINES 1 -#endif - -/* Define a math function. */ -#define __m81_defun(rettype, func, args, attrs) \ - __m81_inline rettype attrs \ - __m81_nth (__m81_u(func) args) - -/* Define the three variants of a math function that has a direct - implementation in the m68k fpu. FUNC is the name for C (which will be - suffixed with f and l for the float and long double version, resp). OP - is the name of the fpu operation (without leading f). */ - -#ifdef __USE_ISOC99 -# define __inline_mathop(func, op, attrs) \ - __inline_mathop1(double, func, op, attrs) \ - __inline_mathop1(float, __CONCAT(func,f), op, attrs) \ - __inline_mathop1(long double, __CONCAT(func,l), op, attrs) -#else -# define __inline_mathop(func, op, attrs) \ - __inline_mathop1(double, func, op, attrs) -#endif - -#define __inline_mathop1(float_type,func, op, attrs) \ - __m81_defun (float_type, func, (float_type __mathop_x), attrs) \ - { \ - float_type __result; \ - __asm __volatile__ ("f" __STRING(op) "%.x %1, %0" \ - : "=f" (__result) : "f" (__mathop_x)); \ - return __result; \ - } - -__inline_mathop(__atan, atan,) -__inline_mathop(__cos, cos,) -__inline_mathop(__sin, sin,) -__inline_mathop(__tan, tan,) -__inline_mathop(__tanh, tanh,) -__inline_mathop(__fabs, abs, __attribute__ ((__const__))) - -#if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 -__inline_mathop(__rint, int,) -__inline_mathop(__expm1, etoxm1,) -__inline_mathop(__log1p, lognp1,) -#endif - -#ifdef __USE_MISC -__inline_mathop(__significand, getman,) -#endif - -#ifdef __USE_ISOC99 -__inline_mathop(__trunc, intrz, __attribute__ ((__const__))) -#endif - -#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__ - -__inline_mathop(atan, atan,) -__inline_mathop(tanh, tanh,) - -# if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 -__inline_mathop(rint, int,) -__inline_mathop(log1p, lognp1,) -# endif - -# ifdef __USE_MISC -__inline_mathop(significand, getman,) -# endif - -# ifdef __USE_ISOC99 -__inline_mathop(trunc, intrz, __attribute__ ((__const__))) -# endif - -#endif /* !__NO_MATH_INLINES && __OPTIMIZE__ */ - -/* This macro contains the definition for the rest of the inline - functions, using FLOAT_TYPE as the domain type and M as a macro - that adds the suffix for the function names. */ - -#define __inline_functions(float_type, m) \ -__m81_defun (float_type, m(__floor), (float_type __x), \ - __attribute__ ((__const__))) \ -{ \ - float_type __result; \ - unsigned long int __ctrl_reg; \ - __asm __volatile__ ("fmove%.l %!, %0" : "=dm" (__ctrl_reg)); \ - /* Set rounding towards negative infinity. */ \ - __asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \ - : "dmi" ((__ctrl_reg & ~0x10) | 0x20)); \ - /* Convert X to an integer, using -Inf rounding. */ \ - __asm __volatile__ ("fint%.x %1, %0" : "=f" (__result) : "f" (__x)); \ - /* Restore the previous rounding mode. */ \ - __asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \ - : "dmi" (__ctrl_reg)); \ - return __result; \ -} \ - \ -__m81_defun (float_type, m(__ceil), (float_type __x), \ - __attribute__ ((__const__))) \ -{ \ - float_type __result; \ - unsigned long int __ctrl_reg; \ - __asm __volatile__ ("fmove%.l %!, %0" : "=dm" (__ctrl_reg)); \ - /* Set rounding towards positive infinity. */ \ - __asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \ - : "dmi" (__ctrl_reg | 0x30)); \ - /* Convert X to an integer, using +Inf rounding. */ \ - __asm __volatile__ ("fint%.x %1, %0" : "=f" (__result) : "f" (__x)); \ - /* Restore the previous rounding mode. */ \ - __asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \ - : "dmi" (__ctrl_reg)); \ - return __result; \ -} - -#define __CONCAT_d(arg) arg -#define __CONCAT_f(arg) arg ## f -#define __CONCAT_l(arg) arg ## l -__inline_functions(double, __CONCAT_d) -#ifdef __USE_ISOC99 -__inline_functions(float, __CONCAT_f) -__inline_functions(long double, __CONCAT_l) -#endif -#undef __inline_functions - -#ifdef __USE_MISC - -# define __inline_functions(float_type, m) \ -__m81_defun (int, m(__isinf), (float_type __value), \ - __attribute__ ((__const__))) \ -{ \ - /* There is no branch-condition for infinity, \ - so we must extract and examine the condition codes manually. */ \ - unsigned long int __fpsr; \ - __asm ("ftst%.x %1\n" \ - "fmove%.l %/fpsr, %0" : "=dm" (__fpsr) : "f" (__value)); \ - return (__fpsr & (2 << 24)) ? (__fpsr & (8 << 24) ? -1 : 1) : 0; \ -} \ - \ -__m81_defun (int, m(__finite), (float_type __value), \ - __attribute__ ((__const__))) \ -{ \ - /* There is no branch-condition for infinity, so we must extract and \ - examine the condition codes manually. */ \ - unsigned long int __fpsr; \ - __asm ("ftst%.x %1\n" \ - "fmove%.l %/fpsr, %0" : "=dm" (__fpsr) : "f" (__value)); \ - return (__fpsr & (3 << 24)) == 0; \ -} \ - \ -__m81_defun (float_type, m(__scalbn), \ - (float_type __x, int __n),) \ -{ \ - float_type __result; \ - __asm __volatile__ ("fscale%.l %1, %0" : "=f" (__result) \ - : "dmi" (__n), "0" (__x)); \ - return __result; \ -} - -__inline_functions(double, __CONCAT_d) -__inline_functions(float, __CONCAT_f) -__inline_functions(long double, __CONCAT_l) -# undef __inline_functions - -#endif /* Use misc. */ - -#if defined __USE_MISC || defined __USE_XOPEN - -# define __inline_functions(float_type, m) \ -__m81_defun (int, m(__isnan), (float_type __value), \ - __attribute__ ((__const__))) \ -{ \ - char __result; \ - __asm ("ftst%.x %1\n" \ - "fsun %0" : "=dm" (__result) : "f" (__value)); \ - return __result; \ -} - -__inline_functions(double, __CONCAT_d) -# ifdef __USE_MISC -__inline_functions(float, __CONCAT_f) -__inline_functions(long double, __CONCAT_l) -# endif -# undef __inline_functions - -#endif - -#ifdef __USE_ISOC99 - -# define __inline_functions(float_type, m) \ -__m81_defun (float_type, m(__scalbln), \ - (float_type __x, long int __n),) \ -{ \ - return m(__scalbn) (__x, __n); \ -} \ - \ -__m81_defun (float_type, m(__nearbyint), (float_type __x),) \ -{ \ - float_type __result; \ - unsigned long int __ctrl_reg; \ - __asm __volatile__ ("fmove%.l %!, %0" : "=dm" (__ctrl_reg)); \ - /* Temporarily disable the inexact exception. */ \ - __asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \ - : "dmi" (__ctrl_reg & ~0x200)); \ - __asm __volatile__ ("fint%.x %1, %0" : "=f" (__result) : "f" (__x)); \ - __asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \ - : "dmi" (__ctrl_reg)); \ - return __result; \ -} \ - \ -__m81_defun (long int, m(__lrint), (float_type __x),) \ -{ \ - long int __result; \ - __asm __volatile__ ("fmove%.l %1, %0" : "=dm" (__result) : "f" (__x)); \ - return __result; \ -} - -__inline_functions (double, __CONCAT_d) -__inline_functions (float, __CONCAT_f) -__inline_functions (long double, __CONCAT_l) -# undef __inline_functions - -#endif /* Use ISO C9x */ - -#ifdef __USE_GNU - -# define __inline_functions(float_type, m) \ -__m81_inline void \ -__m81_nth (__m81_u(m(__sincos)) \ - (float_type __x, float_type *__sinx, float_type *__cosx)) \ -{ \ - __asm __volatile__ ("fsincos%.x %2,%1:%0" \ - : "=f" (*__sinx), "=f" (*__cosx) : "f" (__x)); \ -} - -__inline_functions (double, __CONCAT_d) -__inline_functions (float, __CONCAT_f) -__inline_functions (long double, __CONCAT_l) -# undef __inline_functions - -#endif - -#undef __CONCAT_d -#undef __CONCAT_f -#undef __CONCAT_l - -#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__ - -/* Define inline versions of the user visible functions. */ - -# define __inline_forward_c(rettype, name, args1, args2) \ -__MATH_INLINE rettype __attribute__((__const__)) \ -__NTH (name args1) \ -{ \ - return __CONCAT(__,name) args2; \ -} - -# define __inline_forward(rettype, name, args1, args2) \ -__MATH_INLINE rettype __NTH (name args1) \ -{ \ - return __CONCAT(__,name) args2; \ -} - -__inline_forward_c(double,floor, (double __x), (__x)) -__inline_forward_c(double,ceil, (double __x), (__x)) -# ifdef __USE_MISC -# ifndef __USE_ISOC99 /* Conflict with macro of same name. */ -__inline_forward_c(int,isinf, (double __value), (__value)) -# endif -__inline_forward_c(int,finite, (double __value), (__value)) -__inline_forward(double,scalbn, (double __x, int __n), (__x, __n)) -# endif -# if defined __USE_MISC || defined __USE_XOPEN -# ifndef __USE_ISOC99 /* Conflict with macro of same name. */ -__inline_forward_c(int,isnan, (double __value), (__value)) -# endif -# endif -# ifdef __USE_ISOC99 -__inline_forward(double,scalbln, (double __x, long int __n), (__x, __n)) -__inline_forward(double,nearbyint, (double __value), (__value)) -__inline_forward(long int,lrint, (double __value), (__value)) -# endif -# ifdef __USE_GNU -__inline_forward(void,sincos, (double __x, double *__sinx, double *__cosx), - (__x, __sinx, __cosx)) -# endif - -# ifdef __USE_ISOC99 - -__inline_forward_c(float,floorf, (float __x), (__x)) -__inline_forward_c(float,ceilf, (float __x), (__x)) -# ifdef __USE_MISC -__inline_forward_c(int,isinff, (float __value), (__value)) -__inline_forward_c(int,finitef, (float __value), (__value)) -__inline_forward(float,scalbnf, (float __x, int __n), (__x, __n)) -__inline_forward_c(int,isnanf, (float __value), (__value)) -# endif -# ifdef __USE_ISOC99 -__inline_forward(float,scalblnf, (float __x, long int __n), (__x, __n)) -__inline_forward(float,nearbyintf, (float __value), (__value)) -__inline_forward(long int,lrintf, (float __value), (__value)) -# endif -# ifdef __USE_GNU -__inline_forward(void,sincosf, (float __x, float *__sinx, float *__cosx), - (__x, __sinx, __cosx)) -# endif - -__inline_forward_c(long double,floorl, (long double __x), (__x)) -__inline_forward_c(long double,ceill, (long double __x), (__x)) -# ifdef __USE_MISC -__inline_forward_c(int,isinfl, (long double __value), (__value)) -__inline_forward_c(int,finitel, (long double __value), (__value)) -__inline_forward(long double,scalbnl, (long double __x, int __n), (__x, __n)) -__inline_forward_c(int,isnanl, (long double __value), (__value)) -# endif -# ifdef __USE_ISOC99 -__inline_forward(long double,scalblnl, (long double __x, long int __n), - (__x, __n)) -__inline_forward(long double,nearbyintl, (long double __value), (__value)) -__inline_forward(long int,lrintl, (long double __value), (__value)) -# endif -# ifdef __USE_GNU -__inline_forward(void,sincosl, - (long double __x, long double *__sinx, long double *__cosx), - (__x, __sinx, __cosx)) -# endif - -#endif /* Use misc or ISO C99 */ - -#undef __inline_forward -#undef __inline_forward_c - -#endif /* !__NO_MATH_INLINES && __OPTIMIZE__ */ - -#endif -#endif /* GCC. */ diff --git a/sysdeps/m68k/m680x0/fpu/mathimpl.h b/sysdeps/m68k/m680x0/fpu/mathimpl.h index 245fe7b2e3..b4df24043c 100644 --- a/sysdeps/m68k/m680x0/fpu/mathimpl.h +++ b/sysdeps/m68k/m680x0/fpu/mathimpl.h @@ -17,9 +17,231 @@ License along with the GNU C Library. If not, see . */ +#ifndef _MATHIMPL_H +#define _MATHIMPL_H + /* This file contains the definitions of the inline math functions that are only used internally inside libm, not visible to the user. */ +#define __MATH_INLINE __extern_inline + +/* This is used when defining the functions themselves. Define them with + __ names, and with `static inline' instead of `extern inline' so the + bodies will always be used, never an external function call. + Note: GCC 6 objects to __attribute__ ((__leaf__)) on static functions. */ +#define __m81_u(x) __CONCAT(__,x) +#define __m81_inline static __inline +#define __m81_nth(fn) __NTH (fn) + +/* Define a math function. */ +#define __m81_defun(rettype, func, args, attrs) \ + __m81_inline rettype attrs \ + __m81_nth (__m81_u(func) args) + +/* Define the three variants of a math function that has a direct + implementation in the m68k fpu. FUNC is the name for C (which will be + suffixed with f and l for the float and long double version, resp). OP + is the name of the fpu operation (without leading f). */ + +# define __inline_mathop(func, op, attrs) \ + __inline_mathop1(double, func, op, attrs) \ + __inline_mathop1(float, __CONCAT(func,f), op, attrs) \ + __inline_mathop1(long double, __CONCAT(func,l), op, attrs) + +#define __inline_mathop1(float_type,func, op, attrs) \ + __m81_defun (float_type, func, (float_type __mathop_x), attrs) \ + { \ + float_type __result; \ + __asm __volatile__ ("f" __STRING(op) "%.x %1, %0" \ + : "=f" (__result) : "f" (__mathop_x)); \ + return __result; \ + } + +__inline_mathop(__atan, atan,) +__inline_mathop(__cos, cos,) +__inline_mathop(__sin, sin,) +__inline_mathop(__tan, tan,) +__inline_mathop(__tanh, tanh,) +__inline_mathop(__fabs, abs, __attribute__ ((__const__))) + +__inline_mathop(__rint, int,) +__inline_mathop(__expm1, etoxm1,) +__inline_mathop(__log1p, lognp1,) + +__inline_mathop(__significand, getman,) + +__inline_mathop(__trunc, intrz, __attribute__ ((__const__))) + + +/* This macro contains the definition for the rest of the inline + functions, using FLOAT_TYPE as the domain type and M as a macro + that adds the suffix for the function names. */ + +#define __inline_functions(float_type, m) \ +__m81_defun (float_type, m(__floor), (float_type __x), \ + __attribute__ ((__const__))) \ +{ \ + float_type __result; \ + unsigned long int __ctrl_reg; \ + __asm __volatile__ ("fmove%.l %!, %0" : "=dm" (__ctrl_reg)); \ + /* Set rounding towards negative infinity. */ \ + __asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \ + : "dmi" ((__ctrl_reg & ~0x10) | 0x20)); \ + /* Convert X to an integer, using -Inf rounding. */ \ + __asm __volatile__ ("fint%.x %1, %0" : "=f" (__result) : "f" (__x)); \ + /* Restore the previous rounding mode. */ \ + __asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \ + : "dmi" (__ctrl_reg)); \ + return __result; \ +} \ + \ +__m81_defun (float_type, m(__ceil), (float_type __x), \ + __attribute__ ((__const__))) \ +{ \ + float_type __result; \ + unsigned long int __ctrl_reg; \ + __asm __volatile__ ("fmove%.l %!, %0" : "=dm" (__ctrl_reg)); \ + /* Set rounding towards positive infinity. */ \ + __asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \ + : "dmi" (__ctrl_reg | 0x30)); \ + /* Convert X to an integer, using +Inf rounding. */ \ + __asm __volatile__ ("fint%.x %1, %0" : "=f" (__result) : "f" (__x)); \ + /* Restore the previous rounding mode. */ \ + __asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \ + : "dmi" (__ctrl_reg)); \ + return __result; \ +} + +#define __CONCAT_d(arg) arg +#define __CONCAT_f(arg) arg ## f +#define __CONCAT_l(arg) arg ## l +__inline_functions(double, __CONCAT_d) +__inline_functions(float, __CONCAT_f) +__inline_functions(long double, __CONCAT_l) +#undef __inline_functions + +# define __inline_functions(float_type, m) \ +__m81_defun (int, m(__isinf), (float_type __value), \ + __attribute__ ((__const__))) \ +{ \ + /* There is no branch-condition for infinity, \ + so we must extract and examine the condition codes manually. */ \ + unsigned long int __fpsr; \ + __asm ("ftst%.x %1\n" \ + "fmove%.l %/fpsr, %0" : "=dm" (__fpsr) : "f" (__value)); \ + return (__fpsr & (2 << 24)) ? (__fpsr & (8 << 24) ? -1 : 1) : 0; \ +} \ + \ +__m81_defun (int, m(__finite), (float_type __value), \ + __attribute__ ((__const__))) \ +{ \ + /* There is no branch-condition for infinity, so we must extract and \ + examine the condition codes manually. */ \ + unsigned long int __fpsr; \ + __asm ("ftst%.x %1\n" \ + "fmove%.l %/fpsr, %0" : "=dm" (__fpsr) : "f" (__value)); \ + return (__fpsr & (3 << 24)) == 0; \ +} \ + \ +__m81_defun (float_type, m(__scalbn), \ + (float_type __x, int __n),) \ +{ \ + float_type __result; \ + __asm __volatile__ ("fscale%.l %1, %0" : "=f" (__result) \ + : "dmi" (__n), "0" (__x)); \ + return __result; \ +} + +__inline_functions(double, __CONCAT_d) +__inline_functions(float, __CONCAT_f) +__inline_functions(long double, __CONCAT_l) +#undef __inline_functions + +# define __inline_functions(float_type, m) \ +__m81_defun (int, m(__isnan), (float_type __value), \ + __attribute__ ((__const__))) \ +{ \ + char __result; \ + __asm ("ftst%.x %1\n" \ + "fsun %0" : "=dm" (__result) : "f" (__value)); \ + return __result; \ +} + +__inline_functions(double, __CONCAT_d) +__inline_functions(float, __CONCAT_f) +__inline_functions(long double, __CONCAT_l) +#undef __inline_functions + +# define __inline_functions(float_type, m) \ +__m81_defun (float_type, m(__scalbln), \ + (float_type __x, long int __n),) \ +{ \ + return m(__scalbn) (__x, __n); \ +} \ + \ +__m81_defun (float_type, m(__nearbyint), (float_type __x),) \ +{ \ + float_type __result; \ + unsigned long int __ctrl_reg; \ + __asm __volatile__ ("fmove%.l %!, %0" : "=dm" (__ctrl_reg)); \ + /* Temporarily disable the inexact exception. */ \ + __asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \ + : "dmi" (__ctrl_reg & ~0x200)); \ + __asm __volatile__ ("fint%.x %1, %0" : "=f" (__result) : "f" (__x)); \ + __asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \ + : "dmi" (__ctrl_reg)); \ + return __result; \ +} \ + \ +__m81_defun (long int, m(__lrint), (float_type __x),) \ +{ \ + long int __result; \ + __asm __volatile__ ("fmove%.l %1, %0" : "=dm" (__result) : "f" (__x)); \ + return __result; \ +} + +__inline_functions (double, __CONCAT_d) +__inline_functions (float, __CONCAT_f) +__inline_functions (long double, __CONCAT_l) +#undef __inline_functions + +#define __inline_functions(float_type, m) \ +__m81_inline void \ +__m81_nth (__m81_u(m(__sincos)) \ + (float_type __x, float_type *__sinx, float_type *__cosx)) \ +{ \ + __asm __volatile__ ("fsincos%.x %2,%1:%0" \ + : "=f" (*__sinx), "=f" (*__cosx) : "f" (__x)); \ +} + +__inline_functions (double, __CONCAT_d) +__inline_functions (float, __CONCAT_f) +__inline_functions (long double, __CONCAT_l) +#undef __inline_functions + +#undef __CONCAT_d +#undef __CONCAT_f +#undef __CONCAT_l + +/* Define the three variants of a math function that has a direct + implementation in the m68k fpu. FUNC is the name for C (which will be + suffixed with f and l for the float and long double version, resp). OP + is the name of the fpu operation (without leading f). */ + +#define __inline_mathop(func, op, attrs) \ + __inline_mathop1(double, func, op, attrs) \ + __inline_mathop1(float, __CONCAT(func,f), op, attrs) \ + __inline_mathop1(long double, __CONCAT(func,l), op, attrs) + +#define __inline_mathop1(float_type,func, op, attrs) \ + __m81_defun (float_type, func, (float_type __mathop_x), attrs) \ + { \ + float_type __result; \ + __asm __volatile__ ("f" __STRING(op) "%.x %1, %0" \ + : "=f" (__result) : "f" (__mathop_x)); \ + return __result; \ + } + __inline_mathop (__ieee754_acos, acos,) __inline_mathop (__ieee754_asin, asin,) __inline_mathop (__ieee754_cosh, cosh,) @@ -91,3 +313,5 @@ __m81_test (long double __val) #define __M81_COND_INF (2 << 24) #define __M81_COND_ZERO (4 << 24) #define __M81_COND_NEG (8 << 24) + +#endif /* _MATHIMPL_H */ diff --git a/sysdeps/m68k/m680x0/fpu/s_atan_template.c b/sysdeps/m68k/m680x0/fpu/s_atan_template.c index de1f121583..445ad02806 100644 --- a/sysdeps/m68k/m680x0/fpu/s_atan_template.c +++ b/sysdeps/m68k/m680x0/fpu/s_atan_template.c @@ -17,6 +17,7 @@ . */ #include +#include "mathimpl.h" FLOAT M_DECL_FUNC (__atan) (FLOAT x) diff --git a/sysdeps/m68k/m680x0/fpu/s_ceil_template.c b/sysdeps/m68k/m680x0/fpu/s_ceil_template.c index 077353ccbe..9f27550c35 100644 --- a/sysdeps/m68k/m680x0/fpu/s_ceil_template.c +++ b/sysdeps/m68k/m680x0/fpu/s_ceil_template.c @@ -18,6 +18,7 @@ #define NO_MATH_REDIRECT #include +#include "mathimpl.h" FLOAT M_DECL_FUNC (__ceil) (FLOAT x) diff --git a/sysdeps/m68k/m680x0/fpu/s_fabs_template.c b/sysdeps/m68k/m680x0/fpu/s_fabs_template.c index d8a5f8be84..398fc89e63 100644 --- a/sysdeps/m68k/m680x0/fpu/s_fabs_template.c +++ b/sysdeps/m68k/m680x0/fpu/s_fabs_template.c @@ -17,6 +17,7 @@ . */ #include +#include "mathimpl.h" FLOAT M_DECL_FUNC (__fabs) (FLOAT x) diff --git a/sysdeps/m68k/m680x0/fpu/s_floor_template.c b/sysdeps/m68k/m680x0/fpu/s_floor_template.c index bd4526a4fd..2026c3f5a6 100644 --- a/sysdeps/m68k/m680x0/fpu/s_floor_template.c +++ b/sysdeps/m68k/m680x0/fpu/s_floor_template.c @@ -18,6 +18,7 @@ #define NO_MATH_REDIRECT #include +#include "mathimpl.h" FLOAT M_DECL_FUNC (__floor) (FLOAT x) diff --git a/sysdeps/m68k/m680x0/fpu/s_isinf.c b/sysdeps/m68k/m680x0/fpu/s_isinf.c index 68c767196f..d350e38beb 100644 --- a/sysdeps/m68k/m680x0/fpu/s_isinf.c +++ b/sysdeps/m68k/m680x0/fpu/s_isinf.c @@ -16,6 +16,7 @@ . */ #include +#include "mathimpl.h" #ifndef FUNC #define FUNC isinf diff --git a/sysdeps/m68k/m680x0/fpu/s_log1p.c b/sysdeps/m68k/m680x0/fpu/s_log1p.c index 52c7cb5987..f115223295 100644 --- a/sysdeps/m68k/m680x0/fpu/s_log1p.c +++ b/sysdeps/m68k/m680x0/fpu/s_log1p.c @@ -17,6 +17,7 @@ . */ #include +#include "mathimpl.h" #ifndef FUNC #define FUNC log1p diff --git a/sysdeps/m68k/m680x0/fpu/s_lrint_template.c b/sysdeps/m68k/m680x0/fpu/s_lrint_template.c index 8eb4b65699..1eeec41802 100644 --- a/sysdeps/m68k/m680x0/fpu/s_lrint_template.c +++ b/sysdeps/m68k/m680x0/fpu/s_lrint_template.c @@ -19,6 +19,7 @@ . */ #include +#include "mathimpl.h" long int M_DECL_FUNC (__lrint) (FLOAT x) diff --git a/sysdeps/m68k/m680x0/fpu/s_nearbyint_template.c b/sysdeps/m68k/m680x0/fpu/s_nearbyint_template.c index 735f4b808c..1dd4dcb201 100644 --- a/sysdeps/m68k/m680x0/fpu/s_nearbyint_template.c +++ b/sysdeps/m68k/m680x0/fpu/s_nearbyint_template.c @@ -17,6 +17,7 @@ . */ #include +#include "mathimpl.h" FLOAT M_DECL_FUNC (__nearbyint) (FLOAT x) diff --git a/sysdeps/m68k/m680x0/fpu/s_rint_template.c b/sysdeps/m68k/m680x0/fpu/s_rint_template.c index a5fff65f8d..eb38400118 100644 --- a/sysdeps/m68k/m680x0/fpu/s_rint_template.c +++ b/sysdeps/m68k/m680x0/fpu/s_rint_template.c @@ -17,6 +17,7 @@ . */ #include +#include "mathimpl.h" FLOAT M_DECL_FUNC (__rint) (FLOAT x) diff --git a/sysdeps/m68k/m680x0/fpu/s_scalbn.c b/sysdeps/m68k/m680x0/fpu/s_scalbn.c index 6475092d7f..e3c69ebc12 100644 --- a/sysdeps/m68k/m680x0/fpu/s_scalbn.c +++ b/sysdeps/m68k/m680x0/fpu/s_scalbn.c @@ -15,6 +15,7 @@ License along with the GNU C Library. If not, see . */ +#define NO_MATH_REDIRECT #define scalbln __no_scalbln_decl #define scalblnf __no_scalblnf_decl #define scalblnl __no_scalblnl_decl @@ -28,6 +29,7 @@ #undef __scalbln #undef __scalblnf #undef __scalblnl +#include "mathimpl.h" #ifndef suffix #define suffix /*empty*/ diff --git a/sysdeps/m68k/m680x0/fpu/s_sincos_template.c b/sysdeps/m68k/m680x0/fpu/s_sincos_template.c index f529cf5c10..ffae28d7d0 100644 --- a/sysdeps/m68k/m680x0/fpu/s_sincos_template.c +++ b/sysdeps/m68k/m680x0/fpu/s_sincos_template.c @@ -17,6 +17,7 @@ . */ #include +#include "mathimpl.h" void M_DECL_FUNC (__sincos) (FLOAT x, FLOAT *sinx, FLOAT *cosx) diff --git a/sysdeps/m68k/m680x0/fpu/s_tanh_template.c b/sysdeps/m68k/m680x0/fpu/s_tanh_template.c index ab20976997..0e93371ec5 100644 --- a/sysdeps/m68k/m680x0/fpu/s_tanh_template.c +++ b/sysdeps/m68k/m680x0/fpu/s_tanh_template.c @@ -17,6 +17,7 @@ . */ #include +#include "mathimpl.h" FLOAT M_DECL_FUNC (__tanh) (FLOAT x) diff --git a/sysdeps/m68k/m680x0/fpu/s_trunc_template.c b/sysdeps/m68k/m680x0/fpu/s_trunc_template.c index e8cb9fa1ec..1483abfbd0 100644 --- a/sysdeps/m68k/m680x0/fpu/s_trunc_template.c +++ b/sysdeps/m68k/m680x0/fpu/s_trunc_template.c @@ -18,6 +18,7 @@ #define NO_MATH_REDIRECT #include +#include "mathimpl.h" FLOAT M_DECL_FUNC (__trunc) (FLOAT x) From patchwork Tue Mar 17 19:01:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 38568 Return-Path: X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x72c.google.com (mail-qk1-x72c.google.com [IPv6:2607:f8b0:4864:20::72c]) by sourceware.org (Postfix) with ESMTPS id 7D9A8393741C for ; Tue, 17 Mar 2020 19:01:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7D9A8393741C Received: by mail-qk1-x72c.google.com with SMTP id q17so9789093qki.0 for ; Tue, 17 Mar 2020 12:01:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=uwQLkoV3RjsisSoys41+XeEQtVmpJE4/GEimyKisXJk=; b=JE9AMFaCBslf0XxzgsbvP1TTn0IqZuXPf1jhDZuLCb2+vFWEOfLLLjGRyem1Q0DHcW slIsnoPtXIP2dRRKyPdYSQKnEMH92WqbRS0S6Y3G3aJ7Lu74236oQqpXhpxWej/vqzug C6RqTcT3ea+gDVK1l4UHbBjJCXXifniDOm9/RJ9fioYUXY4qb0pJzXm/tLHafJwttZ2M Cc4SnbadrgG9s11AzIGKZeRShfZODy/z2LAdh973USbBS/o8EgPYAtLOyesd3F/zIqYA 7WJJvAFambDRoppY/LCxVrczgEI/mShROBan9fSyVln3ARWRpekAHoWgAr2zuln/CWnx YLVw== X-Gm-Message-State: ANhLgQ0rA74N05Wu+InQh2CeikSLNrhwiQQGUGnrwPBqGavcRpS7ARjW H3rw8kTRvM6TvkZBFitmUmpUKyEt5E8= X-Google-Smtp-Source: ADFU+vv6LdbbPqxiby/qQeYbOigcpfpCENFnZhgK2ZZ03u045bf8PUFXDjBPR6FzoWU93zJ8uvMZww== X-Received: by 2002:ae9:ef81:: with SMTP id d123mr317880qkg.472.1584471700587; Tue, 17 Mar 2020 12:01:40 -0700 (PDT) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id 68sm2481486qkh.75.2020.03.17.12.01.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Mar 2020 12:01:40 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 2/4] math: Remove mathinline Date: Tue, 17 Mar 2020 16:01:31 -0300 Message-Id: <20200317190133.29644-2-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200317190133.29644-1-adhemerval.zanella@linaro.org> References: <20200317190133.29644-1-adhemerval.zanella@linaro.org> X-Spam-Status: No, score=-25.2 required=5.0 tests=DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Mar 2020 19:01:42 -0000 With m68k bits moved to internal headers, no architectures export additional optimizations on mathinline. --- bits/mathinline.h | 12 ------------ math/Makefile | 2 +- math/math.h | 6 ------ 3 files changed, 1 insertion(+), 19 deletions(-) delete mode 100644 bits/mathinline.h diff --git a/bits/mathinline.h b/bits/mathinline.h deleted file mode 100644 index 02ec21b438..0000000000 --- a/bits/mathinline.h +++ /dev/null @@ -1,12 +0,0 @@ -/* This file should provide inline versions of math functions. - - Surround GCC-specific parts with #ifdef __GNUC__, and use `__extern_inline'. - - This file should define __MATH_INLINES if functions are actually defined as - inlines. */ - -#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__ - -/* Here goes the real code. */ - -#endif diff --git a/math/Makefile b/math/Makefile index 84a8b94c74..2a5f8bf353 100644 --- a/math/Makefile +++ b/math/Makefile @@ -22,7 +22,7 @@ subdir := math include ../Makeconfig # Installed header files. -headers := math.h bits/mathcalls.h bits/mathinline.h \ +headers := math.h bits/mathcalls.h \ fpu_control.h complex.h bits/cmathcalls.h fenv.h \ bits/fenv.h bits/fenvinline.h bits/mathdef.h tgmath.h \ bits/math-vector.h finclude/math-vector-fortran.h \ diff --git a/math/math.h b/math/math.h index 1692ff4a45..5c3dcb9194 100644 --- a/math/math.h +++ b/math/math.h @@ -1301,12 +1301,6 @@ iszero (__T __val) # endif #endif -/* Get machine-dependent inline versions (if there are any). */ -#ifdef __USE_EXTERN_INLINES -# include -#endif - - #if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) /* An expression whose type has the widest of the evaluation formats of X and Y (which are of floating-point types). */ From patchwork Tue Mar 17 19:01:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 38570 Return-Path: X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) by sourceware.org (Postfix) with ESMTPS id 91CD4393741E for ; Tue, 17 Mar 2020 19:01:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 91CD4393741E Received: by mail-qt1-x844.google.com with SMTP id n5so18481804qtv.7 for ; Tue, 17 Mar 2020 12:01:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=cWdoJeyt+1Tl9w1Q0PCWiilzljaUzOjjXKh5UBz3VN8=; b=fu4va3N6IydwAeBo21tRidgB0dZ3Mmv2nQipMq9MYqwDTrWRfSjDUIF8TGJ/N4614B L0qBe0fJ5mv09FhtikpO3GjUa/02m9Yj1SI9xBF2jBBEh2FOqj1HzUXCT0127MyPbMQ7 crXa9gRyLt+23+2BX4639fYXIfSKcaZBNWocpFH0extvohC06fqognFtRBdm5tCRke2R g4uaY/buwWFQ1lfe7Cdlf4fUCeNRc5yXI0JhGc/huJ5qGP1PNbh9rRuZX6CM/HzHIlGH t3+PjABHS/KX6MbmhGZnfpAVjMN/eg/7ilpdjqghyeDuUL5KzUeD/wLZM6hkPlIOmQRW Mtiw== X-Gm-Message-State: ANhLgQ0Vb2/Kvcjamnz4oUMlYXOc1Q7s/YAOo6P9Z43vRM+/Y++XOodB RIbgYWhEo1QfTHjVt3uwEF7Jjzn8kFI= X-Google-Smtp-Source: ADFU+vvtzGSYcHkjey/Saooxd5/CpMgcWyxUOV/sPpy1Rnq52gP/RSZO8dXBDyig4t1K4yV5SvvcDA== X-Received: by 2002:ac8:fe9:: with SMTP id f38mr676166qtk.130.1584471702881; Tue, 17 Mar 2020 12:01:42 -0700 (PDT) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id 68sm2481486qkh.75.2020.03.17.12.01.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Mar 2020 12:01:42 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 3/4] Remove __LIBC_INTERNAL_MATH_INLINES Date: Tue, 17 Mar 2020 16:01:32 -0300 Message-Id: <20200317190133.29644-3-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200317190133.29644-1-adhemerval.zanella@linaro.org> References: <20200317190133.29644-1-adhemerval.zanella@linaro.org> X-Spam-Status: No, score=-25.2 required=5.0 tests=DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Mar 2020 19:01:44 -0000 With m68k mathinline.h removal the flag is not used anymore. Checked with a m68k-linux-gnu build/check. --- math/Makefile | 2 +- math/test-math-inline.h | 1 - math/test-signgam-main.c | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/math/Makefile b/math/Makefile index 2a5f8bf353..cf92aa772d 100644 --- a/math/Makefile +++ b/math/Makefile @@ -643,7 +643,7 @@ include $(o-iterator) # We don't want the fdlibm code to use the inline math functions, # only the fdlibm code. -math-CPPFLAGS += -D__NO_MATH_INLINES -D__LIBC_INTERNAL_MATH_INLINES +math-CPPFLAGS += -D__NO_MATH_INLINES ifneq ($(long-double-fcts),yes) # The `double' and `long double' types are the same on this machine. diff --git a/math/test-math-inline.h b/math/test-math-inline.h index 755be44f35..c522236e3e 100644 --- a/math/test-math-inline.h +++ b/math/test-math-inline.h @@ -20,7 +20,6 @@ #define TEST_ERRNO 0 #define TEST_EXCEPTIONS 0 -#undef __LIBC_INTERNAL_MATH_INLINES #ifdef __NO_MATH_INLINES # undef __NO_MATH_INLINES #endif diff --git a/math/test-signgam-main.c b/math/test-signgam-main.c index b36e942c9b..19ca2bc7af 100644 --- a/math/test-signgam-main.c +++ b/math/test-signgam-main.c @@ -17,7 +17,6 @@ . */ #undef _LIBC -#undef __LIBC_INTERNAL_MATH_INLINES #undef _GNU_SOURCE #include From patchwork Tue Mar 17 19:01:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 38571 Return-Path: X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x830.google.com (mail-qt1-x830.google.com [IPv6:2607:f8b0:4864:20::830]) by sourceware.org (Postfix) with ESMTPS id EF9B23943543 for ; Tue, 17 Mar 2020 19:01:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org EF9B23943543 Received: by mail-qt1-x830.google.com with SMTP id l20so18472327qtp.4 for ; Tue, 17 Mar 2020 12:01:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=AazpSWriOy+Hqw09Ok9VXbshkxgF+y1VNyjDFlXB5QA=; b=CuuearVENMMRxjiCaDIXHr/0KT4rm4QkPNZH5ebrcLy2DzA5VNbW+2BpLdL3adSSlo fVfDD6BAiJgjVrir9fhbsJl3OCpqVwd5KCQ1InoHt2VbPUV1EoDgttAOWs6cdwrtRiDh 19R/1LiiE2czK3O8ayHk6e+Fm1uOsNgdiH2FS6SSbCMmBgPwWcVvBywgonMuxzETUSod xrYzM9CsGgDz+i69B3LAng+P/RiME9GrxdLFE0C6ld9EwVaSiendOGABuzm1vWDSei/2 1QkMIUlzcarJDyBFA/Ep/sLNMWavuymc/fd0tOcFdlMuEmGOLR4+sV48V6inQt3y41lY enyQ== X-Gm-Message-State: ANhLgQ3CxGmBqjnJcSPYNlWNRNRXBhKulco+7Hz6KX0moBV6wqcEnNpj DAdoWEbygKRSR3nsBqmRrQgz+3hzo8I= X-Google-Smtp-Source: ADFU+vv6G4hipIaveonKkY0qM/W2JrM/2QK50H5n8bEhJdqL/OALEA5WMEJKnSJwIkhfh4FgQn+y+Q== X-Received: by 2002:aed:3c10:: with SMTP id t16mr625486qte.45.1584471704544; Tue, 17 Mar 2020 12:01:44 -0700 (PDT) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id 68sm2481486qkh.75.2020.03.17.12.01.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Mar 2020 12:01:43 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 4/4] math: Remove inline math tests Date: Tue, 17 Mar 2020 16:01:33 -0300 Message-Id: <20200317190133.29644-4-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200317190133.29644-1-adhemerval.zanella@linaro.org> References: <20200317190133.29644-1-adhemerval.zanella@linaro.org> X-Spam-Status: No, score=-25.2 required=5.0 tests=DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Mar 2020 19:01:49 -0000 With mathinline removal there is no need to keep building and testing inline math tests. Checked on x86_64-linux-gnu and i686-linux-gnu. --- math/Makefile | 34 +---------- math/gen-libm-test.py | 2 - math/libm-test-asinh.inc | 4 +- math/libm-test-atanh.inc | 4 +- math/libm-test-cosh.inc | 4 +- math/libm-test-driver.c | 7 --- math/libm-test-exp.inc | 4 +- math/libm-test-expm1.inc | 4 +- math/libm-test-hypot.inc | 32 +++++----- math/libm-test-pow.inc | 118 ++++++++++++++++++------------------- math/libm-test-sinh.inc | 4 +- math/libm-test-support.c | 4 +- math/libm-test-support.h | 2 - math/libm-test-tanh.inc | 4 +- math/test-double-vlen2.h | 1 - math/test-double-vlen4.h | 1 - math/test-double-vlen8.h | 1 - math/test-float-vlen16.h | 1 - math/test-float-vlen4.h | 1 - math/test-float-vlen8.h | 1 - math/test-math-inline.h | 25 -------- math/test-math-no-inline.h | 23 -------- 22 files changed, 93 insertions(+), 188 deletions(-) delete mode 100644 math/test-math-inline.h delete mode 100644 math/test-math-no-inline.h diff --git a/math/Makefile b/math/Makefile index cf92aa772d..6156f6e7e1 100644 --- a/math/Makefile +++ b/math/Makefile @@ -303,26 +303,19 @@ generated += libm-test-ulps.h $(libm-test-c-auto) $(libm-test-c-noauto) \ $(libm-test-c-narrow) libm-tests-base-normal = $(foreach t,$(test-types),test-$(t)) -libm-tests-base-inline = $(foreach t,$(test-types),test-i$(t)) libm-tests-base-narrow = $(foreach t,$(test-type-pairs),test-$(t)) -libm-tests-base = $(libm-tests-base-normal) $(libm-tests-base-inline) \ - $(libm-vec-tests) +libm-tests-base = $(libm-tests-base-normal) $(libm-vec-tests) libm-tests-normal = $(foreach t,$(libm-tests-base-normal),\ $(foreach f,$(libm-test-funcs-all),\ $(t)-$(f))) -libm-tests-inline = $(foreach t,$(libm-tests-base-inline),\ - $(foreach f,$(libm-test-funcs-all),\ - $(t)-$(f))) libm-tests-narrow = $(foreach t,$(libm-tests-base-narrow),\ $(foreach f,$(libm-test-funcs-narrow),\ $(t)-$(f))) libm-tests-vector = $(foreach t,$(libmvec-tests),\ $(foreach f,$($(t)-funcs),test-$(t)-$(f))) -libm-tests = $(libm-tests-normal) $(libm-tests-inline) \ - $(libm-tests-narrow) $(libm-tests-vector) +libm-tests = $(libm-tests-normal) $(libm-tests-narrow) $(libm-tests-vector) libm-tests-compat = $(foreach t,$(libm-tests-base-normal) \ - $(libm-tests-base-finite) \ - $(libm-tests-base-inline),\ + $(libm-tests-base-finite),\ $(foreach f,$(libm-test-funcs-compat),\ $(t)-$(f))) libm-tests-for-type = $(foreach f,$(libm-test-funcs-all),\ @@ -417,7 +410,6 @@ CFLAGS-test-float-vlen16-wrappers.c += $(float-vlen16-arch-ext-cflags) # validated. libm-test-no-inline-cflags = -fno-inline -ffloat-store -fno-builtin \ -fsignaling-nans -libm-test-inline-cflags = $(libm-test-fast-math-cflags) CFLAGS-test-tgmath.c += -fno-builtin # The following testcase uses very long lines (>3 million), so it may take a # while to compile it. See: http://llvm.org/bugs/show_bug.cgi?id=14106 and @@ -493,23 +485,11 @@ $(foreach t,$(libm-tests-normal),$(objpfx)$(t).c): $(objpfx)test-%.c: ( \ echo "#include "; \ echo "#include "; \ - echo "#include "; \ echo "#include "; \ echo "#include "; \ echo "#include "; \ ) > $@ -$(foreach t,$(libm-tests-inline),$(objpfx)$(t).c): $(objpfx)test-i%.c: - type_func=$*; \ - type=$${type_func%%-*}; \ - func=$${type_func#*-}; \ - ( \ - echo "#include "; \ - echo "#include "; \ - echo "#include "; \ - echo "#include "; \ - ) > $@ - $(foreach t,$(libm-tests-narrow),$(objpfx)$(t).c): $(objpfx)test-%.c: type_pair_func=$*; \ type_pair=$${type_pair_func%-*}; \ @@ -520,7 +500,6 @@ $(foreach t,$(libm-tests-narrow),$(objpfx)$(t).c): $(objpfx)test-%.c: echo "#include "; \ echo "#include "; \ echo "#include "; \ - echo "#include "; \ echo "#include "; \ echo "#include "; \ echo "#include "; \ @@ -569,13 +548,6 @@ endef object-suffixes-left := $(libm-tests-base-normal) include $(o-iterator) -define o-iterator-doit -$(foreach f,$(libm-test-funcs-all),\ - $(objpfx)$(o)-$(f).o): CFLAGS += $(libm-test-inline-cflags) -endef -object-suffixes-left := $(libm-tests-base-inline) -include $(o-iterator) - define o-iterator-doit $(foreach f,$(libm-test-funcs-narrow),\ $(objpfx)$(o)-$(f).o): CFLAGS += $(libm-test-no-inline-cflags) diff --git a/math/gen-libm-test.py b/math/gen-libm-test.py index 0142c0f332..4750b06a27 100755 --- a/math/gen-libm-test.py +++ b/math/gen-libm-test.py @@ -94,7 +94,6 @@ BEAUTIFY_MAP = {'minus_zero': '-0', # Flags in auto-libm-test-out that map directly to C flags. FLAGS_SIMPLE = {'ignore-zero-inf-sign': 'IGNORE_ZERO_INF_SIGN', - 'no-test-inline': 'NO_TEST_INLINE', 'xfail': 'XFAIL_TEST'} # Exceptions in auto-libm-test-out, and their corresponding C flags @@ -558,7 +557,6 @@ def gen_test_line(descr_args, descr_res, args_str): or 'ERRNO' in res[-1] or 'IGNORE_ZERO_INF_SIGN' in res[-1] or 'TEST_NAN_SIGN' in res[-1] - or 'NO_TEST_INLINE' in res[-1] or 'XFAIL' in res[-1]): raise ValueError('wrong number of arguments: %s' % args_str) res_rm = [res, res, res, res] diff --git a/math/libm-test-asinh.inc b/math/libm-test-asinh.inc index 52240b2c8c..dca1fce754 100644 --- a/math/libm-test-asinh.inc +++ b/math/libm-test-asinh.inc @@ -20,8 +20,8 @@ static const struct test_f_f_data asinh_test_data[] = { - TEST_f_f (asinh, plus_infty, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_f_f (asinh, minus_infty, minus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE), + TEST_f_f (asinh, plus_infty, plus_infty, ERRNO_UNCHANGED), + TEST_f_f (asinh, minus_infty, minus_infty, ERRNO_UNCHANGED), TEST_f_f (asinh, qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), TEST_f_f (asinh, -qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), TEST_f_f (asinh, snan_value, qnan_value, INVALID_EXCEPTION), diff --git a/math/libm-test-atanh.inc b/math/libm-test-atanh.inc index 2ed521045b..af17474e56 100644 --- a/math/libm-test-atanh.inc +++ b/math/libm-test-atanh.inc @@ -30,8 +30,8 @@ static const struct test_f_f_data atanh_test_data[] = /* atanh (x) == qNaN plus invalid exception if |x| > 1. */ TEST_f_f (atanh, 1.125L, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM), TEST_f_f (atanh, -1.125L, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM), - TEST_f_f (atanh, max_value, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM|NO_TEST_INLINE), - TEST_f_f (atanh, -max_value, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM|NO_TEST_INLINE), + TEST_f_f (atanh, max_value, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM), + TEST_f_f (atanh, -max_value, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM), TEST_f_f (atanh, plus_infty, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM), TEST_f_f (atanh, minus_infty, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM), diff --git a/math/libm-test-cosh.inc b/math/libm-test-cosh.inc index 9a252d75a2..cffbbc4d55 100644 --- a/math/libm-test-cosh.inc +++ b/math/libm-test-cosh.inc @@ -20,8 +20,8 @@ static const struct test_f_f_data cosh_test_data[] = { - TEST_f_f (cosh, plus_infty, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_f_f (cosh, minus_infty, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE), + TEST_f_f (cosh, plus_infty, plus_infty, ERRNO_UNCHANGED), + TEST_f_f (cosh, minus_infty, plus_infty, ERRNO_UNCHANGED), TEST_f_f (cosh, qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), TEST_f_f (cosh, -qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), TEST_f_f (cosh, snan_value, qnan_value, INVALID_EXCEPTION), diff --git a/math/libm-test-driver.c b/math/libm-test-driver.c index f5b2c00b57..11b541b2e7 100644 --- a/math/libm-test-driver.c +++ b/math/libm-test-driver.c @@ -23,7 +23,6 @@ /* Flags set by the including file. */ const int flag_test_errno = TEST_ERRNO; const int flag_test_exceptions = TEST_EXCEPTIONS; -const int flag_test_inline = TEST_INLINE; const int flag_test_mathvec = TEST_MATHVEC; #if TEST_NARROW @@ -41,8 +40,6 @@ const int snan_tests_arg = SNAN_TESTS (FLOAT); /* Informal description of the functions being tested. */ #if TEST_MATHVEC # define TEST_MSG "testing " STR_FLOAT " (vector length " STR_VEC_LEN ")\n" -#elif TEST_INLINE -# define TEST_MSG "testing " STR_FLOAT " (inline functions)\n" #elif TEST_NARROW # define TEST_MSG "testing " STR_FLOAT " (argument " STR_ARG_FLOAT ")\n" #else @@ -70,11 +67,7 @@ const char test_msg[] = TEST_MSG; ? TEST_NAN_PAYLOAD \ : 0) -#if TEST_INLINE -const char qtype_str[] = "i" TYPE_STR; -#else const char qtype_str[] = TYPE_STR; -#endif /* Various constants derived from pi. We must supply them precalculated for accuracy. They are written as a series of postfix operations to keep diff --git a/math/libm-test-exp.inc b/math/libm-test-exp.inc index a5bcb75661..8ea415cfbb 100644 --- a/math/libm-test-exp.inc +++ b/math/libm-test-exp.inc @@ -20,8 +20,8 @@ static const struct test_f_f_data exp_test_data[] = { - TEST_f_f (exp, plus_infty, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_f_f (exp, minus_infty, 0, ERRNO_UNCHANGED|NO_TEST_INLINE), + TEST_f_f (exp, plus_infty, plus_infty, ERRNO_UNCHANGED), + TEST_f_f (exp, minus_infty, 0, ERRNO_UNCHANGED), TEST_f_f (exp, qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), TEST_f_f (exp, -qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), TEST_f_f (exp, snan_value, qnan_value, INVALID_EXCEPTION), diff --git a/math/libm-test-expm1.inc b/math/libm-test-expm1.inc index 31cc662d96..d208204112 100644 --- a/math/libm-test-expm1.inc +++ b/math/libm-test-expm1.inc @@ -20,8 +20,8 @@ static const struct test_f_f_data expm1_test_data[] = { - TEST_f_f (expm1, plus_infty, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_f_f (expm1, minus_infty, -1, ERRNO_UNCHANGED|NO_TEST_INLINE), + TEST_f_f (expm1, plus_infty, plus_infty, ERRNO_UNCHANGED), + TEST_f_f (expm1, minus_infty, -1, ERRNO_UNCHANGED), TEST_f_f (expm1, qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), TEST_f_f (expm1, -qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), TEST_f_f (expm1, snan_value, qnan_value, INVALID_EXCEPTION), diff --git a/math/libm-test-hypot.inc b/math/libm-test-hypot.inc index 34321907b3..3122377b25 100644 --- a/math/libm-test-hypot.inc +++ b/math/libm-test-hypot.inc @@ -65,22 +65,22 @@ static const struct test_ff_f_data hypot_test_data[] = TEST_ff_f (hypot, minus_infty, plus_infty, plus_infty, ERRNO_UNCHANGED), TEST_ff_f (hypot, minus_infty, minus_infty, plus_infty, ERRNO_UNCHANGED), - TEST_ff_f (hypot, plus_infty, qnan_value, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_ff_f (hypot, plus_infty, -qnan_value, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_ff_f (hypot, minus_infty, qnan_value, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_ff_f (hypot, minus_infty, -qnan_value, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_ff_f (hypot, qnan_value, plus_infty, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_ff_f (hypot, -qnan_value, plus_infty, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_ff_f (hypot, qnan_value, minus_infty, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_ff_f (hypot, -qnan_value, minus_infty, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_ff_f (hypot, plus_infty, snan_value, qnan_value, INVALID_EXCEPTION|NO_TEST_INLINE), - TEST_ff_f (hypot, plus_infty, -snan_value, qnan_value, INVALID_EXCEPTION|NO_TEST_INLINE), - TEST_ff_f (hypot, minus_infty, snan_value, qnan_value, INVALID_EXCEPTION|NO_TEST_INLINE), - TEST_ff_f (hypot, minus_infty, -snan_value, qnan_value, INVALID_EXCEPTION|NO_TEST_INLINE), - TEST_ff_f (hypot, snan_value, plus_infty, qnan_value, INVALID_EXCEPTION|NO_TEST_INLINE), - TEST_ff_f (hypot, -snan_value, plus_infty, qnan_value, INVALID_EXCEPTION|NO_TEST_INLINE), - TEST_ff_f (hypot, snan_value, minus_infty, qnan_value, INVALID_EXCEPTION|NO_TEST_INLINE), - TEST_ff_f (hypot, -snan_value, minus_infty, qnan_value, INVALID_EXCEPTION|NO_TEST_INLINE), + TEST_ff_f (hypot, plus_infty, qnan_value, plus_infty, ERRNO_UNCHANGED), + TEST_ff_f (hypot, plus_infty, -qnan_value, plus_infty, ERRNO_UNCHANGED), + TEST_ff_f (hypot, minus_infty, qnan_value, plus_infty, ERRNO_UNCHANGED), + TEST_ff_f (hypot, minus_infty, -qnan_value, plus_infty, ERRNO_UNCHANGED), + TEST_ff_f (hypot, qnan_value, plus_infty, plus_infty, ERRNO_UNCHANGED), + TEST_ff_f (hypot, -qnan_value, plus_infty, plus_infty, ERRNO_UNCHANGED), + TEST_ff_f (hypot, qnan_value, minus_infty, plus_infty, ERRNO_UNCHANGED), + TEST_ff_f (hypot, -qnan_value, minus_infty, plus_infty, ERRNO_UNCHANGED), + TEST_ff_f (hypot, plus_infty, snan_value, qnan_value, INVALID_EXCEPTION), + TEST_ff_f (hypot, plus_infty, -snan_value, qnan_value, INVALID_EXCEPTION), + TEST_ff_f (hypot, minus_infty, snan_value, qnan_value, INVALID_EXCEPTION), + TEST_ff_f (hypot, minus_infty, -snan_value, qnan_value, INVALID_EXCEPTION), + TEST_ff_f (hypot, snan_value, plus_infty, qnan_value, INVALID_EXCEPTION), + TEST_ff_f (hypot, -snan_value, plus_infty, qnan_value, INVALID_EXCEPTION), + TEST_ff_f (hypot, snan_value, minus_infty, qnan_value, INVALID_EXCEPTION), + TEST_ff_f (hypot, -snan_value, minus_infty, qnan_value, INVALID_EXCEPTION), TEST_ff_f (hypot, 0, qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), TEST_ff_f (hypot, 0, -qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), diff --git a/math/libm-test-pow.inc b/math/libm-test-pow.inc index f09c369918..d9e64b9b38 100644 --- a/math/libm-test-pow.inc +++ b/math/libm-test-pow.inc @@ -29,61 +29,61 @@ static const struct test_ff_f_data pow_test_data[] = TEST_ff_f (pow, snan_value, minus_zero, qnan_value, INVALID_EXCEPTION|NO_TEST_MATHVEC), TEST_ff_f (pow, -snan_value, minus_zero, qnan_value, INVALID_EXCEPTION|NO_TEST_MATHVEC), - TEST_ff_f (pow, 1.1L, plus_infty, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_ff_f (pow, plus_infty, plus_infty, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_ff_f (pow, -1.1L, plus_infty, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_ff_f (pow, minus_infty, plus_infty, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE), - - TEST_ff_f (pow, 0.9L, plus_infty, 0, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_ff_f (pow, 1e-7L, plus_infty, 0, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_ff_f (pow, -0.9L, plus_infty, 0, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_ff_f (pow, -1e-7L, plus_infty, 0, ERRNO_UNCHANGED|NO_TEST_INLINE), - - TEST_ff_f (pow, 1.1L, minus_infty, 0, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_ff_f (pow, plus_infty, minus_infty, 0, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_ff_f (pow, -1.1L, minus_infty, 0, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_ff_f (pow, minus_infty, minus_infty, 0, ERRNO_UNCHANGED|NO_TEST_INLINE), - - TEST_ff_f (pow, 0.9L, minus_infty, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_ff_f (pow, 1e-7L, minus_infty, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_ff_f (pow, -0.9L, minus_infty, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_ff_f (pow, -1e-7L, minus_infty, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE), - - TEST_ff_f (pow, plus_infty, 1e-7L, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_ff_f (pow, plus_infty, 1, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_ff_f (pow, plus_infty, 1e7L, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_ff_f (pow, plus_infty, min_subnorm_value, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE), - - TEST_ff_f (pow, plus_infty, -1e-7L, 0, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_ff_f (pow, plus_infty, -1, 0, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_ff_f (pow, plus_infty, -1e7L, 0, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_ff_f (pow, plus_infty, -min_subnorm_value, 0, ERRNO_UNCHANGED|NO_TEST_INLINE), - - TEST_ff_f (pow, minus_infty, 1, minus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_ff_f (pow, minus_infty, 11, minus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_ff_f (pow, minus_infty, 1001, minus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE), - - TEST_ff_f (pow, minus_infty, 2, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_ff_f (pow, minus_infty, 12, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_ff_f (pow, minus_infty, 1002, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_ff_f (pow, minus_infty, 0.1L, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_ff_f (pow, minus_infty, 1.1L, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_ff_f (pow, minus_infty, 11.1L, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_ff_f (pow, minus_infty, 1001.1L, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_ff_f (pow, minus_infty, min_subnorm_value, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE), - - TEST_ff_f (pow, minus_infty, -1, minus_zero, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_ff_f (pow, minus_infty, -11, minus_zero, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_ff_f (pow, minus_infty, -1001, minus_zero, ERRNO_UNCHANGED|NO_TEST_INLINE), - - TEST_ff_f (pow, minus_infty, -2, 0, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_ff_f (pow, minus_infty, -12, 0, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_ff_f (pow, minus_infty, -1002, 0, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_ff_f (pow, minus_infty, -0.1L, 0, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_ff_f (pow, minus_infty, -1.1L, 0, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_ff_f (pow, minus_infty, -11.1L, 0, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_ff_f (pow, minus_infty, -1001.1L, 0, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_ff_f (pow, minus_infty, -min_subnorm_value, 0, ERRNO_UNCHANGED|NO_TEST_INLINE), + TEST_ff_f (pow, 1.1L, plus_infty, plus_infty, ERRNO_UNCHANGED), + TEST_ff_f (pow, plus_infty, plus_infty, plus_infty, ERRNO_UNCHANGED), + TEST_ff_f (pow, -1.1L, plus_infty, plus_infty, ERRNO_UNCHANGED), + TEST_ff_f (pow, minus_infty, plus_infty, plus_infty, ERRNO_UNCHANGED), + + TEST_ff_f (pow, 0.9L, plus_infty, 0, ERRNO_UNCHANGED), + TEST_ff_f (pow, 1e-7L, plus_infty, 0, ERRNO_UNCHANGED), + TEST_ff_f (pow, -0.9L, plus_infty, 0, ERRNO_UNCHANGED), + TEST_ff_f (pow, -1e-7L, plus_infty, 0, ERRNO_UNCHANGED), + + TEST_ff_f (pow, 1.1L, minus_infty, 0, ERRNO_UNCHANGED), + TEST_ff_f (pow, plus_infty, minus_infty, 0, ERRNO_UNCHANGED), + TEST_ff_f (pow, -1.1L, minus_infty, 0, ERRNO_UNCHANGED), + TEST_ff_f (pow, minus_infty, minus_infty, 0, ERRNO_UNCHANGED), + + TEST_ff_f (pow, 0.9L, minus_infty, plus_infty, ERRNO_UNCHANGED), + TEST_ff_f (pow, 1e-7L, minus_infty, plus_infty, ERRNO_UNCHANGED), + TEST_ff_f (pow, -0.9L, minus_infty, plus_infty, ERRNO_UNCHANGED), + TEST_ff_f (pow, -1e-7L, minus_infty, plus_infty, ERRNO_UNCHANGED), + + TEST_ff_f (pow, plus_infty, 1e-7L, plus_infty, ERRNO_UNCHANGED), + TEST_ff_f (pow, plus_infty, 1, plus_infty, ERRNO_UNCHANGED), + TEST_ff_f (pow, plus_infty, 1e7L, plus_infty, ERRNO_UNCHANGED), + TEST_ff_f (pow, plus_infty, min_subnorm_value, plus_infty, ERRNO_UNCHANGED), + + TEST_ff_f (pow, plus_infty, -1e-7L, 0, ERRNO_UNCHANGED), + TEST_ff_f (pow, plus_infty, -1, 0, ERRNO_UNCHANGED), + TEST_ff_f (pow, plus_infty, -1e7L, 0, ERRNO_UNCHANGED), + TEST_ff_f (pow, plus_infty, -min_subnorm_value, 0, ERRNO_UNCHANGED), + + TEST_ff_f (pow, minus_infty, 1, minus_infty, ERRNO_UNCHANGED), + TEST_ff_f (pow, minus_infty, 11, minus_infty, ERRNO_UNCHANGED), + TEST_ff_f (pow, minus_infty, 1001, minus_infty, ERRNO_UNCHANGED), + + TEST_ff_f (pow, minus_infty, 2, plus_infty, ERRNO_UNCHANGED), + TEST_ff_f (pow, minus_infty, 12, plus_infty, ERRNO_UNCHANGED), + TEST_ff_f (pow, minus_infty, 1002, plus_infty, ERRNO_UNCHANGED), + TEST_ff_f (pow, minus_infty, 0.1L, plus_infty, ERRNO_UNCHANGED), + TEST_ff_f (pow, minus_infty, 1.1L, plus_infty, ERRNO_UNCHANGED), + TEST_ff_f (pow, minus_infty, 11.1L, plus_infty, ERRNO_UNCHANGED), + TEST_ff_f (pow, minus_infty, 1001.1L, plus_infty, ERRNO_UNCHANGED), + TEST_ff_f (pow, minus_infty, min_subnorm_value, plus_infty, ERRNO_UNCHANGED), + + TEST_ff_f (pow, minus_infty, -1, minus_zero, ERRNO_UNCHANGED), + TEST_ff_f (pow, minus_infty, -11, minus_zero, ERRNO_UNCHANGED), + TEST_ff_f (pow, minus_infty, -1001, minus_zero, ERRNO_UNCHANGED), + + TEST_ff_f (pow, minus_infty, -2, 0, ERRNO_UNCHANGED), + TEST_ff_f (pow, minus_infty, -12, 0, ERRNO_UNCHANGED), + TEST_ff_f (pow, minus_infty, -1002, 0, ERRNO_UNCHANGED), + TEST_ff_f (pow, minus_infty, -0.1L, 0, ERRNO_UNCHANGED), + TEST_ff_f (pow, minus_infty, -1.1L, 0, ERRNO_UNCHANGED), + TEST_ff_f (pow, minus_infty, -11.1L, 0, ERRNO_UNCHANGED), + TEST_ff_f (pow, minus_infty, -1001.1L, 0, ERRNO_UNCHANGED), + TEST_ff_f (pow, minus_infty, -min_subnorm_value, 0, ERRNO_UNCHANGED), TEST_ff_f (pow, qnan_value, qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), TEST_ff_f (pow, qnan_value, -qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), @@ -257,16 +257,16 @@ static const struct test_ff_f_data pow_test_data[] = TEST_ff_f (pow, minus_zero, minus_infty, plus_infty, ERRNO_UNCHANGED), /* pow (x, +inf) == +inf for |x| > 1. */ - TEST_ff_f (pow, 1.5, plus_infty, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE), + TEST_ff_f (pow, 1.5, plus_infty, plus_infty, ERRNO_UNCHANGED), /* pow (x, +inf) == +0 for |x| < 1. */ - TEST_ff_f (pow, 0.5, plus_infty, 0.0, ERRNO_UNCHANGED|NO_TEST_INLINE), + TEST_ff_f (pow, 0.5, plus_infty, 0.0, ERRNO_UNCHANGED), /* pow (x, -inf) == +0 for |x| > 1. */ - TEST_ff_f (pow, 1.5, minus_infty, 0.0, ERRNO_UNCHANGED|NO_TEST_INLINE), + TEST_ff_f (pow, 1.5, minus_infty, 0.0, ERRNO_UNCHANGED), /* pow (x, -inf) == +inf for |x| < 1. */ - TEST_ff_f (pow, 0.5, minus_infty, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE), + TEST_ff_f (pow, 0.5, minus_infty, plus_infty, ERRNO_UNCHANGED), /* pow (+inf, y) == +inf for y > 0. */ TEST_ff_f (pow, plus_infty, 2, plus_infty, ERRNO_UNCHANGED), diff --git a/math/libm-test-sinh.inc b/math/libm-test-sinh.inc index e1a1093346..9e10872a86 100644 --- a/math/libm-test-sinh.inc +++ b/math/libm-test-sinh.inc @@ -20,8 +20,8 @@ static const struct test_f_f_data sinh_test_data[] = { - TEST_f_f (sinh, plus_infty, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_f_f (sinh, minus_infty, minus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE), + TEST_f_f (sinh, plus_infty, plus_infty, ERRNO_UNCHANGED), + TEST_f_f (sinh, minus_infty, minus_infty, ERRNO_UNCHANGED), TEST_f_f (sinh, qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), TEST_f_f (sinh, -qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), TEST_f_f (sinh, snan_value, qnan_value, INVALID_EXCEPTION), diff --git a/math/libm-test-support.c b/math/libm-test-support.c index 6601358f37..0c85c60643 100644 --- a/math/libm-test-support.c +++ b/math/libm-test-support.c @@ -209,7 +209,7 @@ find_ulps (const char *name, const struct ulp_data *data, size_t nmemb) if (entry == NULL) return 0; else - return entry->max_ulp[(flag_test_inline ? ulp_i_idx : ulp_idx)]; + return entry->max_ulp[ulp_idx]; } void @@ -981,8 +981,6 @@ enable_test (int exceptions) { if (exceptions & XFAIL_TEST) return 0; - if (flag_test_inline && (exceptions & NO_TEST_INLINE)) - return 0; if ((!SNAN_TESTS (FLOAT) || !snan_tests_arg) && (exceptions & TEST_SNAN) != 0) return 0; diff --git a/math/libm-test-support.h b/math/libm-test-support.h index 25535c3a41..63d3e8972b 100644 --- a/math/libm-test-support.h +++ b/math/libm-test-support.h @@ -34,7 +34,6 @@ extern const int flag_test_errno; extern const int flag_test_exceptions; -extern const int flag_test_inline; extern const int flag_test_mathvec; extern const int snan_tests_arg; extern const char test_msg[]; @@ -60,7 +59,6 @@ extern const char doc[]; #define IGNORE_ZERO_INF_SIGN 0x400 #define TEST_NAN_SIGN 0x800 #define TEST_NAN_PAYLOAD 0x1000 -#define NO_TEST_INLINE 0x2000 #define XFAIL_TEST 0x4000 /* Indicate errno settings required or disallowed. */ #define ERRNO_UNCHANGED 0x8000 diff --git a/math/libm-test-tanh.inc b/math/libm-test-tanh.inc index 7c49e38bd4..e7e03380f1 100644 --- a/math/libm-test-tanh.inc +++ b/math/libm-test-tanh.inc @@ -20,8 +20,8 @@ static const struct test_f_f_data tanh_test_data[] = { - TEST_f_f (tanh, plus_infty, 1, ERRNO_UNCHANGED|NO_TEST_INLINE), - TEST_f_f (tanh, minus_infty, -1, ERRNO_UNCHANGED|NO_TEST_INLINE), + TEST_f_f (tanh, plus_infty, 1, ERRNO_UNCHANGED), + TEST_f_f (tanh, minus_infty, -1, ERRNO_UNCHANGED), TEST_f_f (tanh, qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), TEST_f_f (tanh, -qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), TEST_f_f (tanh, snan_value, qnan_value, INVALID_EXCEPTION), diff --git a/math/test-double-vlen2.h b/math/test-double-vlen2.h index d7d7bc01a4..6eb75cd782 100644 --- a/math/test-double-vlen2.h +++ b/math/test-double-vlen2.h @@ -17,7 +17,6 @@ . */ #include "test-double.h" -#include "test-math-no-inline.h" #include "test-math-vector.h" #define VEC_SUFF _vlen2 diff --git a/math/test-double-vlen4.h b/math/test-double-vlen4.h index 77fc30a4a5..7a47e7fb3d 100644 --- a/math/test-double-vlen4.h +++ b/math/test-double-vlen4.h @@ -17,7 +17,6 @@ . */ #include "test-double.h" -#include "test-math-no-inline.h" #include "test-math-vector.h" #define VEC_SUFF _vlen4 diff --git a/math/test-double-vlen8.h b/math/test-double-vlen8.h index e86704703e..466fa003f7 100644 --- a/math/test-double-vlen8.h +++ b/math/test-double-vlen8.h @@ -17,7 +17,6 @@ . */ #include "test-double.h" -#include "test-math-no-inline.h" #include "test-math-vector.h" #define VEC_SUFF _vlen8 diff --git a/math/test-float-vlen16.h b/math/test-float-vlen16.h index 9b236e0afd..b9eeb8ad18 100644 --- a/math/test-float-vlen16.h +++ b/math/test-float-vlen16.h @@ -17,7 +17,6 @@ . */ #include "test-float.h" -#include "test-math-no-inline.h" #include "test-math-vector.h" #define VEC_SUFF _vlen16 diff --git a/math/test-float-vlen4.h b/math/test-float-vlen4.h index af965e0151..ffbc6ff5cf 100644 --- a/math/test-float-vlen4.h +++ b/math/test-float-vlen4.h @@ -17,7 +17,6 @@ . */ #include "test-float.h" -#include "test-math-no-inline.h" #include "test-math-vector.h" #define VEC_SUFF _vlen4 diff --git a/math/test-float-vlen8.h b/math/test-float-vlen8.h index 70b311786e..dce482ec20 100644 --- a/math/test-float-vlen8.h +++ b/math/test-float-vlen8.h @@ -17,7 +17,6 @@ . */ #include "test-float.h" -#include "test-math-no-inline.h" #include "test-math-vector.h" #define VEC_SUFF _vlen8 diff --git a/math/test-math-inline.h b/math/test-math-inline.h deleted file mode 100644 index c522236e3e..0000000000 --- a/math/test-math-inline.h +++ /dev/null @@ -1,25 +0,0 @@ -/* Common definitions for libm tests for inline functions. - Copyright (C) 1997-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#define TEST_INLINE 1 -#define TEST_ERRNO 0 -#define TEST_EXCEPTIONS 0 - -#ifdef __NO_MATH_INLINES -# undef __NO_MATH_INLINES -#endif diff --git a/math/test-math-no-inline.h b/math/test-math-no-inline.h deleted file mode 100644 index 3843118406..0000000000 --- a/math/test-math-no-inline.h +++ /dev/null @@ -1,23 +0,0 @@ -/* Common definitions for libm tests for non-inline functions. - Copyright (C) 1997-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#define TEST_INLINE 0 - -#ifndef __NO_MATH_INLINES -# define __NO_MATH_INLINES -#endif