blob: 726e394c9fcc7b6847f12e65d8f9d37ef48170db [file] [log] [blame]
Thomas Gleixner588cb882019-05-23 11:14:57 +02001// SPDX-License-Identifier: GPL-2.0-or-later
Palmer Dabbeltb35cd982017-05-23 10:28:26 -07002/*
Palmer Dabbeltb35cd982017-05-23 10:28:26 -07003 */
4
5#include <linux/module.h>
Christoph Hellwig4db2b602017-11-22 11:47:28 +01006#include <linux/libgcc.h>
Palmer Dabbeltb35cd982017-05-23 10:28:26 -07007
Palmer Dabbeltaad5a532018-04-11 08:50:16 +01008word_type notrace __ucmpdi2(unsigned long long a, unsigned long long b)
Palmer Dabbeltb35cd982017-05-23 10:28:26 -07009{
10 const DWunion au = {.ll = a};
11 const DWunion bu = {.ll = b};
12
13 if ((unsigned int) au.s.high < (unsigned int) bu.s.high)
14 return 0;
15 else if ((unsigned int) au.s.high > (unsigned int) bu.s.high)
16 return 2;
17 if ((unsigned int) au.s.low < (unsigned int) bu.s.low)
18 return 0;
19 else if ((unsigned int) au.s.low > (unsigned int) bu.s.low)
20 return 2;
21 return 1;
22}
23EXPORT_SYMBOL(__ucmpdi2);