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] Support Cell SPU floating point


> > Do you think adding a mode argument to the appropriate routines in
> > real.c (e.g., real_arithmetic, real_compare) is the correct approach?
> > That would allow me to model the hardware correctly.  Or do you have
> > another suggestion?
> 
> Well, in general I think that adding a mode argument to those functions
> makes sense (and I see that would be necessary to do what you need).

While trying to implement this, and based on Ian's comments, I wonder if
it is better to add a special real_arithmetic_fold routine.  It would
just be a wrapper around real_arithmetic and would allow me to add my
target specific hooks.

real_arithmetic is getting used in different ways.  To fold user
specified constants, but also to compute values during other
optimizations.  For example, at one point it is just used to compute
1/3*1/3 to get 1/9.  In this case, I imagine we want infinite precision.
These other cases are generally protected by the unsafe math flag, so
I'm not sure if it matters to expect exact hardware beahvior there.

Another advantage to adding a wrapper is that I don't need to change
every occurance of real_arithmetic, making the patch smaller.

Any opinions about this approach?  I'm going to continue working on a
patch with a wrapper, unless I here otherwise.

Trevor


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