This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [3.4-BIB] Add i386 trunc/nearbyint patterns II
> On Fri, Nov 08, 2002 at 11:58:02AM +0100, Jan Hubicka wrote:
> > + ;; FP control word required by the instruction.
> > + ;; UNINITIALIZED is used in case instruction can change rounding mode and saved copies
> > + ;; of it needs to be updated
> > + (define_attr "fp_cw" "round_down,uninitialized,any"
>
> I think this is a confusing way to express this, especially since this
> isn't the control word itself, but the cached copy of the control word
> with the rounding mode set to a known value.
I meant this as requirement the instruction have.
I would like to get the fldcw/fstcw inserted by optimize_mode_switching
that needs to be done post reload. Then I would like pre-reload pass to
get the copies constructed and post reload to do actually the job.
Another problem is that I need different values of control word around.
Currently I have default and round_toward_zero (the round_down in patch
is confused). I think only way I can handle more values is to declare
each saved copy an separate entity for pre-reload mode switching pass
and use fixed pseudo to hold value of the default control word so the
initialization code for other entities don't have to initialize it.
Does this seem to make sense at all?
I am just looking at possiblilities to inline this when needed using the
arithmetics that appears to work faster on modern CPUs anyway, so
perhaps this is not needed at all...
>
> > + (define_expand "truncsf2"
> > + [(set (match_operand:SF 0 "register_operand" "=f")
> > + (unspec:SF [(match_operand:SF 1 "register_operand" "0")] UNSPEC_TRUNC))]
> > + "! TARGET_NO_FANCY_MATH_387 && TARGET_80387"
> > + "")
>
> And "trunc" is already a reserved name that does not mean "floor".
It actually really is trunc, not floor like in my first atttempt, as I
was originally confused by the control word setting.
Honza
>
>
>
> r~