Merged with mainline at revision 128810.
[official-gcc.git] / libdecnumber / dpd / decimal128Local.h
blobb4130b53425a722ab0431fa7f347a73752255ceb
1 /* Local definitions for use with the decNumber C Library.
2 Copyright (C) 2007 Free Software Foundation, Inc.
4 This file is part of GCC.
6 GCC is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 2, or (at your option) any later
9 version.
11 In addition to the permissions in the GNU General Public License,
12 the Free Software Foundation gives you unlimited permission to link
13 the compiled version of this file into combinations with other
14 programs, and to distribute those combinations without any
15 restriction coming from the use of this file. (The General Public
16 License restrictions do apply in other respects; for example, they
17 cover modification of the file, and distribution when not linked
18 into a combine executable.)
20 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
21 WARRANTY; without even the implied warranty of MERCHANTABILITY or
22 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23 for more details.
25 You should have received a copy of the GNU General Public License
26 along with GCC; see the file COPYING. If not, write to the Free
27 Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
28 02110-1301, USA. */
30 #if !defined(DECIMAL128LOCAL)
32 /* The compiler needs sign manipulation functions for decimal128 which
33 are not part of the decNumber package. */
35 /* Set sign; this assumes the sign was previously zero. */
36 #define decimal128SetSign(d,b) \
37 { (d)->bytes[FLOAT_WORDS_BIG_ENDIAN ? 0 : 15] |= ((unsigned) (b) << 7); }
39 /* Clear sign. */
40 #define decimal128ClearSign(d) \
41 { (d)->bytes[FLOAT_WORDS_BIG_ENDIAN ? 0 : 15] &= ~0x80; }
43 /* Flip sign. */
44 #define decimal128FlipSign(d) \
45 { (d)->bytes[FLOAT_WORDS_BIG_ENDIAN ? 0 : 15] ^= 0x80; }
47 #endif