1 @c Copyright (C) 2011-2024 Free Software Foundation, Inc.
2 @c This is part of the GAS manual.
3 @c For copying conditions, see the file as.texinfo.
6 @node TILEPro-Dependent
7 @chapter TILEPro Dependent Features
10 @node Machine Dependencies
11 @chapter TILEPro Dependent Features
14 @cindex TILEPro support
16 * TILEPro Options:: TILEPro Options
17 * TILEPro Syntax:: TILEPro Syntax
18 * TILEPro Directives:: TILEPro Directives
24 @code{@value{AS}} has no machine-dependent command-line options for
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:
39 @var{opcode} [@var{operand}, @dots{}]
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:
51 @{ @var{add} r3,r4,r5 ; @var{add} r7,r8,r9 ; @var{lw} r10,r11 @}
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
82 * TILEPro Opcodes:: Opcode Naming Conventions.
83 * TILEPro Registers:: Register Naming.
84 * TILEPro Modifiers:: Symbolic Operand Modifiers.
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:
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:
156 The following modifiers are supported:
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
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.
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:
182 auli r3, r3, ha16(sym)
187 This modifier is used to load the offset of the GOT entry
188 corresponding to the symbol.
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.
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.
202 This modifier is like @code{got_hi16}, but it adds one if
203 @code{got_lo16} of the input value is negative.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
285 This modifier is used to tag an instruction as the ``call'' part of a
286 calling sequence for a TLS GD reference of its operand.
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.
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.
300 @node TILEPro Directives
301 @section TILEPro Directives
302 @cindex machine directives, TILEPro
303 @cindex TILEPro machine directives
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