[llvm-commits] [llvm-gcc-4.2] r74123 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Duncan Sands
baldrick at free.fr
Thu Jun 25 01:19:08 PDT 2009
Hi Dale,
> More resurrection of int complex.
> gcc.c-torture/execute/complex-6.c
how about adding a builder method CreateAnyNeg which
creates an integer or float negation as appropriate?
Ciao,
Duncan.
> 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
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list