[PATCH] Implement log1p..., correct ChangeLog
Roger Sayle
roger@eyesopen.com
Thu May 6 16:30:00 GMT 2004
On Thu, 6 May 2004, Uros Bizjak wrote:
> 2004-05-06 Uros Bizjak <uros@kss-loka.si>
>
> * optabs.h (enum optab_index): Add new OTI_log1p.
> (log1p_optab): Define corresponding macro.
> * optabs.c (init_optabs): Initialize log1p_optab.
> * genopinit.c (optabs): Implement log1p_optab using log1p?f2
> patterns.
> * builtins.c (expand_builtin_mathfn): Handle BUILT_IN_LOG1P{,F,L}
> using log1p_optab.
> (expand_builtin): Expand BUILT_IN_LOG1P{,F,L} using
> expand_builtin_mathfn if flag_unsafe_math_optimizations is set.
>
> * reg-stack.c (subst_stack_regs_pat): Handle UNSPEC_FYL2XP1.
>
> * config/i386/i386.c (ix86_emit_i387_log1p): New function.
> * config/i386/i386-protos.h (ix86_emit_i387_log1p):
> Prototype here.
> * config/i386/i386.md (UNSPEC_FYL2XP1): New unspec to represent
> x87's fyl2xp1 instruction.
> (*fyl2x_xf3): Rename insn definition to fyl2x_xf3.
> (fyl2xp1_xf3): New pattern to implement fyl2xp1 x87 instruction.
> (log1psf2, log1pdf2, log1pxf2): New expanders to implement log1pf,
> log1p and log1pl built-ins as inline x87 intrinsics.
>
> * testsuite/gcc.dg/builtins-33.c: Also check log1p*.
>
This is OK for mainline.
Could you also add test cases to both i386-387-5.c and i386-387-6.c in
testsuite/gcc.dg to check whether _log1p is being called without
-ffast-math, and uses fyl2xp1 otherwise? Normally, these would go in
i386-387-1.c and i386-387-2.c, but x87 intrinsics that clash with the
existing tests, i.e. for "fyl2x", should be placed in 5/6. Likewise,
could you add tests for fmod and drem which check for fprem and fprem1.
One should go in 1/2 and the other in 5/6.
Thanks in advance,
Roger
--
More information about the Gcc-patches
mailing list