toolchain/share/doc/as.html/Sparc_002dRegs.html

225 lines
12 KiB
HTML
Raw Permalink Normal View History

2024-01-10 05:24:32 +00:00
<html lang="en">
<head>
<title>Sparc-Regs - Using as</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Using as">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Sparc_002dSyntax.html#Sparc_002dSyntax" title="Sparc-Syntax">
<link rel="prev" href="Sparc_002dChars.html#Sparc_002dChars" title="Sparc-Chars">
<link rel="next" href="Sparc_002dConstants.html#Sparc_002dConstants" title="Sparc-Constants">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
This file documents the GNU Assembler "as".
Copyright (C) 1991-2019 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
or any later version published by the Free Software Foundation;
with no Invariant Sections, with no Front-Cover Texts, and with no
Back-Cover Texts. A copy of the license is included in the
section entitled ``GNU Free Documentation License''.
-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
</head>
<body>
<div class="node">
<a name="Sparc-Regs"></a>
<a name="Sparc_002dRegs"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="Sparc_002dConstants.html#Sparc_002dConstants">Sparc-Constants</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="Sparc_002dChars.html#Sparc_002dChars">Sparc-Chars</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Sparc_002dSyntax.html#Sparc_002dSyntax">Sparc-Syntax</a>
<hr>
</div>
<h5 class="subsubsection">9.44.3.2 Register Names</h5>
<p><a name="index-Sparc-registers-2174"></a><a name="index-register-names_002c-Sparc-2175"></a>
The Sparc integer register file is broken down into global,
outgoing, local, and incoming.
<ul>
<li>The 8 global registers are referred to as &lsquo;<samp><span class="samp">%g</span><var>n</var></samp>&rsquo;.
<li>The 8 outgoing registers are referred to as &lsquo;<samp><span class="samp">%o</span><var>n</var></samp>&rsquo;.
<li>The 8 local registers are referred to as &lsquo;<samp><span class="samp">%l</span><var>n</var></samp>&rsquo;.
<li>The 8 incoming registers are referred to as &lsquo;<samp><span class="samp">%i</span><var>n</var></samp>&rsquo;.
<li>The frame pointer register &lsquo;<samp><span class="samp">%i6</span></samp>&rsquo; can be referenced using
the alias &lsquo;<samp><span class="samp">%fp</span></samp>&rsquo;.
<li>The stack pointer register &lsquo;<samp><span class="samp">%o6</span></samp>&rsquo; can be referenced using
the alias &lsquo;<samp><span class="samp">%sp</span></samp>&rsquo;.
</ul>
<p>Floating point registers are simply referred to as &lsquo;<samp><span class="samp">%f</span><var>n</var></samp>&rsquo;.
When assembling for pre-V9, only 32 floating point registers
are available. For V9 and later there are 64, but there are
restrictions when referencing the upper 32 registers. They
can only be accessed as double or quad, and thus only even
or quad numbered accesses are allowed. For example, &lsquo;<samp><span class="samp">%f34</span></samp>&rsquo;
is a legal floating point register, but &lsquo;<samp><span class="samp">%f35</span></samp>&rsquo; is not.
<p>Floating point registers accessed as double can also be referred using
the &lsquo;<samp><span class="samp">%d</span><var>n</var></samp>&rsquo; notation, where <var>n</var> is even. Similarly,
floating point registers accessed as quad can be referred using the
&lsquo;<samp><span class="samp">%q</span><var>n</var></samp>&rsquo; notation, where <var>n</var> is a multiple of 4. For
example, &lsquo;<samp><span class="samp">%f4</span></samp>&rsquo; can be denoted as both &lsquo;<samp><span class="samp">%d4</span></samp>&rsquo; and &lsquo;<samp><span class="samp">%q4</span></samp>&rsquo;.
On the other hand, &lsquo;<samp><span class="samp">%f2</span></samp>&rsquo; can be denoted as &lsquo;<samp><span class="samp">%d2</span></samp>&rsquo; but not as
&lsquo;<samp><span class="samp">%q2</span></samp>&rsquo;.
<p>Certain V9 instructions allow access to ancillary state registers.
Most simply they can be referred to as &lsquo;<samp><span class="samp">%asr</span><var>n</var></samp>&rsquo; where
<var>n</var> can be from 16 to 31. However, there are some aliases
defined to reference ASR registers defined for various UltraSPARC
processors:
<ul>
<li>The tick compare register is referred to as &lsquo;<samp><span class="samp">%tick_cmpr</span></samp>&rsquo;.
<li>The system tick register is referred to as &lsquo;<samp><span class="samp">%stick</span></samp>&rsquo;. An alias,
&lsquo;<samp><span class="samp">%sys_tick</span></samp>&rsquo;, exists but is deprecated and should not be used
by new software.
<li>The system tick compare register is referred to as &lsquo;<samp><span class="samp">%stick_cmpr</span></samp>&rsquo;.
An alias, &lsquo;<samp><span class="samp">%sys_tick_cmpr</span></samp>&rsquo;, exists but is deprecated and should
not be used by new software.
<li>The software interrupt register is referred to as &lsquo;<samp><span class="samp">%softint</span></samp>&rsquo;.
<li>The set software interrupt register is referred to as &lsquo;<samp><span class="samp">%set_softint</span></samp>&rsquo;.
The mnemonic &lsquo;<samp><span class="samp">%softint_set</span></samp>&rsquo; is provided as an alias.
<li>The clear software interrupt register is referred to as
&lsquo;<samp><span class="samp">%clear_softint</span></samp>&rsquo;. The mnemonic &lsquo;<samp><span class="samp">%softint_clear</span></samp>&rsquo; is provided
as an alias.
<li>The performance instrumentation counters register is referred to as
&lsquo;<samp><span class="samp">%pic</span></samp>&rsquo;.
<li>The performance control register is referred to as &lsquo;<samp><span class="samp">%pcr</span></samp>&rsquo;.
<li>The graphics status register is referred to as &lsquo;<samp><span class="samp">%gsr</span></samp>&rsquo;.
<li>The V9 dispatch control register is referred to as &lsquo;<samp><span class="samp">%dcr</span></samp>&rsquo;.
</ul>
<p>Various V9 branch and conditional move instructions allow
specification of which set of integer condition codes to
test. These are referred to as &lsquo;<samp><span class="samp">%xcc</span></samp>&rsquo; and &lsquo;<samp><span class="samp">%icc</span></samp>&rsquo;.
<p>Additionally, GAS supports the so-called &ldquo;natural&rdquo; condition codes;
these are referred to as &lsquo;<samp><span class="samp">%ncc</span></samp>&rsquo; and reference to &lsquo;<samp><span class="samp">%icc</span></samp>&rsquo; if
the word size is 32, &lsquo;<samp><span class="samp">%xcc</span></samp>&rsquo; if the word size is 64.
<p>In V9, there are 4 sets of floating point condition codes
which are referred to as &lsquo;<samp><span class="samp">%fcc</span><var>n</var></samp>&rsquo;.
<p>Several special privileged and non-privileged registers
exist:
<ul>
<li>The V9 address space identifier register is referred to as &lsquo;<samp><span class="samp">%asi</span></samp>&rsquo;.
<li>The V9 restorable windows register is referred to as &lsquo;<samp><span class="samp">%canrestore</span></samp>&rsquo;.
<li>The V9 savable windows register is referred to as &lsquo;<samp><span class="samp">%cansave</span></samp>&rsquo;.
<li>The V9 clean windows register is referred to as &lsquo;<samp><span class="samp">%cleanwin</span></samp>&rsquo;.
<li>The V9 current window pointer register is referred to as &lsquo;<samp><span class="samp">%cwp</span></samp>&rsquo;.
<li>The floating-point queue register is referred to as &lsquo;<samp><span class="samp">%fq</span></samp>&rsquo;.
<li>The V8 co-processor queue register is referred to as &lsquo;<samp><span class="samp">%cq</span></samp>&rsquo;.
<li>The floating point status register is referred to as &lsquo;<samp><span class="samp">%fsr</span></samp>&rsquo;.
<li>The other windows register is referred to as &lsquo;<samp><span class="samp">%otherwin</span></samp>&rsquo;.
<li>The V9 program counter register is referred to as &lsquo;<samp><span class="samp">%pc</span></samp>&rsquo;.
<li>The V9 next program counter register is referred to as &lsquo;<samp><span class="samp">%npc</span></samp>&rsquo;.
<li>The V9 processor interrupt level register is referred to as &lsquo;<samp><span class="samp">%pil</span></samp>&rsquo;.
<li>The V9 processor state register is referred to as &lsquo;<samp><span class="samp">%pstate</span></samp>&rsquo;.
<li>The trap base address register is referred to as &lsquo;<samp><span class="samp">%tba</span></samp>&rsquo;.
<li>The V9 tick register is referred to as &lsquo;<samp><span class="samp">%tick</span></samp>&rsquo;.
<li>The V9 trap level is referred to as &lsquo;<samp><span class="samp">%tl</span></samp>&rsquo;.
<li>The V9 trap program counter is referred to as &lsquo;<samp><span class="samp">%tpc</span></samp>&rsquo;.
<li>The V9 trap next program counter is referred to as &lsquo;<samp><span class="samp">%tnpc</span></samp>&rsquo;.
<li>The V9 trap state is referred to as &lsquo;<samp><span class="samp">%tstate</span></samp>&rsquo;.
<li>The V9 trap type is referred to as &lsquo;<samp><span class="samp">%tt</span></samp>&rsquo;.
<li>The V9 condition codes is referred to as &lsquo;<samp><span class="samp">%ccr</span></samp>&rsquo;.
<li>The V9 floating-point registers state is referred to as &lsquo;<samp><span class="samp">%fprs</span></samp>&rsquo;.
<li>The V9 version register is referred to as &lsquo;<samp><span class="samp">%ver</span></samp>&rsquo;.
<li>The V9 window state register is referred to as &lsquo;<samp><span class="samp">%wstate</span></samp>&rsquo;.
<li>The Y register is referred to as &lsquo;<samp><span class="samp">%y</span></samp>&rsquo;.
<li>The V8 window invalid mask register is referred to as &lsquo;<samp><span class="samp">%wim</span></samp>&rsquo;.
<li>The V8 processor state register is referred to as &lsquo;<samp><span class="samp">%psr</span></samp>&rsquo;.
<li>The V9 global register level register is referred to as &lsquo;<samp><span class="samp">%gl</span></samp>&rsquo;.
</ul>
<p>Several special register names exist for hypervisor mode code:
<ul>
<li>The hyperprivileged processor state register is referred to as
&lsquo;<samp><span class="samp">%hpstate</span></samp>&rsquo;.
<li>The hyperprivileged trap state register is referred to as &lsquo;<samp><span class="samp">%htstate</span></samp>&rsquo;.
<li>The hyperprivileged interrupt pending register is referred to as
&lsquo;<samp><span class="samp">%hintp</span></samp>&rsquo;.
<li>The hyperprivileged trap base address register is referred to as
&lsquo;<samp><span class="samp">%htba</span></samp>&rsquo;.
<li>The hyperprivileged implementation version register is referred
to as &lsquo;<samp><span class="samp">%hver</span></samp>&rsquo;.
<li>The hyperprivileged system tick offset register is referred to as
&lsquo;<samp><span class="samp">%hstick_offset</span></samp>&rsquo;. Note that there is no &lsquo;<samp><span class="samp">%hstick</span></samp>&rsquo; register,
the normal &lsquo;<samp><span class="samp">%stick</span></samp>&rsquo; is used.
<li>The hyperprivileged system tick enable register is referred to as
&lsquo;<samp><span class="samp">%hstick_enable</span></samp>&rsquo;.
<li>The hyperprivileged system tick compare register is referred
to as &lsquo;<samp><span class="samp">%hstick_cmpr</span></samp>&rsquo;.
</ul>
</body></html>