Edward O'Callaghan | 37a6a45 | 2009-08-07 20:30:09 +0000 | [diff] [blame] | 1 | /* ===-- parityti2.c - Implement __parityti2 -------------------------------=== |
| 2 | * |
Chandler Carruth | 7a739a0 | 2019-01-19 10:56:40 +0000 | [diff] [blame] | 3 | * 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'Callaghan | 37a6a45 | 2009-08-07 20:30:09 +0000 | [diff] [blame] | 6 | * |
| 7 | * ===----------------------------------------------------------------------=== |
| 8 | * |
| 9 | * This file implements __parityti2 for the compiler_rt library. |
| 10 | * |
| 11 | * ===----------------------------------------------------------------------=== |
| 12 | */ |
Daniel Dunbar | b3a6901 | 2009-06-26 16:47:03 +0000 | [diff] [blame] | 13 | |
Daniel Dunbar | b3a6901 | 2009-06-26 16:47:03 +0000 | [diff] [blame] | 14 | #include "int_lib.h" |
| 15 | |
Joerg Sonnenberger | 4733cca | 2014-02-21 23:53:03 +0000 | [diff] [blame] | 16 | #ifdef CRT_HAS_128BIT |
Chandler Carruth | 7f2d7c7 | 2012-06-22 21:09:22 +0000 | [diff] [blame] | 17 | |
Edward O'Callaghan | 37a6a45 | 2009-08-07 20:30:09 +0000 | [diff] [blame] | 18 | /* Returns: 1 if number of bits is odd else returns 0 */ |
Daniel Dunbar | b3a6901 | 2009-06-26 16:47:03 +0000 | [diff] [blame] | 19 | |
Joerg Sonnenberger | bfbb8bb | 2014-03-01 15:30:50 +0000 | [diff] [blame] | 20 | COMPILER_RT_ABI si_int |
Daniel Dunbar | b3a6901 | 2009-06-26 16:47:03 +0000 | [diff] [blame] | 21 | __parityti2(ti_int a) |
| 22 | { |
| 23 | twords x; |
| 24 | x.all = a; |
Edward O'Callaghan | aabd961 | 2009-09-03 09:12:20 +0000 | [diff] [blame] | 25 | return __paritydi2(x.s.high ^ x.s.low); |
Daniel Dunbar | b3a6901 | 2009-06-26 16:47:03 +0000 | [diff] [blame] | 26 | } |
| 27 | |
Joerg Sonnenberger | 4733cca | 2014-02-21 23:53:03 +0000 | [diff] [blame] | 28 | #endif /* CRT_HAS_128BIT */ |