xref: /dflybsd-src/contrib/gdb-7/libdecnumber/dpd/decimal128Local.h (revision de8e141f24382815c10a4012d209bbbf7abf1112)
15796c8dcSSimon Schubert /* Local definitions for use with the decNumber C Library.
2*ef5ccd6cSJohn Marino    Copyright (C) 2007-2013 Free Software Foundation, Inc.
35796c8dcSSimon Schubert 
45796c8dcSSimon Schubert    This file is part of GCC.
55796c8dcSSimon Schubert 
65796c8dcSSimon Schubert    GCC is free software; you can redistribute it and/or modify it under
75796c8dcSSimon Schubert    the terms of the GNU General Public License as published by the Free
85796c8dcSSimon Schubert    Software Foundation; either version 3, or (at your option) any later
95796c8dcSSimon Schubert    version.
105796c8dcSSimon Schubert 
115796c8dcSSimon Schubert    GCC is distributed in the hope that it will be useful, but WITHOUT ANY
125796c8dcSSimon Schubert    WARRANTY; without even the implied warranty of MERCHANTABILITY or
135796c8dcSSimon Schubert    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
145796c8dcSSimon Schubert    for more details.
155796c8dcSSimon Schubert 
165796c8dcSSimon Schubert Under Section 7 of GPL version 3, you are granted additional
175796c8dcSSimon Schubert permissions described in the GCC Runtime Library Exception, version
185796c8dcSSimon Schubert 3.1, as published by the Free Software Foundation.
195796c8dcSSimon Schubert 
205796c8dcSSimon Schubert You should have received a copy of the GNU General Public License and
215796c8dcSSimon Schubert a copy of the GCC Runtime Library Exception along with this program;
225796c8dcSSimon Schubert see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
235796c8dcSSimon Schubert <http://www.gnu.org/licenses/>.  */
245796c8dcSSimon Schubert 
255796c8dcSSimon Schubert #if !defined(DECIMAL128LOCAL)
265796c8dcSSimon Schubert 
275796c8dcSSimon Schubert /* The compiler needs sign manipulation functions for decimal128 which
285796c8dcSSimon Schubert    are not part of the decNumber package.  */
295796c8dcSSimon Schubert 
305796c8dcSSimon Schubert /* Set sign; this assumes the sign was previously zero.  */
315796c8dcSSimon Schubert #define decimal128SetSign(d,b) \
325796c8dcSSimon Schubert   { (d)->bytes[WORDS_BIGENDIAN ? 0 : 15] |= ((unsigned) (b) << 7); }
335796c8dcSSimon Schubert 
345796c8dcSSimon Schubert /* Clear sign.  */
355796c8dcSSimon Schubert #define decimal128ClearSign(d) \
365796c8dcSSimon Schubert   { (d)->bytes[WORDS_BIGENDIAN ? 0 : 15] &= ~0x80; }
375796c8dcSSimon Schubert 
385796c8dcSSimon Schubert /* Flip sign.  */
395796c8dcSSimon Schubert #define decimal128FlipSign(d) \
405796c8dcSSimon Schubert   { (d)->bytes[WORDS_BIGENDIAN ? 0 : 15] ^= 0x80; }
415796c8dcSSimon Schubert 
425796c8dcSSimon Schubert #endif
43