This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/31548] __builtin_cabsf(z) squared should be optimized
- From: "ubizjak at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Apr 2007 14:53:01 -0000
- Subject: [Bug middle-end/31548] __builtin_cabsf(z) squared should be optimized
- References: <bug-31548-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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