18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0
28c2ecf20Sopenharmony_ci#include <linux/module.h>
38c2ecf20Sopenharmony_ci#include "libgcc.h"
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ciword_type __ucmpdi2(unsigned long long a, unsigned long long b)
68c2ecf20Sopenharmony_ci{
78c2ecf20Sopenharmony_ci	const DWunion au = {.ll = a};
88c2ecf20Sopenharmony_ci	const DWunion bu = {.ll = b};
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci	if ((unsigned int) au.s.high < (unsigned int) bu.s.high)
118c2ecf20Sopenharmony_ci		return 0;
128c2ecf20Sopenharmony_ci	else if ((unsigned int) au.s.high > (unsigned int) bu.s.high)
138c2ecf20Sopenharmony_ci		return 2;
148c2ecf20Sopenharmony_ci	if ((unsigned int) au.s.low < (unsigned int) bu.s.low)
158c2ecf20Sopenharmony_ci		return 0;
168c2ecf20Sopenharmony_ci	else if ((unsigned int) au.s.low > (unsigned int) bu.s.low)
178c2ecf20Sopenharmony_ci		return 2;
188c2ecf20Sopenharmony_ci	return 1;
198c2ecf20Sopenharmony_ci}
208c2ecf20Sopenharmony_ciEXPORT_SYMBOL(__ucmpdi2);
21