summaryrefslogtreecommitdiffstats
path: root/include/tgmath.h
Commit message (Collapse)AuthorAgeFilesLines
* Enable improved <tgmath.h> for Clang even when not using C11.ed2013-04-271-1/+2
| | | | | | | | By using __has_extension(c_generic_selections), we can explicitly test whether we're dealing with a version of Clang that supports _Generic(). That way we can use the improved <tgmath.h> code, even when not using -std=c11. This massively reduces the compilation time when invoking these functions.
* Last attempt at <tgmath.h>: do enable the new code for C11 compilers.ed2012-01-061-11/+17
| | | | | | | | | | | | I was thinking by myself, if the new code doesn't work with GCC 4.2, why not simply turn it into an efficient version for C11 compilers? By changing the code to use _Generic() directly in that case, I can build the tgmath regression test in a matter of milliseconds with Clang, instead of the 8 seconds it used to take. So by the time C11 becomes the default, it will pick up the new code automatically. And now I will refrain from making more changes to <tgmath.h>.
* Add an even faster implementation of <tgmath.h> for the future.ed2012-01-061-0/+20
| | | | | | | Instead of using an exponential number of cases with respect to the number of arguments, this version only uses a linear number. Unfortunately, it works with Clang, GCC 4.6 and GCC 4.7, but not GCC 4.2. Therefore, leave it commented out.
* Remove _Complex_I workaround from <tgmath.h>.ed2012-01-051-9/+4
| | | | | This removes the use of __typeof() from this header, thus making it work with a plain C11 compiler.
* Reimplement <tgmath.h> on top of __generic().ed2012-01-051-45/+66
| | | | | | | | | | | | The macro construction used now, is almost identical to the code provided in C11 proposal N1404. This new version doesn't seem to introduce any regressions according to the regression test in tools/, but still seems to malfunction with Clang on certain aspects. The new code does work successfully with GCC 4.2, 4.6 and 4.7. With 4.7, it also works when __generic() is implemented on top of _Generic(). Discussed with: stefanf
* Properly parenthesize the __tg_is_complex() macro by moving a closingschweikh2007-02-021-2/+2
| | | | | | paren to where it belongs. MFC after: 7 days
* Add a workaround to recognise I/_Complex_I as complex arguments. Althoughstefanf2004-09-031-1/+2
| | | | | the GCC manual claims that the expression 1.0fi has type float _Complex, __builtin_types_compatible_p(float _Complex, __typeof__(1.0fi))) yields 0.
* Use the keyword '_Complex' rather than the macro 'complex' sincestefanf2004-09-031-4/+4
| | | | applications are allowed to undefine the latter.
* Embarrassing typo: s/nextbyint/nearbyint/stefanf2004-09-031-1/+1
|
* Implement C99's standard header <tgmath.h>. It provides type-generic macrosstefanf2004-08-081-0/+166
for the <math.h> and <complex.h> functions that have float, double and long double implementations. Such type-generic macros expand to an actual function, depending on the types of the macro arguments, eg. if <tgmath.h> is included, the invocation cos(1.0f) calls the function cosf().
OpenPOWER on IntegriCloud