This is the mail archive of the gcc@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: fabs(-0.0) and soft-float


Aldy Hernandez <aldyh@redhat.com> writes:

[...]

| Should we have gcc fold fabs() like this:?
| 
| 	 if (x > 0)
| 	   x = x;
| 	 else
| 	   x = -x;

This is better.

| Ideas?

How about unsetting the sign-bit?  I would expect fabs() clearing the
signbit of a QNaN. 

-- Gaby


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