xref: /openbsd-src/sys/arch/hppa/spmath/hppa.h (revision c2feb25228e11b3c285a2d9400475896f2dd1562)
1*c2feb252Smickey /*	$OpenBSD: hppa.h,v 1.5 2002/05/07 22:19:30 mickey Exp $	*/
28a472b3eSmickey /*
3*c2feb252Smickey   (c) Copyright 1986 HEWLETT-PACKARD COMPANY
4*c2feb252Smickey   To anyone who acknowledges that this file is provided "AS IS"
5*c2feb252Smickey   without any express or implied warranty:
6*c2feb252Smickey       permission to use, copy, modify, and distribute this file
7*c2feb252Smickey   for any purpose is hereby granted without fee, provided that
8*c2feb252Smickey   the above copyright notice and this notice appears in all
9*c2feb252Smickey   copies, and that the name of Hewlett-Packard Company not be
10*c2feb252Smickey   used in advertising or publicity pertaining to distribution
11*c2feb252Smickey   of the software without specific, written prior permission.
12*c2feb252Smickey   Hewlett-Packard Company makes no representations about the
13*c2feb252Smickey   suitability of this software for any purpose.
148a472b3eSmickey */
15*c2feb252Smickey /* @(#)hppa.h: Revision: 2.7.88.1 Date: 93/12/07 15:06:26 */
168a472b3eSmickey 
178a472b3eSmickey /* amount is assumed to be a constant between 0 and 32 (non-inclusive) */
188a472b3eSmickey #define Shiftdouble(left,right,amount,dest)			\
198a472b3eSmickey     /* int left, right, amount, dest; */			\
208a472b3eSmickey     dest = ((left) << (32-(amount))) | ((unsigned int)(right) >> (amount))
218a472b3eSmickey 
228a472b3eSmickey /* amount must be less than 32 */
238a472b3eSmickey #define Variableshiftdouble(left,right,amount,dest)		\
248a472b3eSmickey     /* unsigned int left, right;  int amount, dest; */		\
258a472b3eSmickey     if (amount == 0) dest = right;				\
268a472b3eSmickey     else dest = ((((unsigned) left)&0x7fffffff) << (32-(amount))) |	\
278a472b3eSmickey 	((unsigned) right >> (amount))
288a472b3eSmickey 
298a472b3eSmickey /* amount must be between 0 and 32 (non-inclusive) */
308a472b3eSmickey #define Variable_shift_double(left,right,amount,dest)		\
318a472b3eSmickey     /* unsigned int left, right;  int amount, dest; */		\
328a472b3eSmickey     dest = (left << (32-(amount))) | ((unsigned) right >> (amount))
33