xref: /netbsd/sys/arch/hppa/spmath/hppa.h (revision 6550d01e)
1 /*	$NetBSD: hppa.h,v 1.1 2002/06/05 01:04:25 fredette Exp $	*/
2 
3 /*	$OpenBSD: hppa.h,v 1.4 2001/03/29 03:58:18 mickey Exp $	*/
4 
5 /*
6  * Copyright 1996 1995 by Open Software Foundation, Inc.
7  *              All Rights Reserved
8  *
9  * Permission to use, copy, modify, and distribute this software and
10  * its documentation for any purpose and without fee is hereby granted,
11  * provided that the above copyright notice appears in all copies and
12  * that both the copyright notice and this permission notice appear in
13  * supporting documentation.
14  *
15  * OSF DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
16  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
17  * FOR A PARTICULAR PURPOSE.
18  *
19  * IN NO EVENT SHALL OSF BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
20  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
21  * LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
22  * NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
23  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
24  */
25 /*
26  * pmk1.1
27  */
28 /*
29  * (c) Copyright 1986 HEWLETT-PACKARD COMPANY
30  *
31  * To anyone who acknowledges that this file is provided "AS IS"
32  * without any express or implied warranty:
33  *     permission to use, copy, modify, and distribute this file
34  * for any purpose is hereby granted without fee, provided that
35  * the above copyright notice and this notice appears in all
36  * copies, and that the name of Hewlett-Packard Company not be
37  * used in advertising or publicity pertaining to distribution
38  * of the software without specific, written prior permission.
39  * Hewlett-Packard Company makes no representations about the
40  * suitability of this software for any purpose.
41  */
42 
43 /* amount is assumed to be a constant between 0 and 32 (non-inclusive) */
44 #define Shiftdouble(left,right,amount,dest)			\
45     /* int left, right, amount, dest; */			\
46     dest = ((left) << (32-(amount))) | ((unsigned int)(right) >> (amount))
47 
48 /* amount must be less than 32 */
49 #define Variableshiftdouble(left,right,amount,dest)		\
50     /* unsigned int left, right;  int amount, dest; */		\
51     if (amount == 0) dest = right;				\
52     else dest = ((((unsigned) left)&0x7fffffff) << (32-(amount))) |	\
53 	((unsigned) right >> (amount))
54 
55 /* amount must be between 0 and 32 (non-inclusive) */
56 #define Variable_shift_double(left,right,amount,dest)		\
57     /* unsigned int left, right;  int amount, dest; */		\
58     dest = (left << (32-(amount))) | ((unsigned) right >> (amount))
59