WIP FPC-III support
[linux/fpc-iii.git] / arch / parisc / lib / ucmpdi2.c
blob8e6014a142ef407495a9d8e2c5c9c70bc6dfbaf1
1 // SPDX-License-Identifier: GPL-2.0
2 #include <linux/module.h>
4 union ull_union {
5 unsigned long long ull;
6 struct {
7 unsigned int high;
8 unsigned int low;
9 } ui;
12 int __ucmpdi2(unsigned long long a, unsigned long long b)
14 union ull_union au = {.ull = a};
15 union ull_union bu = {.ull = b};
17 if (au.ui.high < bu.ui.high)
18 return 0;
19 else if (au.ui.high > bu.ui.high)
20 return 2;
21 if (au.ui.low < bu.ui.low)
22 return 0;
23 else if (au.ui.low > bu.ui.low)
24 return 2;
25 return 1;