This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH 0/8] Use cleanups for rounding mode changes.
- From: Richard Henderson <rth at twiddle dot net>
- To: libc-alpha at sourceware dot org
- Cc: joseph at codesourcery dot com
- Date: Wed, 7 Mar 2012 14:10:54 -0800
- Subject: [PATCH 0/8] Use cleanups for rounding mode changes.
In order to use inlines for the cleanup argument, I needed to
have the target-specific version of math_private.h include the
generic math/math_private.h version later.
In order to move the location of the math/math_private.h include
I needed to change a bunch of macros to be inlines, so that they
didn't interfere with the declarations in math/math_private.h.
I consider this a strict improvement as well. They're all marked
extern inline, so that they don't conflict with the extern decls.
I've verified that they are in fact always inlined.
The fifth patch moves some inlines from x86_64 to a generic header,
so that other targets can benefit. Technically this is a bit of
a layering violation, in that ieee754 knowledge is now embedded in
a generic header. Given that all targets really are ieee754/dbl-64
and ieee754/flt-32, I didn't think this was so bad. If there's
disagreement, I guess I could invent new math_private.h headers
under sysdeps/ieee754 and change all target-specific math_private.h
to use include_next...
The final patch optimizes the code generated for x86_64 a bit more,
allowing many of the users to now be leaf functions, allowing the
red zone to hold most of the stack frame. CC'ing you, Joseph,
because there *is* a conceptual change about when and whether any
fp exceptions are signalled. But given that until recently we did
not do any environment manipulation, I think this change is ok.
Comments?
r~
Richard Henderson (8):
Use target-specific math_private.h in math_ldbl_opt.h.
x86_64: Convert __ieee754_sqrt{,f,l} from macros to inlines.
x86_64: Convert __rint* and __floor* from macros to inlines.
powerpc: Convert __ieee754_sqrt{,f} from macros to inlines.
Move inline __isnan, __isinf_ns, __finite to generic math_private.h.
Convert libc_feholdexcept et al from macros to inline functions.
Create and use SET_RESTORE_{ENV_,}ROUND{,F,L}.
Create and use libc_feholdsetround, libc_feresetround{,_noex}.
math/math_private.h | 255 ++++++++++++++++++++++---
sysdeps/ieee754/dbl-64/e_exp.c | 4 +-
sysdeps/ieee754/dbl-64/e_exp2.c | 97 +++++-----
sysdeps/ieee754/dbl-64/e_pow.c | 4 +-
sysdeps/ieee754/dbl-64/s_fma.c | 121 ++++++------
sysdeps/ieee754/dbl-64/s_fmaf.c | 16 +-
sysdeps/ieee754/dbl-64/s_sin.c | 8 +-
sysdeps/ieee754/dbl-64/s_tan.c | 4 +-
sysdeps/ieee754/flt-32/e_exp2f.c | 89 +++++-----
sysdeps/ieee754/flt-32/e_expf.c | 49 +++---
sysdeps/ieee754/ldbl-opt/math_ldbl_opt.h | 2 +-
sysdeps/powerpc/fpu/math_private.h | 106 ++++-------
sysdeps/x86_64/fpu/math_private.h | 302 +++++++++++++++---------------
13 files changed, 602 insertions(+), 455 deletions(-)
--
1.7.7.6
- Follow-Ups:
- [PATCH 1/8] Use target-specific math_private.h in math_ldbl_opt.h.
- [PATCH 2/8] x86_64: Convert __ieee754_sqrt{,f,l} from macros to inlines.
- [PATCH 3/8] x86_64: Convert __rint* and __floor* from macros to inlines.
- [PATCH 8/8] Create and use libc_feholdsetround, libc_feresetround{,_noex}.
- [PATCH 4/8] powerpc: Convert __ieee754_sqrt{,f} from macros to inlines.
- [PATCH 5/8] Move inline __isnan, __isinf_ns, __finite to generic math_private.h.
- [PATCH 6/8] Convert libc_feholdexcept et al from macros to inline functions.
- [PATCH 7/8] Create and use SET_RESTORE_{ENV_,}ROUND{,F,L}.
- Re: [PATCH 0/8] Use cleanups for rounding mode changes.