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 Tue, Nov 26, 2002 at 12:35:27AM +0100, Jan Hubicka wrote:
> > 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.
>
> If you have N+1 modes for switching, and
>
> 0: read fpcw into mem slot A
> 1: construct round to zero at mem slot B
> 2: construct round to -inf at mem slot C
> ...
Exactly that is what I am thinking about.
>
> then the bits that emit code for (1) can assume that (0) has been
> done, and so does not have to re-read the fpcw. I don't see much
> advantage to a fixed pseudo since we've got to have the default
> fpcw value in memory anyhow.
My problem is that I need the value of fpcw in register in order to
compute value for mem slot B or C.
So I think I can make (0) to also load value into pseudo and keep it
around so (1)-(n) don't have to re-read it again and again.
On ther other hand function hardly will compute multiple control words
so perhaps this is not needed.
This is getting bit tricky. For x86_64 we also may want to arrange
the library rountines for controling control word to initialize global
variables with what we need in memory slots A-C and we can simply forget
about the optimize_mode_switching computing that.
I would like to take a closer look later on this. What about
looking at the floor->floorf patches first? That ones seems to be more
important for performance after all...
Honza
>
>
> r~