3 <meta http-equiv=
"Content-Type" content=
"text/html; charset=US-ASCII">
4 <title>x86 and floating-point env
</title>
5 <link rel=
"stylesheet" href=
"../../../../../../doc/src/boostbook.css" type=
"text/css">
6 <meta name=
"generator" content=
"DocBook XSL Stylesheets V1.75.2">
7 <link rel=
"home" href=
"../../index.html" title=
"Chapter 1. Context">
8 <link rel=
"up" href=
"../rationale.html" title=
"Rationale">
9 <link rel=
"prev" href=
"other_apis_.html" title=
"Other APIs">
10 <link rel=
"next" href=
"../reference.html" title=
"Reference">
12 <body bgcolor=
"white" text=
"black" link=
"#0000FF" vlink=
"#840084" alink=
"#0000FF">
13 <table cellpadding=
"2" width=
"100%"><tr>
14 <td valign=
"top"><img alt=
"Boost C++ Libraries" width=
"277" height=
"86" src=
"../../../../../../boost.png"></td>
15 <td align=
"center"><a href=
"../../../../../../index.html">Home
</a></td>
16 <td align=
"center"><a href=
"../../../../../../libs/libraries.htm">Libraries
</a></td>
17 <td align=
"center"><a href=
"http://www.boost.org/users/people.html">People
</a></td>
18 <td align=
"center"><a href=
"http://www.boost.org/users/faq.html">FAQ
</a></td>
19 <td align=
"center"><a href=
"../../../../../../more/index.htm">More
</a></td>
22 <div class=
"spirit-nav">
23 <a accesskey=
"p" href=
"other_apis_.html"><img src=
"../../../../../../doc/src/images/prev.png" alt=
"Prev"></a><a accesskey=
"u" href=
"../rationale.html"><img src=
"../../../../../../doc/src/images/up.png" alt=
"Up"></a><a accesskey=
"h" href=
"../../index.html"><img src=
"../../../../../../doc/src/images/home.png" alt=
"Home"></a><a accesskey=
"n" href=
"../reference.html"><img src=
"../../../../../../doc/src/images/next.png" alt=
"Next"></a>
26 <div class=
"titlepage"><div><div><h3 class=
"title">
27 <a name=
"context.rationale.x86_and_floating_point_env"></a><a class=
"link" href=
"x86_and_floating_point_env.html" title=
"x86 and floating-point env">x86 and
28 floating-point env
</a>
29 </h3></div></div></div>
31 <a name=
"context.rationale.x86_and_floating_point_env.h0"></a>
32 <span><a name=
"context.rationale.x86_and_floating_point_env.i386"></a></span><a class=
"link" href=
"x86_and_floating_point_env.html#context.rationale.x86_and_floating_point_env.i386">i386
</a>
35 "The FpCsr and the MxCsr register must be saved and restored before
36 any call or return by any procedure that needs to modify them ..."
37 <sup>[
<a name=
"context.rationale.x86_and_floating_point_env.f0" href=
"#ftn.context.rationale.x86_and_floating_point_env.f0" class=
"footnote">4</a>]
</sup>.
40 <a name=
"context.rationale.x86_and_floating_point_env.h1"></a>
41 <span><a name=
"context.rationale.x86_and_floating_point_env.x86_64"></a></span><a class=
"link" href=
"x86_and_floating_point_env.html#context.rationale.x86_and_floating_point_env.x86_64">x86_64
</a>
44 <a name=
"context.rationale.x86_and_floating_point_env.h2"></a>
45 <span><a name=
"context.rationale.x86_and_floating_point_env.windows"></a></span><a class=
"link" href=
"x86_and_floating_point_env.html#context.rationale.x86_and_floating_point_env.windows">Windows
</a>
48 MxCsr -
"A callee that modifies any of the non-volatile fields within
49 MxCsr must restore them before returning to its caller. Furthermore, a caller
50 that has modified any of these fields must restore them to their standard
51 values before invoking a callee ..." <sup>[
<a name=
"context.rationale.x86_and_floating_point_env.f1" href=
"#ftn.context.rationale.x86_and_floating_point_env.f1" class=
"footnote">5</a>]
</sup>.
54 FpCsr -
"A callee that modifies any of the fields within FpCsr must
55 restore them before returning to its caller. Furthermore, a caller that has
56 modified any of these fields must restore them to their standard values before
57 invoking a callee ..." <sup>[
<a name=
"context.rationale.x86_and_floating_point_env.f2" href=
"#ftn.context.rationale.x86_and_floating_point_env.f2" class=
"footnote">6</a>]
</sup>.
60 "The MMX and floating-point stack registers (MM0-MM7/ST0-ST7) are preserved
61 across context switches. There is no explicit calling convention for these
62 registers." <sup>[
<a name=
"context.rationale.x86_and_floating_point_env.f3" href=
"#ftn.context.rationale.x86_and_floating_point_env.f3" class=
"footnote">7</a>]
</sup>.
65 "The 64-bit Microsoft compiler does not use ST(0)-ST(7)/MM0-MM7".
66 <sup>[
<a name=
"context.rationale.x86_and_floating_point_env.f4" href=
"#ftn.context.rationale.x86_and_floating_point_env.f4" class=
"footnote">8</a>]
</sup>.
69 "XMM6-XMM15 must be preserved" <sup>[
<a name=
"context.rationale.x86_and_floating_point_env.f5" href=
"#ftn.context.rationale.x86_and_floating_point_env.f5" class=
"footnote">9</a>]
</sup>
72 <a name=
"context.rationale.x86_and_floating_point_env.h3"></a>
73 <span><a name=
"context.rationale.x86_and_floating_point_env.sysv"></a></span><a class=
"link" href=
"x86_and_floating_point_env.html#context.rationale.x86_and_floating_point_env.sysv">SysV
</a>
76 "The control bits of the MxCsr register are callee-saved (preserved
77 across calls), while the status bits are caller-saved (not preserved). The
78 x87 status word register is caller-saved, whereas the x87 control word (FpCsr)
79 is callee-saved." <sup>[
<a name=
"context.rationale.x86_and_floating_point_env.f6" href=
"#ftn.context.rationale.x86_and_floating_point_env.f6" class=
"footnote">10</a>]
</sup>.
81 <div class=
"footnotes">
82 <br><hr width=
"100" align=
"left">
83 <div class=
"footnote"><p><sup>[
<a name=
"ftn.context.rationale.x86_and_floating_point_env.f0" href=
"#context.rationale.x86_and_floating_point_env.f0" class=
"para">4</a>]
</sup>
84 'Calling Conventions', Agner Fog
86 <div class=
"footnote"><p><sup>[
<a name=
"ftn.context.rationale.x86_and_floating_point_env.f1" href=
"#context.rationale.x86_and_floating_point_env.f1" class=
"para">5</a>]
</sup>
87 <a href=
"http://http://msdn.microsoft.com/en-us/library/yxty7t75.aspx" target=
"_top">MSDN
90 <div class=
"footnote"><p><sup>[
<a name=
"ftn.context.rationale.x86_and_floating_point_env.f2" href=
"#context.rationale.x86_and_floating_point_env.f2" class=
"para">6</a>]
</sup>
91 <a href=
"http://http://msdn.microsoft.com/en-us/library/ms235300.aspx" target=
"_top">MSDN
94 <div class=
"footnote"><p><sup>[
<a name=
"ftn.context.rationale.x86_and_floating_point_env.f3" href=
"#context.rationale.x86_and_floating_point_env.f3" class=
"para">7</a>]
</sup>
95 <a href=
"http://msdn.microsoft.com/en-us/library/a32tsf7t%28VS.80%29.aspx" target=
"_top">MSDN
96 article 'Legacy Floating-Point Support'
</a>
98 <div class=
"footnote"><p><sup>[
<a name=
"ftn.context.rationale.x86_and_floating_point_env.f4" href=
"#context.rationale.x86_and_floating_point_env.f4" class=
"para">8</a>]
</sup>
99 'Calling Conventions', Agner Fog
101 <div class=
"footnote"><p><sup>[
<a name=
"ftn.context.rationale.x86_and_floating_point_env.f5" href=
"#context.rationale.x86_and_floating_point_env.f5" class=
"para">9</a>]
</sup>
102 <a href=
"http://msdn.microsoft.com/en-us/library/9z1stfyw%28v=vs.100%29.aspx" target=
"_top">MSDN
103 article 'Register Usage'
</a>
105 <div class=
"footnote"><p><sup>[
<a name=
"ftn.context.rationale.x86_and_floating_point_env.f6" href=
"#context.rationale.x86_and_floating_point_env.f6" class=
"para">10</a>]
</sup>
106 SysV ABI AMD64 Architecture Processor Supplement Draft Version
0.99.4,
111 <table xmlns:
rev=
"http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width=
"100%"><tr>
112 <td align=
"left"></td>
113 <td align=
"right"><div class=
"copyright-footer">Copyright
© 2014 Oliver Kowalke
<p>
114 Distributed under the Boost Software License, Version
1.0. (See accompanying
115 file LICENSE_1_0.txt or copy at
<a href=
"http://www.boost.org/LICENSE_1_0.txt" target=
"_top">http://www.boost.org/LICENSE_1_0.txt
</a>)
120 <div class=
"spirit-nav">
121 <a accesskey=
"p" href=
"other_apis_.html"><img src=
"../../../../../../doc/src/images/prev.png" alt=
"Prev"></a><a accesskey=
"u" href=
"../rationale.html"><img src=
"../../../../../../doc/src/images/up.png" alt=
"Up"></a><a accesskey=
"h" href=
"../../index.html"><img src=
"../../../../../../doc/src/images/home.png" alt=
"Home"></a><a accesskey=
"n" href=
"../reference.html"><img src=
"../../../../../../doc/src/images/next.png" alt=
"Next"></a>