[llvm-commits] [llvm] r129527 - /llvm/trunk/lib/Target/X86/README.txt
Chris Lattner
sabre at nondot.org
Thu Apr 14 11:47:18 PDT 2011
Author: lattner
Date: Thu Apr 14 13:47:18 2011
New Revision: 129527
URL: http://llvm.org/viewvc/llvm-project?rev=129527&view=rev
Log:
move PR9661 out to here.
Modified:
llvm/trunk/lib/Target/X86/README.txt
Modified: llvm/trunk/lib/Target/X86/README.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/README.txt?rev=129527&r1=129526&r2=129527&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/README.txt (original)
+++ llvm/trunk/lib/Target/X86/README.txt Thu Apr 14 13:47:18 2011
@@ -2016,3 +2016,27 @@
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.
+
+//===---------------------------------------------------------------------===//
More information about the llvm-commits
mailing list