[llvm-commits] [llvm-gcc-4.2] r74123 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Dale Johannesen
dalej at apple.com
Wed Jun 24 14:53:46 PDT 2009
Author: johannes
Date: Wed Jun 24 16:53:10 2009
New Revision: 74123
URL: http://llvm.org/viewvc/llvm-project?rev=74123&view=rev
Log:
More resurrection of int complex.
gcc.c-torture/execute/complex-6.c
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=74123&r1=74122&r2=74123&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Wed Jun 24 16:53:10 2009
@@ -3120,8 +3120,13 @@
// Handle complex numbers: -(a+ib) = -a + i*-b
Value *R, *I;
EmitLoadFromComplex(R, I, Tmp);
- R = Builder.CreateFNeg(R);
- I = Builder.CreateFNeg(I);
+ if (R->getType()->isFloatingPoint()) {
+ R = Builder.CreateFNeg(R);
+ I = Builder.CreateFNeg(I);
+ } else {
+ R = Builder.CreateNeg(R);
+ I = Builder.CreateNeg(I);
+ }
EmitStoreToComplex(*DestLoc, R, I);
return 0;
}
@@ -3137,7 +3142,10 @@
// Handle complex numbers: ~(a+ib) = a + i*-b
Value *R, *I;
EmitLoadFromComplex(R, I, Tmp);
- I = Builder.CreateFNeg(I);
+ if (I->getType()->isFloatingPoint())
+ I = Builder.CreateFNeg(I);
+ else
+ I = Builder.CreateNeg(I);
EmitStoreToComplex(*DestLoc, R, I);
return 0;
}
@@ -4550,6 +4558,8 @@
return false;
}
+ // This treats everything as unknown, and is minimally defensible as
+ // correct, although completely useless.
if (tree_low_cst (ObjSizeTree, 0) < 2)
Result = ConstantInt::getAllOnesValue(TD.getIntPtrType());
else
More information about the llvm-commits
mailing list