Deleted Added
full compact
quad.h (128935) quad.h (128965)
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 *

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

26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)quad.h 8.1 (Berkeley) 6/4/93
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 *

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

26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)quad.h 8.1 (Berkeley) 6/4/93
34 * $FreeBSD: head/sys/libkern/quad.h 128935 2004-05-04 22:15:54Z cognet $
34 * $FreeBSD: head/sys/libkern/quad.h 128965 2004-05-05 15:12:55Z bde $
35 */
36
35 */
36
37#ifndef _LIBKERN_QUAD_H
38#define _LIBKERN_QUAD_H
37#ifndef _LIBKERN_QUAD_H_
38#define _LIBKERN_QUAD_H_
39
40/*
41 * Quad arithmetic.
42 *
43 * This library makes the following assumptions:
44 *
45 * - The type long long (aka quad_t) exists.
46 *

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

92 * These are used in the multiply code, to split a longword into upper
93 * and lower halves, and to reassemble a product as a quad_t, shifted left
94 * (sizeof(long)*CHAR_BIT/2).
95 */
96#define HHALF(x) ((x) >> HALF_BITS)
97#define LHALF(x) ((x) & ((1 << HALF_BITS) - 1))
98#define LHUP(x) ((x) << HALF_BITS)
99
39
40/*
41 * Quad arithmetic.
42 *
43 * This library makes the following assumptions:
44 *
45 * - The type long long (aka quad_t) exists.
46 *

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

92 * These are used in the multiply code, to split a longword into upper
93 * and lower halves, and to reassemble a product as a quad_t, shifted left
94 * (sizeof(long)*CHAR_BIT/2).
95 */
96#define HHALF(x) ((x) >> HALF_BITS)
97#define LHALF(x) ((x) & ((1 << HALF_BITS) - 1))
98#define LHUP(x) ((x) << HALF_BITS)
99
100typedef unsigned int qshift_t;
101
102quad_t __ashldi3(quad_t, qshift_t);
103quad_t __ashrdi3(quad_t, qshift_t);
100quad_t __divdi3(quad_t a, quad_t b);
104quad_t __divdi3(quad_t a, quad_t b);
105quad_t __lshrdi3(quad_t, qshift_t);
101quad_t __moddi3(quad_t a, quad_t b);
102u_quad_t __qdivrem(u_quad_t u, u_quad_t v, u_quad_t *rem);
103u_quad_t __udivdi3(u_quad_t a, u_quad_t b);
104u_quad_t __umoddi3(u_quad_t a, u_quad_t b);
105int __ucmpdi2(u_quad_t a, u_quad_t b);
106
106quad_t __moddi3(quad_t a, quad_t b);
107u_quad_t __qdivrem(u_quad_t u, u_quad_t v, u_quad_t *rem);
108u_quad_t __udivdi3(u_quad_t a, u_quad_t b);
109u_quad_t __umoddi3(u_quad_t a, u_quad_t b);
110int __ucmpdi2(u_quad_t a, u_quad_t b);
111
107typedef unsigned int qshift_t;
108
109quad_t __ashldi3(quad_t, qshift_t);
110quad_t __ashrdi3(quad_t, qshift_t);
111quad_t __lshrdi3(quad_t, qshift_t);
112#endif /* _LIBKERN_QUAD_H */
112#endif /* !_LIBKERN_QUAD_H_ */