[llvm-commits] [llvm] r121854 - /llvm/trunk/lib/Target/README.txt
Chris Lattner
sabre at nondot.org
Tue Dec 14 23:28:58 PST 2010
Author: lattner
Date: Wed Dec 15 01:28:58 2010
New Revision: 121854
URL: http://llvm.org/viewvc/llvm-project?rev=121854&view=rev
Log:
add another overflow idiom
Modified:
llvm/trunk/lib/Target/README.txt
Modified: llvm/trunk/lib/Target/README.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/README.txt?rev=121854&r1=121853&r2=121854&view=diff
==============================================================================
--- llvm/trunk/lib/Target/README.txt (original)
+++ llvm/trunk/lib/Target/README.txt Wed Dec 15 01:28:58 2010
@@ -93,6 +93,14 @@
addq %rdi, %rbx
jno LBB0_2
+Apparently some version of GCC knows this. Here is a multiply idiom:
+
+unsigned int mul(unsigned int a,unsigned int b) {
+ if ((unsigned long long)a*b>0xffffffff)
+ exit(0);
+ return a*b;
+}
+
//===---------------------------------------------------------------------===//
Get the C front-end to expand hypot(x,y) -> llvm.sqrt(x*x+y*y) when errno and
More information about the llvm-commits
mailing list