i386_002dFloat.html 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- This file documents the GNU Assembler "as".
  4. Copyright (C) 1991-2017 Free Software Foundation, Inc.
  5. Permission is granted to copy, distribute and/or modify this document
  6. under the terms of the GNU Free Documentation License, Version 1.3
  7. or any later version published by the Free Software Foundation;
  8. with no Invariant Sections, with no Front-Cover Texts, and with no
  9. Back-Cover Texts. A copy of the license is included in the
  10. section entitled "GNU Free Documentation License".
  11. -->
  12. <!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
  13. <head>
  14. <title>Using as: i386-Float</title>
  15. <meta name="description" content="Using as: i386-Float">
  16. <meta name="keywords" content="Using as: i386-Float">
  17. <meta name="resource-type" content="document">
  18. <meta name="distribution" content="global">
  19. <meta name="Generator" content="makeinfo">
  20. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  21. <link href="index.html#Top" rel="start" title="Top">
  22. <link href="AS-Index.html#AS-Index" rel="index" title="AS Index">
  23. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  24. <link href="i386_002dDependent.html#i386_002dDependent" rel="up" title="i386-Dependent">
  25. <link href="i386_002dSIMD.html#i386_002dSIMD" rel="next" title="i386-SIMD">
  26. <link href="i386_002dJumps.html#i386_002dJumps" rel="prev" title="i386-Jumps">
  27. <style type="text/css">
  28. <!--
  29. a.summary-letter {text-decoration: none}
  30. blockquote.smallquotation {font-size: smaller}
  31. div.display {margin-left: 3.2em}
  32. div.example {margin-left: 3.2em}
  33. div.indentedblock {margin-left: 3.2em}
  34. div.lisp {margin-left: 3.2em}
  35. div.smalldisplay {margin-left: 3.2em}
  36. div.smallexample {margin-left: 3.2em}
  37. div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
  38. div.smalllisp {margin-left: 3.2em}
  39. kbd {font-style:oblique}
  40. pre.display {font-family: inherit}
  41. pre.format {font-family: inherit}
  42. pre.menu-comment {font-family: serif}
  43. pre.menu-preformatted {font-family: serif}
  44. pre.smalldisplay {font-family: inherit; font-size: smaller}
  45. pre.smallexample {font-size: smaller}
  46. pre.smallformat {font-family: inherit; font-size: smaller}
  47. pre.smalllisp {font-size: smaller}
  48. span.nocodebreak {white-space:nowrap}
  49. span.nolinebreak {white-space:nowrap}
  50. span.roman {font-family:serif; font-weight:normal}
  51. span.sansserif {font-family:sans-serif; font-weight:normal}
  52. ul.no-bullet {list-style: none}
  53. -->
  54. </style>
  55. </head>
  56. <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
  57. <a name="i386_002dFloat"></a>
  58. <div class="header">
  59. <p>
  60. Next: <a href="i386_002dSIMD.html#i386_002dSIMD" accesskey="n" rel="next">i386-SIMD</a>, Previous: <a href="i386_002dJumps.html#i386_002dJumps" accesskey="p" rel="prev">i386-Jumps</a>, Up: <a href="i386_002dDependent.html#i386_002dDependent" accesskey="u" rel="up">i386-Dependent</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="AS-Index.html#AS-Index" title="Index" rel="index">Index</a>]</p>
  61. </div>
  62. <hr>
  63. <a name="Floating-Point-8"></a>
  64. <h4 class="subsection">9.15.9 Floating Point</h4>
  65. <a name="index-i386-floating-point"></a>
  66. <a name="index-floating-point_002c-i386"></a>
  67. <a name="index-x86_002d64-floating-point"></a>
  68. <a name="index-floating-point_002c-x86_002d64"></a>
  69. <p>All 80387 floating point types except packed BCD are supported.
  70. (BCD support may be added without much difficulty). These data
  71. types are 16-, 32-, and 64- bit integers, and single (32-bit),
  72. double (64-bit), and extended (80-bit) precision floating point.
  73. Each supported type has an instruction mnemonic suffix and a constructor
  74. associated with it. Instruction mnemonic suffixes specify the operand&rsquo;s
  75. data type. Constructors build these data types into memory.
  76. </p>
  77. <a name="index-float-directive_002c-i386"></a>
  78. <a name="index-single-directive_002c-i386"></a>
  79. <a name="index-double-directive_002c-i386"></a>
  80. <a name="index-tfloat-directive_002c-i386"></a>
  81. <a name="index-float-directive_002c-x86_002d64"></a>
  82. <a name="index-single-directive_002c-x86_002d64"></a>
  83. <a name="index-double-directive_002c-x86_002d64"></a>
  84. <a name="index-tfloat-directive_002c-x86_002d64"></a>
  85. <ul>
  86. <li> Floating point constructors are &lsquo;<samp>.float</samp>&rsquo; or &lsquo;<samp>.single</samp>&rsquo;,
  87. &lsquo;<samp>.double</samp>&rsquo;, and &lsquo;<samp>.tfloat</samp>&rsquo; for 32-, 64-, and 80-bit formats.
  88. These correspond to instruction mnemonic suffixes &lsquo;<samp>s</samp>&rsquo;, &lsquo;<samp>l</samp>&rsquo;,
  89. and &lsquo;<samp>t</samp>&rsquo;. &lsquo;<samp>t</samp>&rsquo; stands for 80-bit (ten byte) real. The 80387
  90. only supports this format via the &lsquo;<samp>fldt</samp>&rsquo; (load 80-bit real to stack
  91. top) and &lsquo;<samp>fstpt</samp>&rsquo; (store 80-bit real and pop stack) instructions.
  92. </li><li> <a name="index-word-directive_002c-i386"></a>
  93. <a name="index-long-directive_002c-i386"></a>
  94. <a name="index-int-directive_002c-i386"></a>
  95. <a name="index-quad-directive_002c-i386"></a>
  96. <a name="index-word-directive_002c-x86_002d64"></a>
  97. <a name="index-long-directive_002c-x86_002d64"></a>
  98. <a name="index-int-directive_002c-x86_002d64"></a>
  99. <a name="index-quad-directive_002c-x86_002d64"></a>
  100. Integer constructors are &lsquo;<samp>.word</samp>&rsquo;, &lsquo;<samp>.long</samp>&rsquo; or &lsquo;<samp>.int</samp>&rsquo;, and
  101. &lsquo;<samp>.quad</samp>&rsquo; for the 16-, 32-, and 64-bit integer formats. The
  102. corresponding instruction mnemonic suffixes are &lsquo;<samp>s</samp>&rsquo; (single),
  103. &lsquo;<samp>l</samp>&rsquo; (long), and &lsquo;<samp>q</samp>&rsquo; (quad). As with the 80-bit real format,
  104. the 64-bit &lsquo;<samp>q</samp>&rsquo; format is only present in the &lsquo;<samp>fildq</samp>&rsquo; (load
  105. quad integer to stack top) and &lsquo;<samp>fistpq</samp>&rsquo; (store quad integer and pop
  106. stack) instructions.
  107. </li></ul>
  108. <p>Register to register operations should not use instruction mnemonic suffixes.
  109. &lsquo;<samp>fstl %st, %st(1)</samp>&rsquo; will give a warning, and be assembled as if you
  110. wrote &lsquo;<samp>fst %st, %st(1)</samp>&rsquo;, since all register to register operations
  111. use 80-bit floating point operands. (Contrast this with &lsquo;<samp>fstl %st, mem</samp>&rsquo;,
  112. which converts &lsquo;<samp>%st</samp>&rsquo; from 80-bit to 64-bit floating point format,
  113. then stores the result in the 4 byte location &lsquo;<samp>mem</samp>&rsquo;)
  114. </p>
  115. <hr>
  116. <div class="header">
  117. <p>
  118. Next: <a href="i386_002dSIMD.html#i386_002dSIMD" accesskey="n" rel="next">i386-SIMD</a>, Previous: <a href="i386_002dJumps.html#i386_002dJumps" accesskey="p" rel="prev">i386-Jumps</a>, Up: <a href="i386_002dDependent.html#i386_002dDependent" accesskey="u" rel="up">i386-Dependent</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="AS-Index.html#AS-Index" title="Index" rel="index">Index</a>]</p>
  119. </div>
  120. </body>
  121. </html>