xref: /linux/arch/microblaze/lib/ucmpdi2.c (revision 498495dba268b20e8eadd7fe93c140c68b6cc9d2)
1*b2441318SGreg Kroah-Hartman // SPDX-License-Identifier: GPL-2.0
2d64af918SMichal Simek #include <linux/export.h>
3c8ae8a82SMichal Simek 
4c8ae8a82SMichal Simek #include "libgcc.h"
5c8ae8a82SMichal Simek 
__ucmpdi2(unsigned long long a,unsigned long long b)6c8ae8a82SMichal Simek word_type __ucmpdi2(unsigned long long a, unsigned long long b)
7c8ae8a82SMichal Simek {
8c8ae8a82SMichal Simek 	const DWunion au = {.ll = a};
9c8ae8a82SMichal Simek 	const DWunion bu = {.ll = b};
10c8ae8a82SMichal Simek 
11c8ae8a82SMichal Simek 	if ((unsigned int) au.s.high < (unsigned int) bu.s.high)
12c8ae8a82SMichal Simek 		return 0;
13c8ae8a82SMichal Simek 	else if ((unsigned int) au.s.high > (unsigned int) bu.s.high)
14c8ae8a82SMichal Simek 		return 2;
15c8ae8a82SMichal Simek 	if ((unsigned int) au.s.low < (unsigned int) bu.s.low)
16c8ae8a82SMichal Simek 		return 0;
17c8ae8a82SMichal Simek 	else if ((unsigned int) au.s.low > (unsigned int) bu.s.low)
18c8ae8a82SMichal Simek 		return 2;
19c8ae8a82SMichal Simek 	return 1;
20c8ae8a82SMichal Simek }
21c8ae8a82SMichal Simek EXPORT_SYMBOL(__ucmpdi2);
22