Sparc_002dRegs.html 12 KB

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