blob: 2db4471b282385fc3014cd0ae8bf34b771280bc0 [file] [log] [blame]
Fuad Tabba77c0d542020-09-23 15:16:37 +01001<html lang="en">
2<head>
3<title>Bundle directives - Using as</title>
4<meta http-equiv="Content-Type" content="text/html">
5<meta name="description" content="Using as">
6<meta name="generator" content="makeinfo 4.13">
7<link title="Top" rel="start" href="index.html#Top">
8<link rel="up" href="Pseudo-Ops.html#Pseudo-Ops" title="Pseudo Ops">
9<link rel="prev" href="Balign.html#Balign" title="Balign">
10<link rel="next" href="Byte.html#Byte" title="Byte">
11<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
12<!--
13This file documents the GNU Assembler "as".
14
15Copyright (C) 1991-2019 Free Software Foundation, Inc.
16
17Permission is granted to copy, distribute and/or modify this document
18under the terms of the GNU Free Documentation License, Version 1.3
19or any later version published by the Free Software Foundation;
20with no Invariant Sections, with no Front-Cover Texts, and with no
21Back-Cover Texts. A copy of the license is included in the
22section entitled ``GNU Free Documentation License''.
23
24-->
25<meta http-equiv="Content-Style-Type" content="text/css">
26<style type="text/css"><!--
27 pre.display { font-family:inherit }
28 pre.format { font-family:inherit }
29 pre.smalldisplay { font-family:inherit; font-size:smaller }
30 pre.smallformat { font-family:inherit; font-size:smaller }
31 pre.smallexample { font-size:smaller }
32 pre.smalllisp { font-size:smaller }
33 span.sc { font-variant:small-caps }
34 span.roman { font-family:serif; font-weight:normal; }
35 span.sansserif { font-family:sans-serif; font-weight:normal; }
36--></style>
37</head>
38<body>
39<div class="node">
40<a name="Bundle-directives"></a>
41<p>
42Next:&nbsp;<a rel="next" accesskey="n" href="Byte.html#Byte">Byte</a>,
43Previous:&nbsp;<a rel="previous" accesskey="p" href="Balign.html#Balign">Balign</a>,
44Up:&nbsp;<a rel="up" accesskey="u" href="Pseudo-Ops.html#Pseudo-Ops">Pseudo Ops</a>
45<hr>
46</div>
47
48<h3 class="section">7.8 Bundle directives</h3>
49
50<h4 class="subsection">7.8.1 <code>.bundle_align_mode </code><var>abs-expr</var></h4>
51
52<p><a name="index-g_t_0040code_007bbundle_005falign_005fmode_007d-directive-292"></a><a name="index-bundle-293"></a><a name="index-instruction-bundle-294"></a><a name="index-aligned-instruction-bundle-295"></a><code>.bundle_align_mode</code> enables or disables <dfn>aligned instruction
53bundle</dfn> mode. In this mode, sequences of adjacent instructions are grouped
54into fixed-sized <dfn>bundles</dfn>. If the argument is zero, this mode is
55disabled (which is the default state). If the argument it not zero, it
56gives the size of an instruction bundle as a power of two (as for the
57<code>.p2align</code> directive, see <a href="P2align.html#P2align">P2align</a>).
58
59 <p>For some targets, it's an ABI requirement that no instruction may span a
60certain aligned boundary. A <dfn>bundle</dfn> is simply a sequence of
61instructions that starts on an aligned boundary. For example, if
62<var>abs-expr</var> is <code>5</code> then the bundle size is 32, so each aligned
63chunk of 32 bytes is a bundle. When aligned instruction bundle mode is in
64effect, no single instruction may span a boundary between bundles. If an
65instruction would start too close to the end of a bundle for the length of
66that particular instruction to fit within the bundle, then the space at the
67end of that bundle is filled with no-op instructions so the instruction
68starts in the next bundle. As a corollary, it's an error if any single
69instruction's encoding is longer than the bundle size.
70
71<h4 class="subsection">7.8.2 <code>.bundle_lock</code> and <code>.bundle_unlock</code></h4>
72
73<p><a name="index-g_t_0040code_007bbundle_005flock_007d-directive-296"></a><a name="index-g_t_0040code_007bbundle_005funlock_007d-directive-297"></a>The <code>.bundle_lock</code> and directive <code>.bundle_unlock</code> directives
74allow explicit control over instruction bundle padding. These directives
75are only valid when <code>.bundle_align_mode</code> has been used to enable
76aligned instruction bundle mode. It's an error if they appear when
77<code>.bundle_align_mode</code> has not been used at all, or when the last
78directive was <code>.bundle_align_mode&nbsp;0</code><!-- /@w -->.
79
80 <p><a name="index-bundle_002dlocked-298"></a>For some targets, it's an ABI requirement that certain instructions may
81appear only as part of specified permissible sequences of multiple
82instructions, all within the same bundle. A pair of <code>.bundle_lock</code>
83and <code>.bundle_unlock</code> directives define a <dfn>bundle-locked</dfn>
84instruction sequence. For purposes of aligned instruction bundle mode, a
85sequence starting with <code>.bundle_lock</code> and ending with
86<code>.bundle_unlock</code> is treated as a single instruction. That is, the
87entire sequence must fit into a single bundle and may not span a bundle
88boundary. If necessary, no-op instructions will be inserted before the
89first instruction of the sequence so that the whole sequence starts on an
90aligned bundle boundary. It's an error if the sequence is longer than the
91bundle size.
92
93 <p>For convenience when using <code>.bundle_lock</code> and <code>.bundle_unlock</code>
94inside assembler macros (see <a href="Macro.html#Macro">Macro</a>), bundle-locked sequences may be
95nested. That is, a second <code>.bundle_lock</code> directive before the next
96<code>.bundle_unlock</code> directive has no effect except that it must be
97matched by another closing <code>.bundle_unlock</code> so that there is the
98same number of <code>.bundle_lock</code> and <code>.bundle_unlock</code> directives.
99
100 </body></html>
101