Thomas Gleixner | 588cb88 | 2019-05-23 11:14:57 +0200 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
Palmer Dabbelt | b35cd98 | 2017-05-23 10:28:26 -0700 | [diff] [blame] | 2 | /* |
Palmer Dabbelt | b35cd98 | 2017-05-23 10:28:26 -0700 | [diff] [blame] | 3 | */ |
| 4 | |
| 5 | #include <linux/module.h> |
Christoph Hellwig | 4db2b60 | 2017-11-22 11:47:28 +0100 | [diff] [blame] | 6 | #include <linux/libgcc.h> |
Palmer Dabbelt | b35cd98 | 2017-05-23 10:28:26 -0700 | [diff] [blame] | 7 | |
Palmer Dabbelt | aad5a53 | 2018-04-11 08:50:16 +0100 | [diff] [blame] | 8 | word_type notrace __ucmpdi2(unsigned long long a, unsigned long long b) |
Palmer Dabbelt | b35cd98 | 2017-05-23 10:28:26 -0700 | [diff] [blame] | 9 | { |
| 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 | } |
| 23 | EXPORT_SYMBOL(__ucmpdi2); |