162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * Linux/PA-RISC Project (http://www.parisc-linux.org/)
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci * Floating-point emulation code
662306a36Sopenharmony_ci *  Copyright (C) 2001 Hewlett-Packard (Paul Bame) <bame@debian.org>
762306a36Sopenharmony_ci */
862306a36Sopenharmony_ci
962306a36Sopenharmony_ci#ifdef __NO_PA_HDRS
1062306a36Sopenharmony_ci    PA header file -- do not include this header file for non-PA builds.
1162306a36Sopenharmony_ci#endif
1262306a36Sopenharmony_ci
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_ci/* amount is assumed to be a constant between 0 and 32 (non-inclusive) */
1562306a36Sopenharmony_ci#define Shiftdouble(left,right,amount,dest)			\
1662306a36Sopenharmony_ci    /* int left, right, amount, dest; */			\
1762306a36Sopenharmony_ci    dest = ((left) << (32-(amount))) | ((unsigned int)(right) >> (amount))
1862306a36Sopenharmony_ci
1962306a36Sopenharmony_ci/* amount must be less than 32 */
2062306a36Sopenharmony_ci#define Variableshiftdouble(left,right,amount,dest)		\
2162306a36Sopenharmony_ci    /* unsigned int left, right;  int amount, dest; */		\
2262306a36Sopenharmony_ci    if (amount == 0) dest = right;				\
2362306a36Sopenharmony_ci    else dest = ((((unsigned) left)&0x7fffffff) << (32-(amount))) |	\
2462306a36Sopenharmony_ci          ((unsigned) right >> (amount))
2562306a36Sopenharmony_ci
2662306a36Sopenharmony_ci/* amount must be between 0 and 32 (non-inclusive) */
2762306a36Sopenharmony_ci#define Variable_shift_double(left,right,amount,dest)		\
2862306a36Sopenharmony_ci    /* unsigned int left, right;  int amount, dest; */		\
2962306a36Sopenharmony_ci    dest = (left << (32-(amount))) | ((unsigned) right >> (amount))
30