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