This is the mail archive of the gcc-bugs@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]

[Bug middle-end/31548] __builtin_cabsf(z) squared should be optimized



------- Comment #2 from ubizjak at gmail dot com  2007-04-12 15:53 -------
(In reply to comment #0)

> The complex value is naively calculated as:
>   sqrt( (_Real_ z)*(_Real_ z) + (_Imag_ z)*(_Imag_ z) )
> 
> However, since the value is squared afterwards, the square root can be simply
> removed.

This optimization can also be applied to squared hypot().


-- 

ubizjak at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ubizjak at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31548


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