blob: 9ef6d393014b612d71f782d9de5060fcc7865785 [file] [log] [blame]
<html lang="en">
<head>
<title>Decimal Floating Point - Debugging with GDB</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Debugging with GDB">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="C.html#C" title="C">
<link rel="prev" href="Debugging-C-Plus-Plus.html#Debugging-C-Plus-Plus" title="Debugging C Plus Plus">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
Copyright (C) 1988-2019 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being ``Free Software'' and ``Free Software Needs
Free Documentation'', with the Front-Cover Texts being ``A GNU Manual,''
and with the Back-Cover Texts as in (a) below.
(a) The FSF's Back-Cover Text is: ``You are free to copy and modify
this GNU Manual. Buying copies from GNU Press supports the FSF in
developing GNU and promoting software freedom.''
-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
</head>
<body>
<div class="node">
<a name="Decimal-Floating-Point"></a>
<p>
Previous:&nbsp;<a rel="previous" accesskey="p" href="Debugging-C-Plus-Plus.html#Debugging-C-Plus-Plus">Debugging C Plus Plus</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="C.html#C">C</a>
<hr>
</div>
<h5 class="subsubsection">15.4.1.8 Decimal Floating Point format</h5>
<p><a name="index-decimal-floating-point-format-1012"></a>
<span class="sc">gdb</span> can examine, set and perform computations with numbers in
decimal floating point format, which in the C language correspond to the
<code>_Decimal32</code>, <code>_Decimal64</code> and <code>_Decimal128</code> types as
specified by the extension to support decimal floating-point arithmetic.
<p>There are two encodings in use, depending on the architecture: BID (Binary
Integer Decimal) for x86 and x86-64, and DPD (Densely Packed Decimal) for
PowerPC and S/390. <span class="sc">gdb</span> will use the appropriate encoding for the
configured target.
<p>Because of a limitation in <samp><span class="file">libdecnumber</span></samp>, the library used by <span class="sc">gdb</span>
to manipulate decimal floating point numbers, it is not possible to convert
(using a cast, for example) integers wider than 32-bit to decimal float.
<p>In addition, in order to imitate <span class="sc">gdb</span>'s behaviour with binary floating
point computations, error checking in decimal float operations ignores
underflow, overflow and divide by zero exceptions.
<p>In the PowerPC architecture, <span class="sc">gdb</span> provides a set of pseudo-registers
to inspect <code>_Decimal128</code> values stored in floating point registers.
See <a href="PowerPC.html#PowerPC">PowerPC</a> for more details.
</body></html>