diff options
-rw-r--r-- | lib/Target/X86/README.txt | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/Target/X86/README.txt b/lib/Target/X86/README.txt index 1ac2305e82..07722f44ec 100644 --- a/lib/Target/X86/README.txt +++ b/lib/Target/X86/README.txt @@ -2016,3 +2016,27 @@ We currently generate: We could save an instruction here by commuting the addss. //===---------------------------------------------------------------------===// + +This (from PR9661): + +float clamp_float(float a) { + if (a > 1.0f) + return 1.0f; + else if (a < 0.0f) + return 0.0f; + else + return a; +} + +Could compile to: + +clamp_float: # @clamp_float + movss .LCPI0_0(%rip), %xmm1 + minss %xmm1, %xmm0 + pxor %xmm1, %xmm1 + maxss %xmm1, %xmm0 + ret + +with -ffast-math. + +//===---------------------------------------------------------------------===// |