You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

254 lines
12KB

  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-2020 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 6.5, http://www.gnu.org/software/texinfo/ -->
  13. <head>
  14. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  15. <title>Sparc-Regs (Using as)</title>
  16. <meta name="description" content="Sparc-Regs (Using as)">
  17. <meta name="keywords" content="Sparc-Regs (Using as)">
  18. <meta name="resource-type" content="document">
  19. <meta name="distribution" content="global">
  20. <meta name="Generator" content="makeinfo">
  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="Sparc_002dSyntax.html#Sparc_002dSyntax" rel="up" title="Sparc-Syntax">
  25. <link href="Sparc_002dConstants.html#Sparc_002dConstants" rel="next" title="Sparc-Constants">
  26. <link href="Sparc_002dChars.html#Sparc_002dChars" rel="prev" title="Sparc-Chars">
  27. <style type="text/css">
  28. <!--
  29. a.summary-letter {text-decoration: none}
  30. blockquote.indentedblock {margin-right: 0em}
  31. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  32. blockquote.smallquotation {font-size: smaller}
  33. div.display {margin-left: 3.2em}
  34. div.example {margin-left: 3.2em}
  35. div.lisp {margin-left: 3.2em}
  36. div.smalldisplay {margin-left: 3.2em}
  37. div.smallexample {margin-left: 3.2em}
  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.nolinebreak {white-space: nowrap}
  49. span.roman {font-family: initial; font-weight: normal}
  50. span.sansserif {font-family: sans-serif; font-weight: normal}
  51. ul.no-bullet {list-style: none}
  52. -->
  53. </style>
  54. </head>
  55. <body lang="en">
  56. <a name="Sparc_002dRegs"></a>
  57. <div class="header">
  58. <p>
  59. Next: <a href="Sparc_002dConstants.html#Sparc_002dConstants" accesskey="n" rel="next">Sparc-Constants</a>, Previous: <a href="Sparc_002dChars.html#Sparc_002dChars" accesskey="p" rel="prev">Sparc-Chars</a>, Up: <a href="Sparc_002dSyntax.html#Sparc_002dSyntax" accesskey="u" rel="up">Sparc-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>
  60. </div>
  61. <hr>
  62. <a name="Register-Names-16"></a>
  63. <h4 class="subsubsection">9.44.3.2 Register Names</h4>
  64. <a name="index-Sparc-registers"></a>
  65. <a name="index-register-names_002c-Sparc"></a>
  66. <p>The Sparc integer register file is broken down into global,
  67. outgoing, local, and incoming.
  68. </p>
  69. <ul>
  70. <li> The 8 global registers are referred to as &lsquo;<samp>%g<var>n</var></samp>&rsquo;.
  71. </li><li> The 8 outgoing registers are referred to as &lsquo;<samp>%o<var>n</var></samp>&rsquo;.
  72. </li><li> The 8 local registers are referred to as &lsquo;<samp>%l<var>n</var></samp>&rsquo;.
  73. </li><li> The 8 incoming registers are referred to as &lsquo;<samp>%i<var>n</var></samp>&rsquo;.
  74. </li><li> The frame pointer register &lsquo;<samp>%i6</samp>&rsquo; can be referenced using
  75. the alias &lsquo;<samp>%fp</samp>&rsquo;.
  76. </li><li> The stack pointer register &lsquo;<samp>%o6</samp>&rsquo; can be referenced using
  77. the alias &lsquo;<samp>%sp</samp>&rsquo;.
  78. </li></ul>
  79. <p>Floating point registers are simply referred to as &lsquo;<samp>%f<var>n</var></samp>&rsquo;.
  80. When assembling for pre-V9, only 32 floating point registers
  81. are available. For V9 and later there are 64, but there are
  82. restrictions when referencing the upper 32 registers. They
  83. can only be accessed as double or quad, and thus only even
  84. or quad numbered accesses are allowed. For example, &lsquo;<samp>%f34</samp>&rsquo;
  85. is a legal floating point register, but &lsquo;<samp>%f35</samp>&rsquo; is not.
  86. </p>
  87. <p>Floating point registers accessed as double can also be referred using
  88. the &lsquo;<samp>%d<var>n</var></samp>&rsquo; notation, where <var>n</var> is even. Similarly,
  89. floating point registers accessed as quad can be referred using the
  90. &lsquo;<samp>%q<var>n</var></samp>&rsquo; notation, where <var>n</var> is a multiple of 4. For
  91. example, &lsquo;<samp>%f4</samp>&rsquo; can be denoted as both &lsquo;<samp>%d4</samp>&rsquo; and &lsquo;<samp>%q4</samp>&rsquo;.
  92. On the other hand, &lsquo;<samp>%f2</samp>&rsquo; can be denoted as &lsquo;<samp>%d2</samp>&rsquo; but not as
  93. &lsquo;<samp>%q2</samp>&rsquo;.
  94. </p>
  95. <p>Certain V9 instructions allow access to ancillary state registers.
  96. Most simply they can be referred to as &lsquo;<samp>%asr<var>n</var></samp>&rsquo; where
  97. <var>n</var> can be from 16 to 31. However, there are some aliases
  98. defined to reference ASR registers defined for various UltraSPARC
  99. processors:
  100. </p>
  101. <ul>
  102. <li> The tick compare register is referred to as &lsquo;<samp>%tick_cmpr</samp>&rsquo;.
  103. </li><li> The system tick register is referred to as &lsquo;<samp>%stick</samp>&rsquo;. An alias,
  104. &lsquo;<samp>%sys_tick</samp>&rsquo;, exists but is deprecated and should not be used
  105. by new software.
  106. </li><li> The system tick compare register is referred to as &lsquo;<samp>%stick_cmpr</samp>&rsquo;.
  107. An alias, &lsquo;<samp>%sys_tick_cmpr</samp>&rsquo;, exists but is deprecated and should
  108. not be used by new software.
  109. </li><li> The software interrupt register is referred to as &lsquo;<samp>%softint</samp>&rsquo;.
  110. </li><li> The set software interrupt register is referred to as &lsquo;<samp>%set_softint</samp>&rsquo;.
  111. The mnemonic &lsquo;<samp>%softint_set</samp>&rsquo; is provided as an alias.
  112. </li><li> The clear software interrupt register is referred to as
  113. &lsquo;<samp>%clear_softint</samp>&rsquo;. The mnemonic &lsquo;<samp>%softint_clear</samp>&rsquo; is provided
  114. as an alias.
  115. </li><li> The performance instrumentation counters register is referred to as
  116. &lsquo;<samp>%pic</samp>&rsquo;.
  117. </li><li> The performance control register is referred to as &lsquo;<samp>%pcr</samp>&rsquo;.
  118. </li><li> The graphics status register is referred to as &lsquo;<samp>%gsr</samp>&rsquo;.
  119. </li><li> The V9 dispatch control register is referred to as &lsquo;<samp>%dcr</samp>&rsquo;.
  120. </li></ul>
  121. <p>Various V9 branch and conditional move instructions allow
  122. specification of which set of integer condition codes to
  123. test. These are referred to as &lsquo;<samp>%xcc</samp>&rsquo; and &lsquo;<samp>%icc</samp>&rsquo;.
  124. </p>
  125. <p>Additionally, GAS supports the so-called &ldquo;natural&rdquo; condition codes;
  126. these are referred to as &lsquo;<samp>%ncc</samp>&rsquo; and reference to &lsquo;<samp>%icc</samp>&rsquo; if
  127. the word size is 32, &lsquo;<samp>%xcc</samp>&rsquo; if the word size is 64.
  128. </p>
  129. <p>In V9, there are 4 sets of floating point condition codes
  130. which are referred to as &lsquo;<samp>%fcc<var>n</var></samp>&rsquo;.
  131. </p>
  132. <p>Several special privileged and non-privileged registers
  133. exist:
  134. </p>
  135. <ul>
  136. <li> The V9 address space identifier register is referred to as &lsquo;<samp>%asi</samp>&rsquo;.
  137. </li><li> The V9 restorable windows register is referred to as &lsquo;<samp>%canrestore</samp>&rsquo;.
  138. </li><li> The V9 savable windows register is referred to as &lsquo;<samp>%cansave</samp>&rsquo;.
  139. </li><li> The V9 clean windows register is referred to as &lsquo;<samp>%cleanwin</samp>&rsquo;.
  140. </li><li> The V9 current window pointer register is referred to as &lsquo;<samp>%cwp</samp>&rsquo;.
  141. </li><li> The floating-point queue register is referred to as &lsquo;<samp>%fq</samp>&rsquo;.
  142. </li><li> The V8 co-processor queue register is referred to as &lsquo;<samp>%cq</samp>&rsquo;.
  143. </li><li> The floating point status register is referred to as &lsquo;<samp>%fsr</samp>&rsquo;.
  144. </li><li> The other windows register is referred to as &lsquo;<samp>%otherwin</samp>&rsquo;.
  145. </li><li> The V9 program counter register is referred to as &lsquo;<samp>%pc</samp>&rsquo;.
  146. </li><li> The V9 next program counter register is referred to as &lsquo;<samp>%npc</samp>&rsquo;.
  147. </li><li> The V9 processor interrupt level register is referred to as &lsquo;<samp>%pil</samp>&rsquo;.
  148. </li><li> The V9 processor state register is referred to as &lsquo;<samp>%pstate</samp>&rsquo;.
  149. </li><li> The trap base address register is referred to as &lsquo;<samp>%tba</samp>&rsquo;.
  150. </li><li> The V9 tick register is referred to as &lsquo;<samp>%tick</samp>&rsquo;.
  151. </li><li> The V9 trap level is referred to as &lsquo;<samp>%tl</samp>&rsquo;.
  152. </li><li> The V9 trap program counter is referred to as &lsquo;<samp>%tpc</samp>&rsquo;.
  153. </li><li> The V9 trap next program counter is referred to as &lsquo;<samp>%tnpc</samp>&rsquo;.
  154. </li><li> The V9 trap state is referred to as &lsquo;<samp>%tstate</samp>&rsquo;.
  155. </li><li> The V9 trap type is referred to as &lsquo;<samp>%tt</samp>&rsquo;.
  156. </li><li> The V9 condition codes is referred to as &lsquo;<samp>%ccr</samp>&rsquo;.
  157. </li><li> The V9 floating-point registers state is referred to as &lsquo;<samp>%fprs</samp>&rsquo;.
  158. </li><li> The V9 version register is referred to as &lsquo;<samp>%ver</samp>&rsquo;.
  159. </li><li> The V9 window state register is referred to as &lsquo;<samp>%wstate</samp>&rsquo;.
  160. </li><li> The Y register is referred to as &lsquo;<samp>%y</samp>&rsquo;.
  161. </li><li> The V8 window invalid mask register is referred to as &lsquo;<samp>%wim</samp>&rsquo;.
  162. </li><li> The V8 processor state register is referred to as &lsquo;<samp>%psr</samp>&rsquo;.
  163. </li><li> The V9 global register level register is referred to as &lsquo;<samp>%gl</samp>&rsquo;.
  164. </li></ul>
  165. <p>Several special register names exist for hypervisor mode code:
  166. </p>
  167. <ul>
  168. <li> The hyperprivileged processor state register is referred to as
  169. &lsquo;<samp>%hpstate</samp>&rsquo;.
  170. </li><li> The hyperprivileged trap state register is referred to as &lsquo;<samp>%htstate</samp>&rsquo;.
  171. </li><li> The hyperprivileged interrupt pending register is referred to as
  172. &lsquo;<samp>%hintp</samp>&rsquo;.
  173. </li><li> The hyperprivileged trap base address register is referred to as
  174. &lsquo;<samp>%htba</samp>&rsquo;.
  175. </li><li> The hyperprivileged implementation version register is referred
  176. to as &lsquo;<samp>%hver</samp>&rsquo;.
  177. </li><li> The hyperprivileged system tick offset register is referred to as
  178. &lsquo;<samp>%hstick_offset</samp>&rsquo;. Note that there is no &lsquo;<samp>%hstick</samp>&rsquo; register,
  179. the normal &lsquo;<samp>%stick</samp>&rsquo; is used.
  180. </li><li> The hyperprivileged system tick enable register is referred to as
  181. &lsquo;<samp>%hstick_enable</samp>&rsquo;.
  182. </li><li> The hyperprivileged system tick compare register is referred
  183. to as &lsquo;<samp>%hstick_cmpr</samp>&rsquo;.
  184. </li></ul>
  185. <hr>
  186. <div class="header">
  187. <p>
  188. Next: <a href="Sparc_002dConstants.html#Sparc_002dConstants" accesskey="n" rel="next">Sparc-Constants</a>, Previous: <a href="Sparc_002dChars.html#Sparc_002dChars" accesskey="p" rel="prev">Sparc-Chars</a>, Up: <a href="Sparc_002dSyntax.html#Sparc_002dSyntax" accesskey="u" rel="up">Sparc-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>
  189. </div>
  190. </body>
  191. </html>