TILEPro-Modifiers.html 9.1 KB

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