Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / arch / parisc / lib / ucmpdi2.c
blob9d8b4dbae27393c983f3d8c17b953d9b905122e5
1 // SPDX-License-Identifier: GPL-2.0
2 #include <linux/module.h>
3 #include <linux/libgcc.h>
5 union ull_union {
6 unsigned long long ull;
7 struct {
8 unsigned int high;
9 unsigned int low;
10 } ui;
13 word_type __ucmpdi2(unsigned long long a, unsigned long long b)
15 union ull_union au = {.ull = a};
16 union ull_union bu = {.ull = b};
18 if (au.ui.high < bu.ui.high)
19 return 0;
20 else if (au.ui.high > bu.ui.high)
21 return 2;
22 if (au.ui.low < bu.ui.low)
23 return 0;
24 else if (au.ui.low > bu.ui.low)
25 return 2;
26 return 1;