kernel - Handle spinlock indefinite wait edge case
[dragonfly.git] / contrib / binutils-2.27 / gas / doc / c-tilepro.texi
blob219d04e332dfd8816b113acfbd6225ec2ee22809
1 @c Copyright (C) 2011-2016 Free Software Foundation, Inc.
2 @c This is part of the GAS manual.
3 @c For copying conditions, see the file as.texinfo.
4 @ifset GENERIC
5 @page
6 @node TILEPro-Dependent
7 @chapter TILEPro Dependent Features
8 @end ifset
9 @ifclear GENERIC
10 @node Machine Dependencies
11 @chapter TILEPro Dependent Features
12 @end ifclear
14 @cindex TILEPro support
15 @menu
16 * TILEPro Options::             TILEPro Options
17 * TILEPro Syntax::              TILEPro Syntax
18 * TILEPro Directives::          TILEPro Directives
19 @end menu
21 @node TILEPro Options
22 @section Options
24 @code{@value{AS}} has no machine-dependent command-line options for
25 TILEPro.
27 @node TILEPro Syntax
28 @section Syntax
29 @cindex TILEPro syntax
30 @cindex syntax, TILEPro
32 Block comments are delimited by @samp{/*} and @samp{*/}.  End of line
33 comments may be introduced by @samp{#}.
35 Instructions consist of a leading opcode or macro name followed by
36 whitespace and an optional comma-separated list of operands:
38 @smallexample
39 @var{opcode} [@var{operand}, @dots{}]
40 @end smallexample
42 Instructions must be separated by a newline or semicolon.
44 There are two ways to write code: either write naked instructions,
45 which the assembler is free to combine into VLIW bundles, or specify
46 the VLIW bundles explicitly.
48 Bundles are specified using curly braces:
50 @smallexample
51 @{ @var{add} r3,r4,r5 ; @var{add} r7,r8,r9 ; @var{lw} r10,r11 @}
52 @end smallexample
54 A bundle can span multiple lines. If you want to put multiple
55 instructions on a line, whether in a bundle or not, you need to
56 separate them with semicolons as in this example.
58 A bundle may contain one or more instructions, up to the limit
59 specified by the ISA (currently three). If fewer instructions are
60 specified than the hardware supports in a bundle, the assembler
61 inserts @code{fnop} instructions automatically.
63 The assembler will prefer to preserve the ordering of instructions
64 within the bundle, putting the first instruction in a lower-numbered
65 pipeline than the next one, etc.  This fact, combined with the
66 optional use of explicit @code{fnop} or @code{nop} instructions,
67 allows precise control over which pipeline executes each instruction.
69 If the instructions cannot be bundled in the listed order, the
70 assembler will automatically try to find a valid pipeline
71 assignment. If there is no way to bundle the instructions together,
72 the assembler reports an error.
74 The assembler does not yet auto-bundle (automatically combine multiple
75 instructions into one bundle), but it reserves the right to do so in
76 the future.  If you want to force an instruction to run by itself, put
77 it in a bundle explicitly with curly braces and use @code{nop}
78 instructions (not @code{fnop}) to fill the remaining pipeline slots in
79 that bundle.
81 @menu
82 * TILEPro Opcodes::              Opcode Naming Conventions.
83 * TILEPro Registers::            Register Naming.
84 * TILEPro Modifiers::            Symbolic Operand Modifiers.
85 @end menu
87 @node TILEPro Opcodes
88 @subsection Opcode Names
89 @cindex TILEPro opcode names
90 @cindex opcode names, TILEPro
92 For a complete list of opcodes and descriptions of their semantics,
93 see @cite{TILE Processor User Architecture Manual}, available upon
94 request at www.tilera.com.
96 @node TILEPro Registers
97 @subsection Register Names
98 @cindex TILEPro register names
99 @cindex register names, TILEPro
101 General-purpose registers are represented by predefined symbols of the
102 form @samp{r@var{N}}, where @var{N} represents a number between
103 @code{0} and @code{63}.  However, the following registers have
104 canonical names that must be used instead:
106 @table @code
107 @item r54
110 @item r55
113 @item r56
116 @item r57
117 idn0
119 @item r58
120 idn1
122 @item r59
123 udn0
125 @item r60
126 udn1
128 @item r61
129 udn2
131 @item r62
132 udn3
134 @item r63
135 zero
137 @end table
139 The assembler will emit a warning if a numeric name is used instead of
140 the canonical name.  The @code{.no_require_canonical_reg_names}
141 assembler pseudo-op turns off this
142 warning. @code{.require_canonical_reg_names} turns it back on.
144 @node TILEPro Modifiers
145 @subsection Symbolic Operand Modifiers
146 @cindex TILEPro modifiers
147 @cindex symbol modifiers, TILEPro
149 The assembler supports several modifiers when using symbol addresses
150 in TILEPro instruction operands.  The general syntax is the following:
152 @smallexample
153 modifier(symbol)
154 @end smallexample
156 The following modifiers are supported:
158 @table @code
160 @item lo16
162 This modifier is used to load the low 16 bits of the symbol's address,
163 sign-extended to a 32-bit value (sign-extension allows it to be
164 range-checked against signed 16 bit immediate operands without
165 complaint).
167 @item hi16
169 This modifier is used to load the high 16 bits of the symbol's
170 address, also sign-extended to a 32-bit value.
172 @item ha16
174 @code{ha16(N)} is identical to @code{hi16(N)}, except if
175 @code{lo16(N)} is negative it adds one to the @code{hi16(N)}
176 value. This way @code{lo16} and @code{ha16} can be added to create any
177 32-bit value using @code{auli}.  For example, here is how you move an
178 arbitrary 32-bit address into r3:
180 @smallexample
181 moveli r3, lo16(sym)
182 auli r3, r3, ha16(sym)
183 @end smallexample
185 @item got
187 This modifier is used to load the offset of the GOT entry
188 corresponding to the symbol.
190 @item got_lo16
192 This modifier is used to load the sign-extended low 16 bits of the
193 offset of the GOT entry corresponding to the symbol.
195 @item got_hi16
197 This modifier is used to load the sign-extended high 16 bits of the
198 offset of the GOT entry corresponding to the symbol.
200 @item got_ha16
202 This modifier is like @code{got_hi16}, but it adds one if
203 @code{got_lo16} of the input value is negative.
205 @item plt
207 This modifier is used for function symbols.  It causes a
208 @emph{procedure linkage table}, an array of code stubs, to be created
209 at the time the shared object is created or linked against, together
210 with a global offset table entry.  The value is a pc-relative offset
211 to the corresponding stub code in the procedure linkage table.  This
212 arrangement causes the run-time symbol resolver to be called to look
213 up and set the value of the symbol the first time the function is
214 called (at latest; depending environment variables).  It is only safe
215 to leave the symbol unresolved this way if all references are function
216 calls.
218 @item tls_gd
220 This modifier is used to load the offset of the GOT entry of the
221 symbol's TLS descriptor, to be used for general-dynamic TLS accesses.
223 @item tls_gd_lo16
225 This modifier is used to load the sign-extended low 16 bits of the
226 offset of the GOT entry of the symbol's TLS descriptor, to be used for
227 general dynamic TLS accesses.
229 @item tls_gd_hi16
231 This modifier is used to load the sign-extended high 16 bits of the
232 offset of the GOT entry of the symbol's TLS descriptor, to be used for
233 general dynamic TLS accesses.
235 @item tls_gd_ha16
237 This modifier is like @code{tls_gd_hi16}, but it adds one to the value
238 if @code{tls_gd_lo16} of the input value is negative.
240 @item tls_ie
242 This modifier is used to load the offset of the GOT entry containing
243 the offset of the symbol's address from the TCB, to be used for
244 initial-exec TLS accesses.
246 @item tls_ie_lo16
248 This modifier is used to load the low 16 bits of the offset of the GOT
249 entry containing the offset of the symbol's address from the TCB, to
250 be used for initial-exec TLS accesses.
252 @item tls_ie_hi16
254 This modifier is used to load the high 16 bits of the offset of the
255 GOT entry containing the offset of the symbol's address from the TCB,
256 to be used for initial-exec TLS accesses.
258 @item tls_ie_ha16
260 This modifier is like @code{tls_ie_hi16}, but it adds one to the value
261 if @code{tls_ie_lo16} of the input value is negative.
263 @item tls_le
265 This modifier is used to load the offset of the symbol's address from
266 the TCB, to be used for local-exec TLS accesses.
268 @item tls_le_lo16
270 This modifier is used to load the low 16 bits of the offset of the
271 symbol's address from the TCB, to be used for local-exec TLS accesses.
273 @item tls_le_hi16
275 This modifier is used to load the high 16 bits of the offset of the
276 symbol's address from the TCB, to be used for local-exec TLS accesses.
278 @item tls_le_ha16
280 This modifier is like @code{tls_le_hi16}, but it adds one to the value
281 if @code{tls_le_lo16} of the input value is negative.
283 @item tls_gd_call
285 This modifier is used to tag an instrution as the ``call'' part of a
286 calling sequence for a TLS GD reference of its operand.
288 @item tls_gd_add
290 This modifier is used to tag an instruction as the ``add'' part of a
291 calling sequence for a TLS GD reference of its operand.
293 @item tls_ie_load
295 This modifier is used to tag an instruction as the ``load'' part of a
296 calling sequence for a TLS IE reference of its operand.
298 @end table
300 @node TILEPro Directives
301 @section TILEPro Directives
302 @cindex machine directives, TILEPro
303 @cindex TILEPro machine directives
305 @table @code
307 @cindex @code{.align} directive, TILEPro
308 @item .align @var{expression} [, @var{expression}]
309 This is the generic @var{.align} directive.  The first argument is the
310 requested alignment in bytes.
312 @cindex @code{.allow_suspicious_bundles} directive, TILEPro
313 @item .allow_suspicious_bundles
314 Turns on error checking for combinations of instructions in a bundle
315 that probably indicate a programming error.  This is on by default.
317 @item .no_allow_suspicious_bundles
318 Turns off error checking for combinations of instructions in a bundle
319 that probably indicate a programming error.
321 @cindex @code{.require_canonical_reg_names} directive, TILEPro
322 @item .require_canonical_reg_names
323 Require that canonical register names be used, and emit a warning if
324 the numeric names are used.  This is on by default.
326 @item .no_require_canonical_reg_names
327 Permit the use of numeric names for registers that have canonical
328 names.
330 @end table