15796c8dcSSimon Schubert /* Decimal floating point support for GDB. 25796c8dcSSimon Schubert 3*ef5ccd6cSJohn Marino Copyright (C) 2007-2013 Free Software Foundation, Inc. 45796c8dcSSimon Schubert 55796c8dcSSimon Schubert This file is part of GDB. 65796c8dcSSimon Schubert 75796c8dcSSimon Schubert This program is free software; you can redistribute it and/or modify 85796c8dcSSimon Schubert it under the terms of the GNU General Public License as published by 95796c8dcSSimon Schubert the Free Software Foundation; either version 3 of the License, or 105796c8dcSSimon Schubert (at your option) any later version. 115796c8dcSSimon Schubert 125796c8dcSSimon Schubert This program is distributed in the hope that it will be useful, 135796c8dcSSimon Schubert but WITHOUT ANY WARRANTY; without even the implied warranty of 145796c8dcSSimon Schubert MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 155796c8dcSSimon Schubert GNU General Public License for more details. 165796c8dcSSimon Schubert 175796c8dcSSimon Schubert You should have received a copy of the GNU General Public License 185796c8dcSSimon Schubert along with this program. If not, see <http://www.gnu.org/licenses/>. */ 195796c8dcSSimon Schubert 205796c8dcSSimon Schubert /* Decimal floating point is one of the extension to IEEE 754, which is 215796c8dcSSimon Schubert described in http://grouper.ieee.org/groups/754/revision.html and 225796c8dcSSimon Schubert http://www2.hursley.ibm.com/decimal/. It completes binary floating 235796c8dcSSimon Schubert point by representing floating point more exactly. */ 245796c8dcSSimon Schubert 255796c8dcSSimon Schubert #ifndef DFP_H 265796c8dcSSimon Schubert #define DFP_H 275796c8dcSSimon Schubert 285796c8dcSSimon Schubert /* When using decimal128, this is the maximum string length + 1 295796c8dcSSimon Schubert * (value comes from libdecnumber's DECIMAL128_String constant). */ 305796c8dcSSimon Schubert #define MAX_DECIMAL_STRING 43 315796c8dcSSimon Schubert 325796c8dcSSimon Schubert extern void decimal_to_string (const gdb_byte *, int, enum bfd_endian, char *); 33c50c785cSJohn Marino extern int decimal_from_string (gdb_byte *, int, enum bfd_endian, 34c50c785cSJohn Marino const char *); 355796c8dcSSimon Schubert extern void decimal_from_integral (struct value *from, gdb_byte *to, 365796c8dcSSimon Schubert int len, enum bfd_endian byte_order); 375796c8dcSSimon Schubert extern void decimal_from_floating (struct value *from, gdb_byte *to, 385796c8dcSSimon Schubert int len, enum bfd_endian byte_order); 395796c8dcSSimon Schubert extern DOUBLEST decimal_to_doublest (const gdb_byte *from, int len, 405796c8dcSSimon Schubert enum bfd_endian byte_order); 415796c8dcSSimon Schubert extern void decimal_binop (enum exp_opcode, 425796c8dcSSimon Schubert const gdb_byte *, int, enum bfd_endian, 435796c8dcSSimon Schubert const gdb_byte *, int, enum bfd_endian, 445796c8dcSSimon Schubert gdb_byte *, int, enum bfd_endian); 455796c8dcSSimon Schubert extern int decimal_is_zero (const gdb_byte *, int, enum bfd_endian); 465796c8dcSSimon Schubert extern int decimal_compare (const gdb_byte *, int, enum bfd_endian, 475796c8dcSSimon Schubert const gdb_byte *, int, enum bfd_endian); 485796c8dcSSimon Schubert extern void decimal_convert (const gdb_byte *, int, enum bfd_endian, 495796c8dcSSimon Schubert gdb_byte *, int, enum bfd_endian); 505796c8dcSSimon Schubert 515796c8dcSSimon Schubert #endif 52