blob: 62c7724e3c9a6db12eede6c7b5d9e763736aa111 [file] [log] [blame]
Edward O'Callaghan37a6a452009-08-07 20:30:09 +00001/* ===-- parityti2.c - Implement __parityti2 -------------------------------===
2 *
Chandler Carruth7a739a02019-01-19 10:56:40 +00003 * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 * See https://llvm.org/LICENSE.txt for license information.
5 * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
Edward O'Callaghan37a6a452009-08-07 20:30:09 +00006 *
7 * ===----------------------------------------------------------------------===
8 *
9 * This file implements __parityti2 for the compiler_rt library.
10 *
11 * ===----------------------------------------------------------------------===
12 */
Daniel Dunbarb3a69012009-06-26 16:47:03 +000013
Daniel Dunbarb3a69012009-06-26 16:47:03 +000014#include "int_lib.h"
15
Joerg Sonnenberger4733cca2014-02-21 23:53:03 +000016#ifdef CRT_HAS_128BIT
Chandler Carruth7f2d7c72012-06-22 21:09:22 +000017
Edward O'Callaghan37a6a452009-08-07 20:30:09 +000018/* Returns: 1 if number of bits is odd else returns 0 */
Daniel Dunbarb3a69012009-06-26 16:47:03 +000019
Joerg Sonnenbergerbfbb8bb2014-03-01 15:30:50 +000020COMPILER_RT_ABI si_int
Daniel Dunbarb3a69012009-06-26 16:47:03 +000021__parityti2(ti_int a)
22{
23 twords x;
24 x.all = a;
Edward O'Callaghanaabd9612009-09-03 09:12:20 +000025 return __paritydi2(x.s.high ^ x.s.low);
Daniel Dunbarb3a69012009-06-26 16:47:03 +000026}
27
Joerg Sonnenberger4733cca2014-02-21 23:53:03 +000028#endif /* CRT_HAS_128BIT */