treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / arch / parisc / math-emu / fpbits.h
blobb46bddb9a513b9b36ceee2b2617beac2beb91e85
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3 * Linux/PA-RISC Project (http://www.parisc-linux.org/)
5 * Floating-point emulation code
6 * Copyright (C) 2001 Hewlett-Packard (Paul Bame) <bame@debian.org>
7 */
9 #ifdef __NO_PA_HDRS
10 PA header file -- do not include this header file for non-PA builds.
11 #endif
15 * These macros are designed to be portable to all machines that have
16 * a wordsize greater than or equal to 32 bits that support the portable
17 * C compiler and the standard C preprocessor. Wordsize (default 32)
18 * and bitfield assignment (default left-to-right, unlike VAX, PDP-11)
19 * should be predefined using the constants HOSTWDSZ and BITFRL and
20 * the C compiler "-D" flag (e.g., -DHOSTWDSZ=36 -DBITFLR for the DEC-20).
21 * Note that the macro arguments assume that the integer being referenced
22 * is a 32-bit integer (right-justified on the 20) and that bit 0 is the
23 * most significant bit.
26 #ifndef HOSTWDSZ
27 #define HOSTWDSZ 32
28 #endif
31 /*########################### Macros ######################################*/
33 /*-------------------------------------------------------------------------
34 * NewDeclareBitField_Reference - Declare a structure similar to the simulator
35 * function "DeclBitfR" except its use is restricted to occur within a larger
36 * enclosing structure or union definition. This declaration is an unnamed
37 * structure with the argument, name, as the member name and the argument,
38 * uname, as the element name.
39 *----------------------------------------------------------------------- */
40 #define Bitfield_extract(start, length, object) \
41 ((object) >> (HOSTWDSZ - (start) - (length)) & \
42 ((unsigned)-1 >> (HOSTWDSZ - (length))))
44 #define Bitfield_signed_extract(start, length, object) \
45 ((int)((object) << start) >> (HOSTWDSZ - (length)))
47 #define Bitfield_mask(start, len, object) \
48 ((object) & (((unsigned)-1 >> (HOSTWDSZ-len)) << (HOSTWDSZ-start-len)))
50 #define Bitfield_deposit(value,start,len,object) object = \
51 ((object) & ~(((unsigned)-1 >> (HOSTWDSZ-len)) << (HOSTWDSZ-start-len))) | \
52 (((value) & ((unsigned)-1 >> (HOSTWDSZ-len))) << (HOSTWDSZ-start-len))