xref: /linux/arch/parisc/math-emu/hppa.h (revision a06c3fad49a50d5d5eb078f93e70f4d3eca5d5a5)
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3  * Linux/PA-RISC Project (http://www.parisc-linux.org/)
4  *
5  * Floating-point emulation code
6  *  Copyright (C) 2001 Hewlett-Packard (Paul Bame) <bame@debian.org>
7  */
8 
9 #ifdef __NO_PA_HDRS
10     PA header file -- do not include this header file for non-PA builds.
11 #endif
12 
13 
14 /* amount is assumed to be a constant between 0 and 32 (non-inclusive) */
15 #define Shiftdouble(left,right,amount,dest)			\
16     /* int left, right, amount, dest; */			\
17     dest = ((left) << (32-(amount))) | ((unsigned int)(right) >> (amount))
18 
19 /* amount must be less than 32 */
20 #define Variableshiftdouble(left,right,amount,dest)		\
21     /* unsigned int left, right;  int amount, dest; */		\
22     if (amount == 0) dest = right;				\
23     else dest = ((((unsigned) left)&0x7fffffff) << (32-(amount))) |	\
24           ((unsigned) right >> (amount))
25 
26 /* amount must be between 0 and 32 (non-inclusive) */
27 #define Variable_shift_double(left,right,amount,dest)		\
28     /* unsigned int left, right;  int amount, dest; */		\
29     dest = (left << (32-(amount))) | ((unsigned) right >> (amount))
30