-
Notifications
You must be signed in to change notification settings - Fork 15.5k
Closed
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzilla
Description
| Bugzilla Link | 9661 |
| Resolution | LATER |
| Resolved on | Apr 21, 2011 20:37 |
| Version | trunk |
| OS | All |
| CC | @tkremenek |
Extended Description
This code:
float clamp_float(float a) {
if (a > 1.0f)
return 1.0f;
else if (a < 0.0f)
return 0.0f;
else
return a;
}
compiles to:
clamp_float: # @clamp_float
movss .LCPI0_0(%rip), %xmm1
ucomiss %xmm1, %xmm0
ja .LBB0_2
pxor %xmm1, %xmm1
maxss %xmm0, %xmm1
.LBB0_2: # %return
movaps %xmm1, %xmm0
ret
It should be able to be something like:
clamp_float: # @clamp_float
movss .LCPI0_0(%rip), %xmm1
minss %xmm1, %xmm0
pxor %xmm1, %xmm1
maxss %xmm1, %xmm0
ret
Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzilla