1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<html>
3<!-- This file documents the GNU Assembler "as".
4
5Copyright (C) 1991-2021 Free Software Foundation, Inc.
6
7Permission is granted to copy, distribute and/or modify this document
8under the terms of the GNU Free Documentation License, Version 1.3
9or any later version published by the Free Software Foundation;
10with no Invariant Sections, with no Front-Cover Texts, and with no
11Back-Cover Texts.  A copy of the license is included in the
12section entitled "GNU Free Documentation License".
13 -->
14<!-- Created by GNU Texinfo 5.1, http://www.gnu.org/software/texinfo/ -->
15<head>
16<title>Using as: TILEPro Modifiers</title>
17
18<meta name="description" content="Using as: TILEPro Modifiers">
19<meta name="keywords" content="Using as: TILEPro Modifiers">
20<meta name="resource-type" content="document">
21<meta name="distribution" content="global">
22<meta name="Generator" content="makeinfo">
23<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
24<link href="index.html#Top" rel="start" title="Top">
25<link href="AS-Index.html#AS-Index" rel="index" title="AS Index">
26<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
27<link href="TILEPro-Syntax.html#TILEPro-Syntax" rel="up" title="TILEPro Syntax">
28<link href="TILEPro-Directives.html#TILEPro-Directives" rel="next" title="TILEPro Directives">
29<link href="TILEPro-Registers.html#TILEPro-Registers" rel="previous" title="TILEPro Registers">
30<style type="text/css">
31<!--
32a.summary-letter {text-decoration: none}
33blockquote.smallquotation {font-size: smaller}
34div.display {margin-left: 3.2em}
35div.example {margin-left: 3.2em}
36div.indentedblock {margin-left: 3.2em}
37div.lisp {margin-left: 3.2em}
38div.smalldisplay {margin-left: 3.2em}
39div.smallexample {margin-left: 3.2em}
40div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
41div.smalllisp {margin-left: 3.2em}
42kbd {font-style:oblique}
43pre.display {font-family: inherit}
44pre.format {font-family: inherit}
45pre.menu-comment {font-family: serif}
46pre.menu-preformatted {font-family: serif}
47pre.smalldisplay {font-family: inherit; font-size: smaller}
48pre.smallexample {font-size: smaller}
49pre.smallformat {font-family: inherit; font-size: smaller}
50pre.smalllisp {font-size: smaller}
51span.nocodebreak {white-space:nowrap}
52span.nolinebreak {white-space:nowrap}
53span.roman {font-family:serif; font-weight:normal}
54span.sansserif {font-family:sans-serif; font-weight:normal}
55ul.no-bullet {list-style: none}
56-->
57</style>
58
59
60</head>
61
62<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
63<a name="TILEPro-Modifiers"></a>
64<div class="header">
65<p>
66Previous: <a href="TILEPro-Registers.html#TILEPro-Registers" accesskey="p" rel="previous">TILEPro Registers</a>, Up: <a href="TILEPro-Syntax.html#TILEPro-Syntax" accesskey="u" rel="up">TILEPro Syntax</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="AS-Index.html#AS-Index" title="Index" rel="index">Index</a>]</p>
67</div>
68<hr>
69<a name="Symbolic-Operand-Modifiers-5"></a>
70<h4 class="subsubsection">9.48.2.3 Symbolic Operand Modifiers</h4>
71<a name="index-TILEPro-modifiers"></a>
72<a name="index-symbol-modifiers_002c-TILEPro"></a>
73
74<p>The assembler supports several modifiers when using symbol addresses
75in TILEPro instruction operands.  The general syntax is the following:
76</p>
77<div class="smallexample">
78<pre class="smallexample">modifier(symbol)
79</pre></div>
80
81<p>The following modifiers are supported:
82</p>
83<dl compact="compact">
84<dt><code>lo16</code></dt>
85<dd>
86<p>This modifier is used to load the low 16 bits of the symbol&rsquo;s address,
87sign-extended to a 32-bit value (sign-extension allows it to be
88range-checked against signed 16 bit immediate operands without
89complaint).
90</p>
91</dd>
92<dt><code>hi16</code></dt>
93<dd>
94<p>This modifier is used to load the high 16 bits of the symbol&rsquo;s
95address, also sign-extended to a 32-bit value.
96</p>
97</dd>
98<dt><code>ha16</code></dt>
99<dd>
100<p><code>ha16(N)</code> is identical to <code>hi16(N)</code>, except if
101<code>lo16(N)</code> is negative it adds one to the <code>hi16(N)</code>
102value. This way <code>lo16</code> and <code>ha16</code> can be added to create any
10332-bit value using <code>auli</code>.  For example, here is how you move an
104arbitrary 32-bit address into r3:
105</p>
106<div class="smallexample">
107<pre class="smallexample">moveli r3, lo16(sym)
108auli r3, r3, ha16(sym)
109</pre></div>
110
111</dd>
112<dt><code>got</code></dt>
113<dd>
114<p>This modifier is used to load the offset of the GOT entry
115corresponding to the symbol.
116</p>
117</dd>
118<dt><code>got_lo16</code></dt>
119<dd>
120<p>This modifier is used to load the sign-extended low 16 bits of the
121offset of the GOT entry corresponding to the symbol.
122</p>
123</dd>
124<dt><code>got_hi16</code></dt>
125<dd>
126<p>This modifier is used to load the sign-extended high 16 bits of the
127offset of the GOT entry corresponding to the symbol.
128</p>
129</dd>
130<dt><code>got_ha16</code></dt>
131<dd>
132<p>This modifier is like <code>got_hi16</code>, but it adds one if
133<code>got_lo16</code> of the input value is negative.
134</p>
135</dd>
136<dt><code>plt</code></dt>
137<dd>
138<p>This modifier is used for function symbols.  It causes a
139<em>procedure linkage table</em>, an array of code stubs, to be created
140at the time the shared object is created or linked against, together
141with a global offset table entry.  The value is a pc-relative offset
142to the corresponding stub code in the procedure linkage table.  This
143arrangement causes the run-time symbol resolver to be called to look
144up and set the value of the symbol the first time the function is
145called (at latest; depending environment variables).  It is only safe
146to leave the symbol unresolved this way if all references are function
147calls.
148</p>
149</dd>
150<dt><code>tls_gd</code></dt>
151<dd>
152<p>This modifier is used to load the offset of the GOT entry of the
153symbol&rsquo;s TLS descriptor, to be used for general-dynamic TLS accesses.
154</p>
155</dd>
156<dt><code>tls_gd_lo16</code></dt>
157<dd>
158<p>This modifier is used to load the sign-extended low 16 bits of the
159offset of the GOT entry of the symbol&rsquo;s TLS descriptor, to be used for
160general dynamic TLS accesses.
161</p>
162</dd>
163<dt><code>tls_gd_hi16</code></dt>
164<dd>
165<p>This modifier is used to load the sign-extended high 16 bits of the
166offset of the GOT entry of the symbol&rsquo;s TLS descriptor, to be used for
167general dynamic TLS accesses.
168</p>
169</dd>
170<dt><code>tls_gd_ha16</code></dt>
171<dd>
172<p>This modifier is like <code>tls_gd_hi16</code>, but it adds one to the value
173if <code>tls_gd_lo16</code> of the input value is negative.
174</p>
175</dd>
176<dt><code>tls_ie</code></dt>
177<dd>
178<p>This modifier is used to load the offset of the GOT entry containing
179the offset of the symbol&rsquo;s address from the TCB, to be used for
180initial-exec TLS accesses.
181</p>
182</dd>
183<dt><code>tls_ie_lo16</code></dt>
184<dd>
185<p>This modifier is used to load the low 16 bits of the offset of the GOT
186entry containing the offset of the symbol&rsquo;s address from the TCB, to
187be used for initial-exec TLS accesses.
188</p>
189</dd>
190<dt><code>tls_ie_hi16</code></dt>
191<dd>
192<p>This modifier is used to load the high 16 bits of the offset of the
193GOT entry containing the offset of the symbol&rsquo;s address from the TCB,
194to be used for initial-exec TLS accesses.
195</p>
196</dd>
197<dt><code>tls_ie_ha16</code></dt>
198<dd>
199<p>This modifier is like <code>tls_ie_hi16</code>, but it adds one to the value
200if <code>tls_ie_lo16</code> of the input value is negative.
201</p>
202</dd>
203<dt><code>tls_le</code></dt>
204<dd>
205<p>This modifier is used to load the offset of the symbol&rsquo;s address from
206the TCB, to be used for local-exec TLS accesses.
207</p>
208</dd>
209<dt><code>tls_le_lo16</code></dt>
210<dd>
211<p>This modifier is used to load the low 16 bits of the offset of the
212symbol&rsquo;s address from the TCB, to be used for local-exec TLS accesses.
213</p>
214</dd>
215<dt><code>tls_le_hi16</code></dt>
216<dd>
217<p>This modifier is used to load the high 16 bits of the offset of the
218symbol&rsquo;s address from the TCB, to be used for local-exec TLS accesses.
219</p>
220</dd>
221<dt><code>tls_le_ha16</code></dt>
222<dd>
223<p>This modifier is like <code>tls_le_hi16</code>, but it adds one to the value
224if <code>tls_le_lo16</code> of the input value is negative.
225</p>
226</dd>
227<dt><code>tls_gd_call</code></dt>
228<dd>
229<p>This modifier is used to tag an instruction as the &ldquo;call&rdquo; part of a
230calling sequence for a TLS GD reference of its operand.
231</p>
232</dd>
233<dt><code>tls_gd_add</code></dt>
234<dd>
235<p>This modifier is used to tag an instruction as the &ldquo;add&rdquo; part of a
236calling sequence for a TLS GD reference of its operand.
237</p>
238</dd>
239<dt><code>tls_ie_load</code></dt>
240<dd>
241<p>This modifier is used to tag an instruction as the &ldquo;load&rdquo; part of a
242calling sequence for a TLS IE reference of its operand.
243</p>
244</dd>
245</dl>
246
247<hr>
248<div class="header">
249<p>
250Previous: <a href="TILEPro-Registers.html#TILEPro-Registers" accesskey="p" rel="previous">TILEPro Registers</a>, Up: <a href="TILEPro-Syntax.html#TILEPro-Syntax" accesskey="u" rel="up">TILEPro Syntax</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="AS-Index.html#AS-Index" title="Index" rel="index">Index</a>]</p>
251</div>
252
253
254
255</body>
256</html>
257