xref: /onnv-gate/usr/src/common/util/i386/muldiv.h (revision 436:c9ab97f06761)
1*436Sdmick /*
2*436Sdmick  * CDDL HEADER START
3*436Sdmick  *
4*436Sdmick  * The contents of this file are subject to the terms of the
5*436Sdmick  * Common Development and Distribution License, Version 1.0 only
6*436Sdmick  * (the "License").  You may not use this file except in compliance
7*436Sdmick  * with the License.
8*436Sdmick  *
9*436Sdmick  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*436Sdmick  * or http://www.opensolaris.org/os/licensing.
11*436Sdmick  * See the License for the specific language governing permissions
12*436Sdmick  * and limitations under the License.
13*436Sdmick  *
14*436Sdmick  * When distributing Covered Code, include this CDDL HEADER in each
15*436Sdmick  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*436Sdmick  * If applicable, add the following below this CDDL HEADER, with the
17*436Sdmick  * fields enclosed by brackets "[]" replaced with your own identifying
18*436Sdmick  * information: Portions Copyright [yyyy] [name of copyright owner]
19*436Sdmick  *
20*436Sdmick  * CDDL HEADER END
21*436Sdmick  */
22*436Sdmick 
23*436Sdmick /*
24*436Sdmick  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
25*436Sdmick  * Use is subject to license terms.
26*436Sdmick  */
27*436Sdmick 
28*436Sdmick #ifndef _MULDIV_H
29*436Sdmick #define	_MULDIV_H
30*436Sdmick 
31*436Sdmick #pragma ident	"%Z%%M%	%I%	%E% SMI"
32*436Sdmick 
33*436Sdmick /*
34*436Sdmick  * Helper routines for Sun and GCC compilers in 32-bit mode,
35*436Sdmick  * doing 64-bit math.  These routines should not be called directly;
36*436Sdmick  * they are called by code generated by the compiler.  Their declarations
37*436Sdmick  * are here for kmdb's hdr2map and map2linktest mechanisms.
38*436Sdmick  */
39*436Sdmick 
40*436Sdmick #if !defined(__amd64)
41*436Sdmick 
42*436Sdmick #ifdef __cplusplus
43*436Sdmick extern "C" {
44*436Sdmick #endif
45*436Sdmick 
46*436Sdmick extern int64_t __mul64(int64_t a, int64_t b);
47*436Sdmick 
48*436Sdmick extern uint64_t __udiv64(uint64_t x, uint64_t y);
49*436Sdmick extern uint64_t __urem64(uint64_t x, uint64_t y);
50*436Sdmick extern int64_t __div64(int64_t x, int64_t y);
51*436Sdmick extern int64_t __rem64(int64_t x, int64_t y);
52*436Sdmick 
53*436Sdmick extern uint64_t __udivdi3(uint64_t a, uint64_t b);
54*436Sdmick extern uint64_t __umoddi3(uint64_t a, uint64_t b);
55*436Sdmick extern int64_t __divdi3(int64_t a, int64_t b);
56*436Sdmick extern int64_t __moddi3(int64_t a, int64_t b);
57*436Sdmick 
58*436Sdmick extern uint64_t __udivrem64(uint64_t x, uint64_t y);
59*436Sdmick extern int64_t __divrem64(int64_t x, int64_t y);
60*436Sdmick 
61*436Sdmick #ifdef __cplusplus
62*436Sdmick }
63*436Sdmick #endif
64*436Sdmick 
65*436Sdmick #endif /* !defined(amd64) */
66*436Sdmick 
67*436Sdmick #endif /* _MULDIV_H */
68