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: Fast operations on floating point numbers?


Martin Reinecke wrote:
Unfortunately this does not work in all places where I have this
problem. But even where I can use it, there is still a
full floating-point multiplication where the simple XORing of
a single bit should do. But maybe the cost of both operations
is not so different on today's CPUs; I don't know.

Your problem is architecture-specific. For example, modern Intel architecture processors support the FCHS instruction to flip the sign of the floating-point value in ST(0), by performing a simple bit flip. I haven't run any tests, but I suspect GCC is smart enough to use that instruction.


--
Scott Robert Ladd
Coyote Gulch Productions (http://www.coyotegulch.com)
Software Invention for High-Performance Computing



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