This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]