[llvm-commits] [llvm-gcc-4.2] r40742 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Devang Patel
dpatel at apple.com
Thu Aug 2 10:45:57 PDT 2007
On Aug 2, 2007, at 10:34 AM, Chris Lattner wrote:
>> URL: http://llvm.org/viewvc/llvm-project?rev=40742&view=rev
>> Log:
>> Expand builtin_parity.
>
> Cool:
>
>> + case BUILT_IN_PARITY: {
>> + Value *Amt = Emit(TREE_VALUE(TREE_OPERAND(exp, 1)), 0);
>> + EmitBuiltinUnaryIntOp(Amt, Result, Intrinsic::ctpop);
>> + Result = Builder.CreateBinOp(Instruction::And, Result,
>> + TreeConstantToLLVM::ConvertINTEGER_CST
>> (integer_one_node),
>> + "tmp");
>
> I don't think that ConvertINTEGER_CST will work here: the type of the
> "Result" var and the "1" constant have to match. I assume that this
> will work for parity of int, but fail on parity of long long etc.
That'd be BUILTIN_IN_PARITYL :)
> Please use:
>
> ConstantInt::get(Result->getType(), 1)
>
> instead,
I'll fix it.
Thanks,
-
Devang
>
>
> -Chris
>
>
>
> _______________________________________________
> 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