cmpdi2.c (348238dbd42306d9fb5d89ab393b840572cfeb0f) cmpdi2.c (4a8dea8cf97aab33f4e6a11afcc64dd9562f3bfd)
1/*-
2 * Copyright (c) 1992, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This software was developed by the Computer Systems Engineering group
6 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
7 * contributed to Berkeley.
8 *

--- 28 unchanged lines hidden (view full) ---

37#include <libkern/quad.h>
38
39/*
40 * Return 0, 1, or 2 as a <, =, > b respectively.
41 * Both a and b are considered signed---which means only the high word is
42 * signed.
43 */
44int
1/*-
2 * Copyright (c) 1992, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This software was developed by the Computer Systems Engineering group
6 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
7 * contributed to Berkeley.
8 *

--- 28 unchanged lines hidden (view full) ---

37#include <libkern/quad.h>
38
39/*
40 * Return 0, 1, or 2 as a <, =, > b respectively.
41 * Both a and b are considered signed---which means only the high word is
42 * signed.
43 */
44int
45__cmpdi2(a, b)
46 quad_t a, b;
45__cmpdi2(quad_t a, quad_t b)
47{
48 union uu aa, bb;
49
50 aa.q = a;
51 bb.q = b;
52 return (aa.sl[H] < bb.sl[H] ? 0 : aa.sl[H] > bb.sl[H] ? 2 :
53 aa.ul[L] < bb.ul[L] ? 0 : aa.ul[L] > bb.ul[L] ? 2 : 1);
54}
46{
47 union uu aa, bb;
48
49 aa.q = a;
50 bb.q = b;
51 return (aa.sl[H] < bb.sl[H] ? 0 : aa.sl[H] > bb.sl[H] ? 2 :
52 aa.ul[L] < bb.ul[L] ? 0 : aa.ul[L] > bb.ul[L] ? 2 : 1);
53}