[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:28:54 PDT 2007
Author: dpatel
Date: Thu Aug 2 12:28:53 2007
New Revision: 40742
URL: http://llvm.org/viewvc/llvm-project?rev=40742&view=rev
Log:
Expand builtin_parity.
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=40742&r1=40741&r2=40742&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Thu Aug 2 12:28:53 2007
@@ -4303,6 +4303,14 @@
EmitBuiltinUnaryIntOp(Amt, Result, Intrinsic::cttz);
return true;
}
+ 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");
+ return true;
+ }
case BUILT_IN_POPCOUNT: // These GCC builtins always return int.
case BUILT_IN_POPCOUNTL:
case BUILT_IN_POPCOUNTLL: {
More information about the llvm-commits
mailing list