aboutsummaryrefslogtreecommitdiffstats
path: root/docs/LangRef.html
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2009-02-11 22:14:51 +0000
committerDale Johannesen <dalej@apple.com>2009-02-11 22:14:51 +0000
commitf82a52fb5a4bc94c5ad725c74c234da86c5e9063 (patch)
tree64b4b9e35296fa59da3dc93087cb28327b65c4e0 /docs/LangRef.html
parent09d20d62e7a77ccb976a6f315cd10a5b3b30b0b9 (diff)
downloadexternal_llvm-f82a52fb5a4bc94c5ad725c74c234da86c5e9063.zip
external_llvm-f82a52fb5a4bc94c5ad725c74c234da86c5e9063.tar.gz
external_llvm-f82a52fb5a4bc94c5ad725c74c234da86c5e9063.tar.bz2
Edit description of floating point constants to
reflect reality. Acknowledgements to John Clements for prodding me into this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64332 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs/LangRef.html')
-rw-r--r--docs/LangRef.html21
1 files changed, 18 insertions, 3 deletions
diff --git a/docs/LangRef.html b/docs/LangRef.html
index ff71e37..1fbd32b 100644
--- a/docs/LangRef.html
+++ b/docs/LangRef.html
@@ -1760,16 +1760,31 @@ them all and their syntax.</p>
</dl>
-<p>The one non-intuitive notation for constants is the optional hexadecimal form
+<p>The one non-intuitive notation for constants is the hexadecimal form
of floating point constants. For example, the form '<tt>double
0x432ff973cafa8000</tt>' is equivalent to (but harder to read than) '<tt>double
4.5e+15</tt>'. The only time hexadecimal floating point constants are required
(and the only time that they are generated by the disassembler) is when a
floating point constant must be emitted but it cannot be represented as a
-decimal floating point number. For example, NaN's, infinities, and other
+decimal floating point number in a reasonable number of digits. For example,
+NaN's, infinities, and other
special values are represented in their IEEE hexadecimal format so that
assembly and disassembly do not cause any bits to change in the constants.</p>
-
+<p>When using the hexadecimal form, constants of types float and double are
+represented using the 16-digit form shown above (which matches the IEEE754
+representation for double); float values must, however, be exactly representable
+as IEE754 single precision.
+Hexadecimal format is always used for long
+double, and there are three forms of long double. The 80-bit
+format used by x86 is represented as <tt>0xK</tt>
+followed by 20 hexadecimal digits.
+The 128-bit format used by PowerPC (two adjacent doubles) is represented
+by <tt>0xM</tt> followed by 32 hexadecimal digits. The IEEE 128-bit
+format is represented
+by <tt>0xL</tt> followed by 32 hexadecimal digits; no currently supported
+target uses this format. Long doubles will only work if they match
+the long double format on your target. All hexadecimal formats are big-endian
+(sign bit at the left).</p>
</div>
<!-- ======================================================================= -->