Skip to content

Comparing floats with constant doubles promotes to double #9964

@jrmuizel

Description

@jrmuizel
Bugzilla Link 9592
Resolution FIXED
Resolved on Mar 31, 2011 05:14
Version trunk
OS All
CC @d0k

Extended Description

The following code:
float clamp_float(float a)
{
if (a > 1.)
return 1.;
else
return a;
}

compiles to:

    cvtss2sd        %xmm0, %xmm1
    ucomisd .LCPI0_0(%rip), %xmm1
    jbe     .LBB0_2

BB#1:

    movss   .LCPI0_1(%rip), %xmm0

.LBB0_2: # %entry
ret

GCC avoids the promotion to double.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzilla

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions