comparison Lib/fftw-3.2.1/doc/html/.svn/text-base/Stack-alignment-on-x86.html.svn-base @ 15:585caf503ef5 tip

Tidy up for ROLI
author Geogaddi\David <d.m.ronan@qmul.ac.uk>
date Tue, 17 May 2016 18:50:19 +0100
parents 636c989477e7
children
comparison
equal deleted inserted replaced
14:636c989477e7 15:585caf503ef5
1 <html lang="en">
2 <head>
3 <title>Stack alignment on x86 - FFTW 3.2.1</title>
4 <meta http-equiv="Content-Type" content="text/html">
5 <meta name="description" content="FFTW 3.2.1">
6 <meta name="generator" content="makeinfo 4.8">
7 <link title="Top" rel="start" href="index.html#Top">
8 <link rel="up" href="Data-Alignment.html#Data-Alignment" title="Data Alignment">
9 <link rel="prev" href="SIMD-alignment-and-fftw_005fmalloc.html#SIMD-alignment-and-fftw_005fmalloc" title="SIMD alignment and fftw_malloc">
10 <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
11 <!--
12 This manual is for FFTW
13 (version 3.2.1, 5 February 2009).
14
15 Copyright (C) 2003 Matteo Frigo.
16
17 Copyright (C) 2003 Massachusetts Institute of Technology.
18
19 Permission is granted to make and distribute verbatim copies of
20 this manual provided the copyright notice and this permission
21 notice are preserved on all copies.
22
23 Permission is granted to copy and distribute modified versions of
24 this manual under the conditions for verbatim copying, provided
25 that the entire resulting derived work is distributed under the
26 terms of a permission notice identical to this one.
27
28 Permission is granted to copy and distribute translations of this
29 manual into another language, under the above conditions for
30 modified versions, except that this permission notice may be
31 stated in a translation approved by the Free Software Foundation.
32 -->
33 <meta http-equiv="Content-Style-Type" content="text/css">
34 <style type="text/css"><!--
35 pre.display { font-family:inherit }
36 pre.format { font-family:inherit }
37 pre.smalldisplay { font-family:inherit; font-size:smaller }
38 pre.smallformat { font-family:inherit; font-size:smaller }
39 pre.smallexample { font-size:smaller }
40 pre.smalllisp { font-size:smaller }
41 span.sc { font-variant:small-caps }
42 span.roman { font-family:serif; font-weight:normal; }
43 span.sansserif { font-family:sans-serif; font-weight:normal; }
44 --></style>
45 </head>
46 <body>
47 <div class="node">
48 <p>
49 <a name="Stack-alignment-on-x86"></a>
50 Previous:&nbsp;<a rel="previous" accesskey="p" href="SIMD-alignment-and-fftw_005fmalloc.html#SIMD-alignment-and-fftw_005fmalloc">SIMD alignment and fftw_malloc</a>,
51 Up:&nbsp;<a rel="up" accesskey="u" href="Data-Alignment.html#Data-Alignment">Data Alignment</a>
52 <hr>
53 </div>
54
55 <h4 class="subsection">3.1.2 Stack alignment on x86</h4>
56
57 <p>On the Pentium and subsequent x86 processors, there is a substantial
58 performance penalty if double-precision variables are not stored
59 8-byte aligned; a factor of two or more is not unusual.
60 Unfortunately, the stack (the place that local variables and
61 subroutine arguments live) is not guaranteed by the Intel ABI to be
62 8-byte aligned.
63
64 <p>Recent versions of <code>gcc</code> (as well as most other compilers, we are
65 told, such as Intel's, Metrowerks', and Microsoft's) are able to keep
66 the stack 8-byte aligned; <code>gcc</code> does this by default (see
67 <code>-mpreferred-stack-boundary</code> in the <code>gcc</code> documentation).
68 If you are not certain whether your compiler maintains stack alignment
69 by default, it is a good idea to make sure.
70
71 <p>Unfortunately, <code>gcc</code> only <em>preserves</em> the stack
72 alignment&mdash;as a result, if the stack starts off misaligned, it will
73 always be misaligned, with a disastrous effect on performance (in
74 double precision). To prevent this, FFTW includes hacks to align its
75 own stack if necessary, so it should perform well even if you call it
76 from a program with a misaligned stack. Currently, our hacks support
77 <code>gcc</code> and the Intel C compiler; if you use another compiler you
78 are on your own. Fortunately, recent versions of glibc (on GNU/Linux)
79 provide a properly-aligned starting stack, but this was not the case
80 with a number of older versions, and we are not certain of the
81 situation on other operating systems. Hopefully, as time goes by this
82 will become less of a concern.
83
84 <!-- -->
85 </body></html>
86