<html lang="en">
<head>
<title>i386-Float - Using as</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Using as">
<meta name="generator" content="makeinfo 4.8">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="i386_002dDependent.html#i386_002dDependent" title="i386-Dependent">
<link rel="prev" href="i386_002dJumps.html#i386_002dJumps" title="i386-Jumps">
<link rel="next" href="i386_002dSIMD.html#i386_002dSIMD" title="i386-SIMD">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
@import url("../raisonance.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">
<p>
<a name="i386-Float"></a>
<a name="i386_002dFloat"></a>
Next:&nbsp;<a rel="next" accesskey="n" href="i386_002dSIMD.html#i386_002dSIMD">i386-SIMD</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="i386_002dJumps.html#i386_002dJumps">i386-Jumps</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="i386_002dDependent.html#i386_002dDependent">i386-Dependent</a>
<hr>
</div>

<h4 class="subsection">8.11.8 Floating Point</h4>

<p><a name="index-i386-floating-point-869"></a><a name="index-floating-point_002c-i386-870"></a><a name="index-x86_002d64-floating-point-871"></a><a name="index-floating-point_002c-x86_002d64-872"></a>All 80387 floating point types except packed BCD are supported. 
(BCD support may be added without much difficulty).  These data
types are 16-, 32-, and 64- bit integers, and single (32-bit),
double (64-bit), and extended (80-bit) precision floating point. 
Each supported type has an instruction mnemonic suffix and a constructor
associated with it.  Instruction mnemonic suffixes specify the operand's
data type.  Constructors build these data types into memory.

   <p><a name="index-g_t_0040code_007bfloat_007d-directive_002c-i386-873"></a><a name="index-g_t_0040code_007bsingle_007d-directive_002c-i386-874"></a><a name="index-g_t_0040code_007bdouble_007d-directive_002c-i386-875"></a><a name="index-g_t_0040code_007btfloat_007d-directive_002c-i386-876"></a><a name="index-g_t_0040code_007bfloat_007d-directive_002c-x86_002d64-877"></a><a name="index-g_t_0040code_007bsingle_007d-directive_002c-x86_002d64-878"></a><a name="index-g_t_0040code_007bdouble_007d-directive_002c-x86_002d64-879"></a><a name="index-g_t_0040code_007btfloat_007d-directive_002c-x86_002d64-880"></a>
     <ul>
<li>Floating point constructors are `<samp><span class="samp">.float</span></samp>' or `<samp><span class="samp">.single</span></samp>',
`<samp><span class="samp">.double</span></samp>', and `<samp><span class="samp">.tfloat</span></samp>' for 32-, 64-, and 80-bit formats. 
These correspond to instruction mnemonic suffixes `<samp><span class="samp">s</span></samp>', `<samp><span class="samp">l</span></samp>',
and `<samp><span class="samp">t</span></samp>'. `<samp><span class="samp">t</span></samp>' stands for 80-bit (ten byte) real.  The 80387
only supports this format via the `<samp><span class="samp">fldt</span></samp>' (load 80-bit real to stack
top) and `<samp><span class="samp">fstpt</span></samp>' (store 80-bit real and pop stack) instructions.

     <p><a name="index-g_t_0040code_007bword_007d-directive_002c-i386-881"></a><a name="index-g_t_0040code_007blong_007d-directive_002c-i386-882"></a><a name="index-g_t_0040code_007bint_007d-directive_002c-i386-883"></a><a name="index-g_t_0040code_007bquad_007d-directive_002c-i386-884"></a><a name="index-g_t_0040code_007bword_007d-directive_002c-x86_002d64-885"></a><a name="index-g_t_0040code_007blong_007d-directive_002c-x86_002d64-886"></a><a name="index-g_t_0040code_007bint_007d-directive_002c-x86_002d64-887"></a><a name="index-g_t_0040code_007bquad_007d-directive_002c-x86_002d64-888"></a><li>Integer constructors are `<samp><span class="samp">.word</span></samp>', `<samp><span class="samp">.long</span></samp>' or `<samp><span class="samp">.int</span></samp>', and
`<samp><span class="samp">.quad</span></samp>' for the 16-, 32-, and 64-bit integer formats.  The
corresponding instruction mnemonic suffixes are `<samp><span class="samp">s</span></samp>' (single),
`<samp><span class="samp">l</span></samp>' (long), and `<samp><span class="samp">q</span></samp>' (quad).  As with the 80-bit real format,
the 64-bit `<samp><span class="samp">q</span></samp>' format is only present in the `<samp><span class="samp">fildq</span></samp>' (load
quad integer to stack top) and `<samp><span class="samp">fistpq</span></samp>' (store quad integer and pop
stack) instructions. 
</ul>

   <p>Register to register operations should not use instruction mnemonic suffixes. 
`<samp><span class="samp">fstl %st, %st(1)</span></samp>' will give a warning, and be assembled as if you
wrote `<samp><span class="samp">fst %st, %st(1)</span></samp>', since all register to register operations
use 80-bit floating point operands. (Contrast this with `<samp><span class="samp">fstl %st, mem</span></samp>',
which converts `<samp><span class="samp">%st</span></samp>' from 80-bit to 64-bit floating point format,
then stores the result in the 4 byte location `<samp><span class="samp">mem</span></samp>')

   </body></html>

