From 217b614317dad692116a3a06fe94ea8f61a59edb Mon Sep 17 00:00:00 2001 From: Ed Schouten Date: Thu, 21 Oct 2010 19:02:02 +0000 Subject: Import compiler-rt r117047. --- lib/parityti2.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 lib/parityti2.c (limited to 'lib/parityti2.c') diff --git a/lib/parityti2.c b/lib/parityti2.c new file mode 100644 index 000000000000..650d417936af --- /dev/null +++ b/lib/parityti2.c @@ -0,0 +1,31 @@ +/* ===-- parityti2.c - Implement __parityti2 -------------------------------=== + * + * The LLVM Compiler Infrastructure + * + * This file is distributed under the University of Illinois Open Source + * License. See LICENSE.TXT for details. + * + * ===----------------------------------------------------------------------=== + * + * This file implements __parityti2 for the compiler_rt library. + * + * ===----------------------------------------------------------------------=== + */ + +#if __x86_64 + +#include "int_lib.h" + +/* Returns: 1 if number of bits is odd else returns 0 */ + +si_int __paritydi2(di_int a); + +si_int +__parityti2(ti_int a) +{ + twords x; + x.all = a; + return __paritydi2(x.s.high ^ x.s.low); +} + +#endif -- cgit v1.2.3