move PR9661 out to here.
authorChris Lattner <sabre@nondot.org>
Thu, 14 Apr 2011 18:47:18 +0000 (18:47 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 14 Apr 2011 18:47:18 +0000 (18:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129527 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/README.txt

index 1ac2305e82b101520365838ecaac373e00a43193..07722f44ec39dcd96b06798829290af14f63806b 100644 (file)
@@ -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.
+
+//===---------------------------------------------------------------------===//