This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

Re: [PATCH] New x87 fscale pattern and exp?f2 insn patterns


On Fri, 23 Apr 2004, Uros Bizjak wrote:
> 2004-04-23  Uros Bizjak  <uros@kss-loka.si>
>
>     * reg-stack.c (swap_to_top): New function
>     (subst_stack_regs_pat): UNSPEC_SIN, UNSPEC_COS, UNSPEC_FRNDINT,
>     UNSPEC_F2XM1: abort() if src1 dies.
>     UNSPEC_SINCOS_COS, UNSPEC_TAN_ONE, UNSPEC_XTRACT_FRACT: Same.
>     UNSPEC_SINCOS_SIN, UNSPEC_TAN_TAN, UNSPEC_XTRACT_EXP: Same.
>     UNSPEC_FPATAN, UNSPEC_FYL2X: Use swap_to_top().
>     UNSPEC_FSCALE: Remove.
>     (subst_stack_regs_pat): Handle UNSPEC_FSCALE_FRACT and
>     UNSPEC_FSCALE_EXP.
>
>     * config/i386/i386.md (UNSPEC_FSCALE): Remove.
>     (*fscale_sfxf3, *fscale_dfxf3, *fscale_xf3): Remove insn pattern.
>     (UNSPEC_FSCALE_FRACT, UNSPEC_FSCALE_EXP): New unspecs to represent
>     x87's fscale insn.
>     (*fscalexf4: Define new insn pattern to implement x87 fscale insn.
>     (exp?f2, exp10?f2, exp2?f2): Use *fscalexf4 and float_truncate
>     patterns.
>
>     * config/i386/i386.md (atansf2, atandf2, atanxf2): Move near
>     atan2?f3 expanders.

I'd prefer it if you could split this patch into two parts.  One to
remove handling of REG_DEAD notes from reg-stack.c (replacing this code
with aborts), and the second to rewrite the i386's fscale and exp*f2
functionality.  This way, should the new aborts ever trigger at some point
in future, a regression hunt will reveal the code that would need to be
added back to the compiler.  Bundling it with the "unrelated" i386.md
changes will just make reverting the relevant parts of this patch harder.

I'll let you choose which of these two halves, you prefer to independently
bootstrap, regression test and commit first.


> Attached patch is tested...

Ideally, its best to list the full target triple that you bootstrapped
and regression tested on.


Both changes look good, I'd just prefer them to go into CVS as two
separate commits.  I think for "I couldn't work out what this code
was doing so I replaced it with a call to abort" patches, this is
not unreasonable :>

Roger
--


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