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