quad.h (50476) | quad.h (92917) |
---|---|
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 * --- 21 unchanged lines hidden (view full) --- 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 * SUCH DAMAGE. 36 * 37 * @(#)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 * --- 21 unchanged lines hidden (view full) --- 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 * SUCH DAMAGE. 36 * 37 * @(#)quad.h 8.1 (Berkeley) 6/4/93 |
38 * $FreeBSD: head/lib/libstand/quad.h 50476 1999-08-28 00:22:10Z peter $ | 38 * $FreeBSD: head/lib/libstand/quad.h 92917 2002-03-21 23:54:04Z obrien $ |
39 */ 40 41/* 42 * Quad arithmetic. 43 * 44 * This library makes the following assumptions: 45 * 46 * - The type long long (aka quad_t) exists. --- 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/* 42 * Quad arithmetic. 43 * 44 * This library makes the following assumptions: 45 * 46 * - The type long long (aka quad_t) exists. --- 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 |
100quad_t __divdi3 __P((quad_t a, quad_t b)); 101quad_t __moddi3 __P((quad_t a, quad_t b)); 102u_quad_t __qdivrem __P((u_quad_t u, u_quad_t v, u_quad_t *rem)); 103u_quad_t __udivdi3 __P((u_quad_t a, u_quad_t b)); 104u_quad_t __umoddi3 __P((u_quad_t a, u_quad_t b)); | 100quad_t __divdi3(quad_t a, quad_t b); 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); |
105 106/* 107 * XXX 108 * Compensate for gcc 1 vs gcc 2. Gcc 1 defines ?sh?di3's second argument 109 * as u_quad_t, while gcc 2 correctly uses int. Unfortunately, we still use 110 * both compilers. 111 */ 112#if __GNUC__ >= 2 113typedef unsigned int qshift_t; 114#else 115typedef u_quad_t qshift_t; 116#endif | 105 106/* 107 * XXX 108 * Compensate for gcc 1 vs gcc 2. Gcc 1 defines ?sh?di3's second argument 109 * as u_quad_t, while gcc 2 correctly uses int. Unfortunately, we still use 110 * both compilers. 111 */ 112#if __GNUC__ >= 2 113typedef unsigned int qshift_t; 114#else 115typedef u_quad_t qshift_t; 116#endif |