https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89774

Marius Messerschmidt <marius.messerschmidt at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|WORKSFORME                  |FIXED

--- Comment #2 from Marius Messerschmidt <marius.messerschmidt at googlemail 
dot com> ---
This will cause issues the other way around as well.

I think that I did not state clearly what I meant...

Right now you can only use 'all double' or 'all float'. What I am looking for
is some kind of performance-oriented solution that will pick the 'best' option
for each literal.

Quick example:

void f() {
  float a = 2.0;     // 2.0 -> single
  float b = 2.0 * b; // 2.0 -> single

  double d = 3.0;    // 3.0 -> double
  double e = 3.0 * d;// 3.0 -> double

  double z = 2.0 * a + 3.0 * d; // both 2.0 and 3.0 -> double (only cast a)
}

The basic idea is to increase performance by reducing casting instructions.

Is something like that already implemented or if not, do you think that this is
useful and could be implemented?

Reply via email to