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 rtl-optimization/82153] missed optimization: double rounding


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

--- Comment #4 from Arjan van de Ven <arjan at linux dot intel.com> ---
btw gcc has no issue with just generating cvttsd2si


int roundme2(double A)
{
        return A * 4.3;
}

generates

 20:   f2 0f 59 05 00 00 00    mulsd  0x0(%rip),%xmm0        # 28
<roundme2+0x8>
  27:   00
  28:   f2 0f 2c c0             cvttsd2si %xmm0,%eax
  2c:   c3                      retq


so maybe the real missed optimization is a trunc() followed by
assign-to-integer as a general thing

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