This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch to add missing math tests
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Cc: roger at eyesopen dot com
- Date: Sat, 2 Aug 2003 11:10:43 -0400 (EDT)
- Subject: Patch to add missing math tests
Roger - there are a few math funcs missing from builtins-1.c. Does
this look ok? If so, I'll check it in.
--Kaveh
PS: Some questions for you regarding builtin math func tests:
1. The convention for locating math builtins seems to be that those
taking a single FP arg go in builtins-1.c and those taking two FP
args go in builtins-4.c. This convention won't last because some
math funcs take void, char* or three args. How would you suggest
we proceed? It seems better to keep a complete list in one place
since that's easier to maintain. Should I stop following the
1-arg 2-arg convention and move the contents of builtins-4.c into
builtins-1.c and zap the -4.c file?
2. We have a similar split between -3.c and -5.c. I don't see a need
for two files here either. Although -3.c gets -ffast-math and
-5.c doesn't. Was this intentional? The -3.c file seems to link
without it.
2003-08-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* gcc.dg/builtins-1.c: Add more math builtins.
diff -rup orig/egcc-CVS20030801/gcc/testsuite/gcc.dg/builtins-1.c egcc-CVS20030801/gcc/testsuite/gcc.dg/builtins-1.c
--- orig/egcc-CVS20030801/gcc/testsuite/gcc.dg/builtins-1.c 2003-05-23 20:01:58.000000000 -0400
+++ egcc-CVS20030801/gcc/testsuite/gcc.dg/builtins-1.c 2003-08-01 23:07:31.007013917 -0400
@@ -15,6 +15,12 @@ double test4(double x) { return __builti
double test5(double x) { return __builtin_log(x); }
double test6(double x) { return __builtin_tan(x); }
double test7(double x) { return __builtin_atan(x); }
+double test8(double x) { return __builtin_ceil(x); }
+double test9(double x) { return __builtin_fabs(x); }
+double test10(double x) { return __builtin_floor(x); }
+double test11(double x) { return __builtin_nearbyint(x); }
+double test12(double x) { return __builtin_round(x); }
+double test13(double x) { return __builtin_trunc(x); }
float test1f(float x) { return __builtin_sqrtf(x); }
float test2f(float x) { return __builtin_cosf(x); }
@@ -23,6 +29,12 @@ float test4f(float x) { return __builtin
float test5f(float x) { return __builtin_logf(x); }
float test6f(float x) { return __builtin_tanf(x); }
float test7f(float x) { return __builtin_atanf(x); }
+float test8f(float x) { return __builtin_ceilf(x); }
+float test9f(float x) { return __builtin_fabsf(x); }
+float test10f(float x) { return __builtin_floorf(x); }
+float test11f(float x) { return __builtin_nearbyintf(x); }
+float test12f(float x) { return __builtin_roundf(x); }
+float test13f(float x) { return __builtin_truncf(x); }
long double test1l(long double x) { return __builtin_sqrtl(x); }
long double test2l(long double x) { return __builtin_cosl(x); }
@@ -31,4 +43,10 @@ long double test4l(long double x) { retu
long double test5l(long double x) { return __builtin_logl(x); }
long double test6l(long double x) { return __builtin_tanl(x); }
long double test7l(long double x) { return __builtin_atanl(x); }
+long double test8l(long double x) { return __builtin_ceill(x); }
+long double test9l(long double x) { return __builtin_fabsl(x); }
+long double test10l(long double x) { return __builtin_floorl(x); }
+long double test11l(long double x) { return __builtin_nearbyintl(x); }
+long double test12l(long double x) { return __builtin_roundl(x); }
+long double test13l(long double x) { return __builtin_truncl(x); }