This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Creating imaginary inf/nan in GCC
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Cc: gcc at gcc dot gnu dot org
- Date: Sun, 1 Feb 2009 01:02:25 +0000 (UTC)
- Subject: Re: Creating imaginary inf/nan in GCC
- References: <Pine.GSO.4.58.0901291055280.12714@caipclassic.rutgers.edu> <Pine.LNX.4.64.0901291625190.23150@digraph.polyomino.org.uk> <4F2F45F76D24410CB30B71EFA14DC4C5@glap>
On Sat, 31 Jan 2009, Kaveh R. Ghazi wrote:
> From: "Joseph S. Myers" <joseph@codesourcery.com>
>
> > On Thu, 29 Jan 2009, Kaveh R. GHAZI wrote:
> >
> > > I don't think these results are a bug, rather it's just an artifact of the
> > > way complex multiplcation is done and having these special values in
> >
> > See bug 24581. Some aspects are a bug (GCC doesn't handle mixed
> > real/complex arithmetic the way it should), some are the lack of imaginary
> > types (though the only use of imaginary types I know of is this one for
> > building up constants, and no-one on the Power ABI working group could
> > find any implementation for Power Architecture that actually supports
> > imaginary types).
>
> Thanks for the PR pointer. I'm going to ask the obvious question, if there's
> an obvious answer please excuse me. :-)
>
> Would it be sufficient and correct to treat (0.0 + I) * y as a special case
> for MULT_EXPR and just swap the real and imaginary parts of "y" in the result?
(0.0 + I) * y should definitely be handled as a multiplication complex*y,
not imaginary*y, in accordance with the standard semantics.
--
Joseph S. Myers
joseph@codesourcery.com