https://jxself.org/git/linux-libre.git
Raw File
Tip revision: 5db5585b97e8174f881ebe9f6c03ad7c75e7219e authored by Jason Self on 13 February 2014, 21:48:21 UTC
Linux-libre 3.10.30-gnu
Tip revision: 5db5585
ucmpdi2.c
#include <linux/module.h>

union ull_union {
	unsigned long long ull;
	struct {
		unsigned int high;
		unsigned int low;
	} ui;
};

int __ucmpdi2(unsigned long long a, unsigned long long b)
{
	union ull_union au = {.ull = a};
	union ull_union bu = {.ull = b};

	if (au.ui.high < bu.ui.high)
		return 0;
	else if (au.ui.high > bu.ui.high)
		return 2;
	if (au.ui.low < bu.ui.low)
		return 0;
	else if (au.ui.low > bu.ui.low)
		return 2;
	return 1;
}
back to top