# Registers

Hexagon has general registers and control registers.

Control registers support special-purpose processor features such as
hardware loops and predicates.

## General registers

The Hexagon processor has thirty-two 32-bit general-purpose registers
(named R0 through R31). These registers store operands in the
instructions:

- Memory addresses for load/store instructions
- Data operands for arithmetic/logic instructions
- Vector operands for 32-bit and 64-bit vector instructions For example:

R1 = memh(R0)          // Load from address R0
        R4 = add(R2,R3)        // Add
        R28 = vaddh(R11,R10)   // Vector add halfword
        Copy to clipboard

<!--?xml version="1.0" encoding="UTF-8" standalone="no"?-->

<!-- Generated by Microsoft Visio, SVG Export fig_general_registers.svg Page-1 -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:v="http://schemas.microsoft.com/visio/2003/SVGExtensions/" width="2.52083in" height="2.63875in" viewbox="0 0 181.499 189.99" xml:space="preserve" color-interpolation-filters="sRGB" class="st8"><v:documentproperties v:langid="1033" v:viewmarkup="false">	<v:userdefs>		<v:ud v:nameu="msvConvertTheme"></v:ud>	</v:userdefs></v:documentproperties>
<style>.svg-1 .st1 { stroke: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 0.75 }
.svg-1 .st2 { fill: #2a2aea; font-family: Roboto; font-size: 0.833336em; font-weight: bold }
.svg-1 .st3 { stroke: #2a2aea; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.49945 }
.svg-1 .st4 { stroke: #2a2aea; stroke-linecap: round; stroke-linejoin: round; stroke-width: 0.749723 }
.svg-1 .st5 { fill: #ffffff; stroke: #2a2aea; stroke-linecap: round; stroke-linejoin: round; stroke-width: 0.24 }
.svg-1 .st6 { fill: #2a2aea; font-family: Roboto; font-size: 0.833336em }
.svg-1 .st7 { fill: #ffffff; stroke: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 0.24 }
.svg-1 .st8 { fill: none; fill-rule: evenodd; font-size: 12px; overflow: visible; stroke-linecap: square; stroke-miterlimit: 3 }</style>
<g v:mid="0" v:index="1" v:groupcontext="foregroundPage">	<title>Page-1</title>	<v:pageproperties v:drawingscale="1" v:pagescale="1" v:drawingunits="19" v:shadowoffsetx="9" v:shadowoffsety="-9"></v:pageproperties>	<g id="shape2-1" v:mid="2" v:groupcontext="shape" transform="translate(90.7497,-90.24)">		<title>Sheet.2</title>		<desc>.</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="3.49586" cy="173.21" width="7" height="33.5603"></v:textrect>		<path d="M6.99 156.43 L0 156.43 L0 189.99 L6.99 189.99 L6.99 156.43" class="st1"></path>		<text x="2.04" y="176.21" class="st2" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>.</text>		</g>	<g id="shape3-5" v:mid="3" v:groupcontext="shape" transform="translate(18.7497,-54.24)">		<title>Sheet.3</title>		<path d="M0 72.99 L0 189.99 L144 189.99 L144 72.99 L0 72.99" class="st3"></path>	</g>	<g id="shape4-8" v:mid="4" v:groupcontext="shape" transform="translate(90.7497,-135.24)">		<title>Sheet.4</title>		<path d="M0 177.99 C0 181.3 2.69 183.99 6 183.99 L30.01 183.99 C33.33 183.99 36 186.69 36 189.99 C36 186.69 38.69 183.99					 42 183.99 L66.01 183.99 C69.33 183.99 72 181.3 72 177.99" class="st4"></path>	</g>	<g id="shape5-11" v:mid="5" v:groupcontext="shape" transform="translate(126.75,-153.24)">		<title>Rectangle</title>		<desc>R0</desc>		<v:userdefs>			<v:ud v:nameu="visVersion" v:val="VT0(10):26"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="18" cy="180.99" width="36.01" height="18"></v:textrect>		<rect x="0" y="171.99" width="36" height="18" class="st5"></rect>		<text x="12.11" y="183.99" class="st6" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>R0</text>		</g>	<g id="shape6-14" v:mid="6" v:groupcontext="shape" transform="translate(90.7497,-153.24)">		<title>Rectangle.3</title>		<desc>R1</desc>		<v:userdefs>			<v:ud v:nameu="visVersion" v:val="VT0(10):26"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="18" cy="180.99" width="36.01" height="18"></v:textrect>		<rect x="0" y="171.99" width="36" height="18" class="st5"></rect>		<text x="12.11" y="183.99" class="st6" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>R1</text>		</g>	<g id="shape7-17" v:mid="7" v:groupcontext="shape" transform="translate(54.7497,-153.24)">		<title>Rectangle.4</title>		<desc>R2</desc>		<v:userdefs>			<v:ud v:nameu="visVersion" v:val="VT0(10):26"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="18" cy="180.99" width="36.01" height="18"></v:textrect>		<rect x="0" y="171.99" width="36" height="18" class="st5"></rect>		<text x="12.11" y="183.99" class="st6" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>R2</text>		</g>	<g id="shape8-20" v:mid="8" v:groupcontext="shape" transform="translate(18.7497,-153.24)">		<title>Rectangle.5</title>		<desc>R3</desc>		<v:userdefs>			<v:ud v:nameu="visVersion" v:val="VT0(10):26"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="18" cy="180.99" width="36.01" height="18"></v:textrect>		<rect x="0" y="171.99" width="36" height="18" class="st5"></rect>		<text x="12.11" y="183.99" class="st6" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>R3</text>		</g>	<g id="shape9-23" v:mid="9" v:groupcontext="shape" transform="translate(126.75,-54.24)">		<title>Rectangle.6</title>		<desc>R28</desc>		<v:userdefs>			<v:ud v:nameu="visVersion" v:val="VT0(10):26"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="18" cy="180.99" width="36.01" height="18"></v:textrect>		<rect x="0" y="171.99" width="36" height="18" class="st5"></rect>		<text x="9.31" y="183.99" class="st6" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>R28</text>		</g>	<g id="shape10-26" v:mid="10" v:groupcontext="shape" transform="translate(90.7497,-54.24)">		<title>Rectangle.7</title>		<desc>R29</desc>		<v:userdefs>			<v:ud v:nameu="visVersion" v:val="VT0(10):26"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="18" cy="180.99" width="36.01" height="18"></v:textrect>		<rect x="0" y="171.99" width="36" height="18" class="st5"></rect>		<text x="9.31" y="183.99" class="st6" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>R29</text>		</g>	<g id="shape11-29" v:mid="11" v:groupcontext="shape" transform="translate(54.7497,-54.24)">		<title>Rectangle.8</title>		<desc>R30</desc>		<v:userdefs>			<v:ud v:nameu="visVersion" v:val="VT0(10):26"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="18" cy="180.99" width="36.01" height="18"></v:textrect>		<rect x="0" y="171.99" width="36" height="18" class="st5"></rect>		<text x="9.31" y="183.99" class="st6" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>R30</text>		</g>	<g id="shape12-32" v:mid="12" v:groupcontext="shape" transform="translate(18.7497,-54.24)">		<title>Rectangle.9</title>		<desc>R31</desc>		<v:userdefs>			<v:ud v:nameu="visVersion" v:val="VT0(10):26"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="18" cy="180.99" width="36.01" height="18"></v:textrect>		<rect x="0" y="171.99" width="36" height="18" class="st5"></rect>		<text x="9.31" y="183.99" class="st6" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>R31</text>		</g>	<g id="shape13-35" v:mid="13" v:groupcontext="shape" transform="translate(108.75,-117.24)">		<title>Rectangle.1</title>		<desc>R1:0</desc>		<v:userdefs>			<v:ud v:nameu="visVersion" v:val="VT0(10):26"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="18" cy="180.99" width="36.01" height="18"></v:textrect>		<rect x="0" y="171.99" width="36" height="18" class="st7"></rect>		<text x="8.1" y="183.99" class="st6" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>R1:0</text>		</g>	<g id="shape14-38" v:mid="14" v:groupcontext="shape" transform="translate(18.7497,-135.24)">		<title>Sheet.14</title>		<path d="M0 177.99 C0 181.3 2.69 183.99 6 183.99 L30.01 183.99 C33.33 183.99 36 186.69 36 189.99 C36 186.69 38.69 183.99					 42 183.99 L66.01 183.99 C69.33 183.99 72 181.3 72 177.99" class="st4"></path>	</g>	<g id="shape15-41" v:mid="15" v:groupcontext="shape" transform="translate(36.7497,-117.24)">		<title>Rectangle.198</title>		<desc>R3:2</desc>		<v:userdefs>			<v:ud v:nameu="visVersion" v:val="VT0(10):26"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="18" cy="180.99" width="36.01" height="18"></v:textrect>		<rect x="0" y="171.99" width="36" height="18" class="st7"></rect>		<text x="8.1" y="183.99" class="st6" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>R3:2</text>		</g>	<g id="shape16-44" v:mid="16" v:groupcontext="shape" transform="translate(90.7497,-36.24)">		<title>Sheet.16</title>		<path d="M0 177.99 C0 181.3 2.69 183.99 6 183.99 L30.01 183.99 C33.33 183.99 36 186.69 36 189.99 C36 186.69 38.69 183.99					 42 183.99 L66.01 183.99 C69.33 183.99 72 181.3 72 177.99" class="st4"></path>	</g>	<g id="shape17-47" v:mid="17" v:groupcontext="shape" transform="translate(108.75,-18.24)">		<title>Rectangle.200</title>		<desc>R29:28</desc>		<v:userdefs>			<v:ud v:nameu="visVersion" v:val="VT0(10):26"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="20.25" cy="180.99" width="40.51" height="18"></v:textrect>		<rect x="0" y="171.99" width="40.5" height="18" class="st7"></rect>		<text x="4.73" y="183.99" class="st6" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>R29:28</text>		</g>	<g id="shape18-50" v:mid="18" v:groupcontext="shape" transform="translate(18.7497,-36.24)">		<title>Sheet.18</title>		<path d="M0 177.99 C0 181.3 2.69 183.99 6 183.99 L30.01 183.99 C33.33 183.99 36 186.69 36 189.99 C36 186.69 38.69 183.99					 42 183.99 L66.01 183.99 C69.33 183.99 72 181.3 72 177.99" class="st4"></path>	</g>	<g id="shape19-53" v:mid="19" v:groupcontext="shape" transform="translate(27.7497,-18.12)">		<title>Rectangle.202</title>		<desc>R31:30</desc>		<v:userdefs>			<v:ud v:nameu="visVersion" v:val="VT0(10):26"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="27" cy="180.99" width="54" height="18"></v:textrect>		<rect x="0" y="171.99" width="54" height="18" class="st7"></rect>		<text x="11.48" y="183.99" class="st6" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>R31:30</text>		</g>	<g id="shape20-56" v:mid="20" v:groupcontext="shape" transform="translate(90.7497,-81.24)">		<title>Sheet.20</title>		<desc>.</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="3.49586" cy="173.21" width="7" height="33.5603"></v:textrect>		<path d="M6.99 156.43 L0 156.43 L0 189.99 L6.99 189.99 L6.99 156.43" class="st1"></path>		<text x="2.04" y="176.21" class="st2" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>.</text>		</g>	<g id="shape21-60" v:mid="21" v:groupcontext="shape" transform="translate(90.7497,-99.24)">		<title>Sheet.21</title>		<desc>.</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="3.49586" cy="173.21" width="7" height="33.5603"></v:textrect>		<path d="M6.99 156.43 L0 156.43 L0 189.99 L6.99 189.99 L6.99 156.43" class="st1"></path>		<text x="2.04" y="176.21" class="st2" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>.</text>		</g></g>
</svg>

**General registers**

### Aliased registers

Three of the general registers - R29 through R31 - support
subroutines ([calls](https://docs.qualcomm.com/doc/80-N2040-60/topic/program-flow.html#v79-prm-calls)) and the
[Software stack](https://docs.qualcomm.com/doc/80-N2040-60/topic/software-stack.html). The subroutine and stack instructions
implicitly modify the registers. R29-R31 are aliased to SP, FP, and LR respectively.

For example:

SP = add(SP, #-8)    // SP is an alias of R29
    allocframe           // Modifies SP (R29) and FP (R30)
    call init            // Modifies LR (R31)
    Copy to clipboard

General register aliases

| **Register** | **Alias** | **Name** | **Description** |
| --- | --- | --- | --- |
| R29 | SP | Stack pointer | Points to the topmost element of the stack in memory. |
| R30 | FP | Frame pointer | Points to the current stack frame. |
| R31 | LR | Link register | Stores the return address of a subroutine call. |

### Register pairs

The general registers can be specified as register pairs that
represent a single 64-bit register. For example:

R1:0 = memd(R3)                 // Load doubleword
    R7:6 = valignb(R9:8,R7:6, #2)   // Vector align
    Copy to clipboard

The first register in a register pair is always odd-numbered
and the second is the next lower register.

| **Register** | **Register pair** |
| --- | --- |
| R0 | R1:0 |
| R1 | R1:0 |
| R2 | R3:2 |
| R3 | R3:2 |
| R4 | R5:4 |
| R5 | R5:4 |
| R6 | R7:6 |
| R7 | R7:6 |
| **…** | **…** |
| R24 | R25:24 |
| R25 | R25:24 |
| R26 | R27:26 |
| R27 | R27:26 |
| R28 | R29:28 |
| R29 (SP) | R29:28 |
| R30 (FP) | R31:30 (LR:FP) |
| R31 (LR) | R31:30 (LR:FP) |
|  |  |

## Control registers

The Hexagon processor includes a set of 32-bit control registers that
provide access to processor features such as the program counter,
hardware loops, and vector predicates.

Unlike general registers, control registers are used as instruction
operands only in the following cases:

- Instructions that require a specific control register as an operand
- Register transfer instructions For example:

R2 = memw(R0++M1)   // Auto-increment addressing mode (M1)
        R9 = PC             // Get program counter (PC)
        LC1 = R3            // Set hardware loop count (LC1)
        Copy to clipboard

When a control register is used in a register transfer, the
other operand must be a general register.

<!--?xml version="1.0" encoding="UTF-8" standalone="no"?-->

<!-- Generated by Microsoft Visio, SVG Export fig_control_registers.svg Page-1 -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:v="http://schemas.microsoft.com/visio/2003/SVGExtensions/" width="5.88541in" height="4.76629in" viewbox="0 0 423.75 343.173" xml:space="preserve" color-interpolation-filters="sRGB" class="st6"><v:documentproperties v:langid="1033" v:viewmarkup="false">	<v:userdefs>		<v:ud v:nameu="msvConvertTheme"></v:ud>	</v:userdefs></v:documentproperties>
<style>.svg-2 .st1 { stroke: #2a2aea; stroke-linecap: round; stroke-linejoin: round; stroke-width: 0.749723 }
.svg-2 .st2 { stroke: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 0.75 }
.svg-2 .st3 { fill: #2a2aea; font-family: Roboto; font-size: 0.75em }
.svg-2 .st4 { fill: #ffffff; stroke: #2a2aea; stroke-linecap: round; stroke-linejoin: round; stroke-width: 0.24 }
.svg-2 .st5 { stroke: #2a2aea; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.49945 }
.svg-2 .st6 { fill: none; fill-rule: evenodd; font-size: 12px; overflow: visible; stroke-linecap: square; stroke-miterlimit: 3 }</style>
<g v:mid="0" v:index="1" v:groupcontext="foregroundPage">	<title>Page-1</title>	<v:pageproperties v:drawingscale="1" v:pagescale="1" v:drawingunits="19" v:shadowoffsetx="9" v:shadowoffsety="-9"></v:pageproperties>	<v:layer v:name="Connector" v:index="0"></v:layer>	<g id="shape1-1" v:mid="1" v:groupcontext="shape" transform="translate(108.75,-271.404)">		<title>Sheet.1</title>		<path d="M0 343.17 C4.98 343.17 8.99 341.54 8.99 339.49 L8.99 324.71 C8.99 322.66 13.04 321 17.98 321 C13.04 321 8.99					 319.36 8.99 317.31 L8.99 302.54 C8.99 300.49 4.98 298.83 0 298.83" class="st1"></path>	</g>	<g id="shape2-4" v:mid="2" v:groupcontext="shape" transform="translate(131.403,-287.272)">		<title>Sheet.2</title>		<desc>Loop registers</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="30.2984" cy="337.195" width="60.6" height="11.9549"></v:textrect>		<path d="M60.6 331.22 L0 331.22 L0 343.17 L60.6 343.17 L60.6 331.22" class="st2"></path>		<text x="1.56" y="339.9" class="st3" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>Loop registers</text>		</g>	<g id="shape3-8" v:mid="3" v:groupcontext="shape" transform="translate(27.7497,-297.423)">		<title>Rectangle.15</title>		<desc>LC0</desc>		<v:userdefs>			<v:ud v:nameu="visVersion" v:val="VT0(10):26"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="18" cy="334.173" width="36.01" height="18"></v:textrect>		<rect x="0" y="325.173" width="36" height="18" class="st4"></rect>		<text x="10.12" y="336.87" class="st3" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>LC0</text>		</g>	<g id="shape4-11" v:mid="4" v:groupcontext="shape" transform="translate(63.7497,-297.423)">		<title>Rectangle.4</title>		<desc>SA0</desc>		<v:userdefs>			<v:ud v:nameu="visVersion" v:val="VT0(10):26"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="18" cy="334.173" width="36.01" height="18"></v:textrect>		<rect x="0" y="325.173" width="36" height="18" class="st4"></rect>		<text x="9.87" y="336.87" class="st3" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>SA0</text>		</g>	<g id="shape5-14" v:mid="5" v:groupcontext="shape" transform="translate(27.7497,-271.077)">		<title>Rectangle.18</title>		<desc>LC1</desc>		<v:userdefs>			<v:ud v:nameu="visVersion" v:val="VT0(10):26"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="18" cy="334.173" width="36.01" height="18"></v:textrect>		<rect x="0" y="325.173" width="36" height="18" class="st4"></rect>		<text x="10.12" y="336.87" class="st3" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>LC1</text>		</g>	<g id="shape6-17" v:mid="6" v:groupcontext="shape" transform="translate(63.7497,-271.077)">		<title>Rectangle.19</title>		<desc>SA1</desc>		<v:userdefs>			<v:ud v:nameu="visVersion" v:val="VT0(10):26"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="18" cy="334.173" width="36.01" height="18"></v:textrect>		<rect x="0" y="325.173" width="36" height="18" class="st4"></rect>		<text x="9.87" y="336.87" class="st3" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>SA1</text>		</g>	<g id="shape7-20" v:mid="7" v:groupcontext="shape" transform="translate(27.7497,-244.077)">		<title>Rectangle.41</title>		<desc>PC</desc>		<v:userdefs>			<v:ud v:nameu="visVersion" v:val="VT0(10):26"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="18" cy="334.173" width="36.01" height="18"></v:textrect>		<rect x="0" y="325.173" width="36" height="18" class="st4"></rect>		<text x="12.23" y="336.87" class="st3" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>PC</text>		</g>	<g id="shape8-23" v:mid="8" v:groupcontext="shape" transform="translate(27.7497,-217.077)">		<title>Rectangle.40</title>		<desc>USR</desc>		<v:userdefs>			<v:ud v:nameu="visVersion" v:val="VT0(10):26"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="18" cy="334.173" width="36.01" height="18"></v:textrect>		<rect x="0" y="325.173" width="36" height="18" class="st4"></rect>		<text x="9.64" y="336.87" class="st3" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>USR</text>		</g>	<g id="shape9-26" v:mid="9" v:groupcontext="shape" transform="translate(48.1529,-219.772)">		<title>Sheet.9</title>		<desc>User status register</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="61.7984" cy="337.195" width="123.6" height="11.9549"></v:textrect>		<path d="M123.6 331.22 L0 331.22 L0 343.17 L123.6 343.17 L123.6 331.22" class="st2"></path>		<text x="22.7" y="339.9" class="st3" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>User status register</text>		</g>	<g id="shape10-30" v:mid="10" v:groupcontext="shape" transform="translate(18.7497,-18.7497)">		<title>Sheet.10</title>		<path d="M0 37.5 L0 343.17 L386.25 343.17 L386.25 37.5 L0 37.5" class="st5"></path>	</g>	<g id="shape11-33" v:mid="11" v:groupcontext="shape" transform="translate(70.4997,-245.622)">		<title>Sheet.11</title>		<desc>Program counter</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="33.75" cy="337.195" width="67.5" height="11.9549"></v:textrect>		<path d="M67.5 331.22 L0 331.22 L0 343.17 L67.5 343.17 L67.5 331.22" class="st2"></path>		<text x="0.01" y="339.9" class="st3" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>Program counter  </text>		</g>	<g id="shape12-37" v:mid="12" v:groupcontext="shape" transform="translate(27.7497,-190.077)">		<title>Rectangle.210</title>		<desc>M0</desc>		<v:userdefs>			<v:ud v:nameu="visVersion" v:val="VT0(10):26"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="18" cy="334.173" width="36.01" height="18"></v:textrect>		<rect x="0" y="325.173" width="36" height="18" class="st4"></rect>		<text x="11.54" y="336.87" class="st3" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>M0</text>		</g>	<g id="shape13-40" v:mid="13" v:groupcontext="shape" transform="translate(27.7497,-163.077)">		<title>Rectangle.212</title>		<desc>M1</desc>		<v:userdefs>			<v:ud v:nameu="visVersion" v:val="VT0(10):26"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="18" cy="334.173" width="36.01" height="18"></v:textrect>		<rect x="0" y="325.173" width="36" height="18" class="st4"></rect>		<text x="11.54" y="336.87" class="st3" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>M1</text>		</g>	<g id="shape14-43" v:mid="14" v:groupcontext="shape" transform="translate(88.4997,-179.599)">		<title>Sheet.14</title>		<desc>Modifier registers</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="43.7984" cy="337.195" width="87.6" height="11.9549"></v:textrect>		<path d="M87.6 331.22 L0 331.22 L0 343.17 L87.6 343.17 L87.6 331.22" class="st2"></path>		<text x="8.46" y="339.9" class="st3" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>Modifier registers</text>		</g>	<g id="shape15-47" v:mid="15" v:groupcontext="shape" transform="translate(72.7674,-163.077)">		<title>Sheet.15</title>		<path d="M0 343.17 C4.98 343.17 8.99 341.51 8.99 339.43 L8.99 324.44 C8.99 322.36 13.04 320.67 17.98 320.67 C13.04 320.67					 8.99 319.01 8.99 316.93 L8.99 301.94 C8.99 299.86 4.98 298.17 0 298.17" class="st1"></path>	</g>	<g id="shape16-50" v:mid="16" v:groupcontext="shape" transform="translate(27.7497,-136.077)">		<title>Rectangle.28</title>		<desc>P3:0</desc>		<v:userdefs>			<v:ud v:nameu="visVersion" v:val="VT0(10):26"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="18" cy="334.173" width="36.01" height="18"></v:textrect>		<rect x="0" y="325.173" width="36" height="18" class="st4"></rect>		<text x="9.02" y="336.87" class="st3" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>P3:0</text>		</g>	<g id="shape17-53" v:mid="17" v:groupcontext="shape" transform="translate(27.7497,-109.077)">		<title>Rectangle.31</title>		<desc>UGP</desc>		<v:userdefs>			<v:ud v:nameu="visVersion" v:val="VT0(10):26"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="18" cy="334.173" width="36.01" height="18"></v:textrect>		<rect x="0" y="325.173" width="36" height="18" class="st4"></rect>		<text x="9.18" y="336.87" class="st3" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>UGP</text>		</g>	<g id="shape18-56" v:mid="18" v:groupcontext="shape" transform="translate(63.7497,-138)">		<title>Sheet.18</title>		<desc>Predicate registers</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="43.7984" cy="337.195" width="87.6" height="11.9549"></v:textrect>		<path d="M87.6 331.22 L0 331.22 L0 343.17 L87.6 343.17 L87.6 331.22" class="st2"></path>		<text x="6.11" y="339.9" class="st3" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>Predicate registers</text>		</g>	<g id="shape19-60" v:mid="19" v:groupcontext="shape" transform="translate(65.9997,-112.099)">		<title>Sheet.19</title>		<desc>User general pointer</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="43.7984" cy="337.195" width="87.6" height="11.9549"></v:textrect>		<path d="M87.6 331.22 L0 331.22 L0 343.17 L87.6 343.17 L87.6 331.22" class="st2"></path>		<text x="3.54" y="339.9" class="st3" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>User general pointer</text>		</g>	<g id="shape20-64" v:mid="20" v:groupcontext="shape" transform="translate(27.7497,-82.0766)">		<title>Rectangle.70</title>		<desc>GP</desc>		<v:userdefs>			<v:ud v:nameu="visVersion" v:val="VT0(10):26"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="18" cy="334.173" width="36.01" height="18"></v:textrect>		<rect x="0" y="325.173" width="36" height="18" class="st4"></rect>		<text x="12.1" y="336.87" class="st3" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>GP</text>		</g>	<g id="shape21-67" v:mid="21" v:groupcontext="shape" transform="translate(56.9997,-85.0991)">		<title>Sheet.21</title>		<desc>Global pointer</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="40.5" cy="337.195" width="81" height="11.9549"></v:textrect>		<path d="M81 331.22 L0 331.22 L0 343.17 L81 343.17 L81 331.22" class="st2"></path>		<text x="12.56" y="339.9" class="st3" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>Global pointer</text>		</g>	<g id="shape22-71" v:mid="22" v:groupcontext="shape" transform="translate(27.7497,-54.7497)">		<title>Rectangle.22</title>		<desc>CS0</desc>		<v:userdefs>			<v:ud v:nameu="visVersion" v:val="VT0(10):26"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="18" cy="334.173" width="36.01" height="18"></v:textrect>		<rect x="0" y="325.173" width="36" height="18" class="st4"></rect>		<text x="9.87" y="336.87" class="st3" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>CS0</text>		</g>	<g id="shape23-74" v:mid="23" v:groupcontext="shape" transform="translate(27.7497,-27.7497)">		<title>Rectangle.23</title>		<desc>CS1</desc>		<v:userdefs>			<v:ud v:nameu="visVersion" v:val="VT0(10):26"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="18" cy="334.173" width="36.01" height="18"></v:textrect>		<rect x="0" y="325.173" width="36" height="18" class="st4"></rect>		<text x="9.87" y="336.87" class="st3" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>CS1</text>		</g>	<g id="shape24-77" v:mid="24" v:groupcontext="shape" transform="translate(90.7497,-44.2723)">		<title>Sheet.24</title>		<desc>Circular start registers</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="49.5" cy="337.195" width="99.01" height="11.9549"></v:textrect>		<path d="M99 331.22 L0 331.22 L0 343.17 L99 343.17 L99 331.22" class="st2"></path>		<text x="5.06" y="339.9" class="st3" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>Circular start registers</text>		</g>	<g id="shape25-81" v:mid="25" v:groupcontext="shape" transform="translate(72.7674,-27.7497)">		<title>Sheet.25</title>		<path d="M0 343.17 C4.98 343.17 8.99 341.51 8.99 339.43 L8.99 324.44 C8.99 322.36 13.04 320.67 17.98 320.67 C13.04 320.67					 8.99 319.01 8.99 316.93 L8.99 301.94 C8.99 299.86 4.98 298.17 0 298.17" class="st1"></path>	</g>	<g id="shape26-84" v:mid="26" v:groupcontext="shape" transform="translate(198.75,-297.75)">		<title>Rectangle.26</title>		<desc>UPCYCLELO</desc>		<v:userdefs>			<v:ud v:nameu="visVersion" v:val="VT0(10):26"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="36" cy="334.173" width="72" height="18"></v:textrect>		<rect x="0" y="325.173" width="72" height="18" class="st4"></rect>		<text x="11.19" y="336.87" class="st3" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>UPCYCLELO</text>		</g>	<g id="shape27-87" v:mid="27" v:groupcontext="shape" transform="translate(198.75,-270.75)">		<title>Rectangle.27</title>		<desc>UPCYCLEHI</desc>		<v:userdefs>			<v:ud v:nameu="visVersion" v:val="VT0(10):26"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="36" cy="334.173" width="72" height="18"></v:textrect>		<rect x="0" y="325.173" width="72" height="18" class="st4"></rect>		<text x="12.27" y="336.87" class="st3" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>UPCYCLEHI</text>		</g>	<g id="shape28-90" v:mid="28" v:groupcontext="shape" transform="translate(297.75,-287.272)">		<title>Sheet.28</title>		<desc>Cycle count registers</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="45" cy="337.195" width="90.01" height="11.9549"></v:textrect>		<path d="M90 331.22 L0 331.22 L0 343.17 L90 343.17 L90 331.22" class="st2"></path>		<text x="2.99" y="339.9" class="st3" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>Cycle count registers</text>		</g>	<g id="shape29-94" v:mid="29" v:groupcontext="shape" transform="translate(279.75,-270.75)">		<title>Sheet.29</title>		<path d="M0 343.17 C4.98 343.17 9 341.51 9 339.43 L9 324.44 C9 322.36 13.05 320.67 18 320.67 C13.05 320.67 9 319.01 9					 316.93 L9 301.94 C9 299.86 4.98 298.17 0 298.17" class="st1"></path>	</g>	<g id="shape30-97" v:mid="30" v:groupcontext="shape" transform="translate(198.75,-243.75)">		<title>Rectangle.30</title>		<desc>FRAMELIMIT</desc>		<v:userdefs>			<v:ud v:nameu="visVersion" v:val="VT0(10):26"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="36" cy="334.173" width="72" height="18"></v:textrect>		<rect x="0" y="325.173" width="72" height="18" class="st4"></rect>		<text x="9.84" y="336.87" class="st3" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>FRAMELIMIT</text>		</g>	<g id="shape31-100" v:mid="31" v:groupcontext="shape" transform="translate(198.75,-216.75)">		<title>Rectangle.31</title>		<desc>FRAMEKEY</desc>		<v:userdefs>			<v:ud v:nameu="visVersion" v:val="VT0(10):26"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="36" cy="334.173" width="72" height="18"></v:textrect>		<rect x="0" y="325.173" width="72" height="18" class="st4"></rect>		<text x="13.24" y="336.87" class="st3" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>FRAMEKEY</text>		</g>	<g id="shape32-103" v:mid="32" v:groupcontext="shape" transform="translate(276.451,-246.772)">		<title>Sheet.32</title>		<desc>Stack bounds register</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="43.7984" cy="337.195" width="87.6" height="11.9549"></v:textrect>		<path d="M87.6 331.22 L0 331.22 L0 343.17 L87.6 343.17 L87.6 331.22" class="st2"></path>		<text x="0.21" y="339.9" class="st3" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>Stack bounds register</text>		</g>	<g id="shape33-107" v:mid="33" v:groupcontext="shape" transform="translate(275.403,-219)">		<title>Sheet.33</title>		<desc>Stack smash register</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="43.7984" cy="337.195" width="87.6" height="11.9549"></v:textrect>		<path d="M87.6 331.22 L0 331.22 L0 343.17 L87.6 343.17 L87.6 331.22" class="st2"></path>		<text x="1.62" y="339.9" class="st3" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>Stack smash register</text>		</g>	<g id="shape34-111" v:mid="34" v:groupcontext="shape" transform="translate(198.75,-189.75)">		<title>Rectangle.34</title>		<desc>PKTCOUNTLO</desc>		<v:userdefs>			<v:ud v:nameu="visVersion" v:val="VT0(10):26"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="36.0044" cy="334.173" width="72.01" height="18"></v:textrect>		<rect x="0" y="325.173" width="72.0088" height="18" class="st4"></rect>		<text x="7.31" y="336.87" class="st3" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>PKTCOUNTLO</text>		</g>	<g id="shape35-114" v:mid="35" v:groupcontext="shape" transform="translate(198.75,-162.75)">		<title>Rectangle.35</title>		<desc>PKTCOUNTHI</desc>		<v:userdefs>			<v:ud v:nameu="visVersion" v:val="VT0(10):26"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="36.0044" cy="334.173" width="72.01" height="18"></v:textrect>		<rect x="0" y="325.173" width="72.0088" height="18" class="st4"></rect>		<text x="8.39" y="336.87" class="st3" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>PKTCOUNTHI</text>		</g>	<g id="shape36-117" v:mid="36" v:groupcontext="shape" transform="translate(297.75,-171.75)">		<title>Sheet.36</title>		<desc>Packet count registers</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="49.5" cy="329.673" width="99.01" height="27"></v:textrect>		<path d="M99 316.17 L0 316.17 L0 343.17 L99 343.17 L99 316.17" class="st2"></path>		<text x="4.6" y="332.37" class="st3" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>Packet count registers</text>		</g>	<g id="shape37-121" v:mid="37" v:groupcontext="shape" transform="translate(279.75,-162.75)">		<title>Sheet.37</title>		<path d="M0 343.17 C4.98 343.17 8.99 341.51 8.99 339.43 L8.99 324.44 C8.99 322.36 13.04 320.67 17.98 320.67 C13.04 320.67					 8.99 319.01 8.99 316.93 L8.99 301.94 C8.99 299.86 4.98 298.17 0 298.17" class="st1"></path>	</g>	<g id="shape38-124" v:mid="38" v:groupcontext="shape" transform="translate(198.75,-135.75)">		<title>Rectangle.38</title>		<desc>UTIMERLO</desc>		<v:userdefs>			<v:ud v:nameu="visVersion" v:val="VT0(10):26"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="36.0044" cy="334.173" width="72.01" height="18"></v:textrect>		<rect x="0" y="325.173" width="72.0088" height="18" class="st4"></rect>		<text x="14.41" y="336.87" class="st3" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>UTIMERLO</text>		</g>	<g id="shape39-127" v:mid="39" v:groupcontext="shape" transform="translate(198.75,-108.75)">		<title>Rectangle.39</title>		<desc>UTIMERHI</desc>		<v:userdefs>			<v:ud v:nameu="visVersion" v:val="VT0(10):26"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="36.0044" cy="334.173" width="72.01" height="18"></v:textrect>		<rect x="0" y="325.173" width="72.0088" height="18" class="st4"></rect>		<text x="15.49" y="336.87" class="st3" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>UTIMERHI</text>		</g>	<g id="shape40-130" v:mid="40" v:groupcontext="shape" transform="translate(289.951,-125.272)">		<title>Sheet.40</title>		<desc>Qtimer registers</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="44.3992" cy="337.195" width="88.8" height="11.9549"></v:textrect>		<path d="M88.8 331.22 L0 331.22 L0 343.17 L88.8 343.17 L88.8 331.22" class="st2"></path>		<text x="12.24" y="339.9" class="st3" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>Qtimer registers</text>		</g>	<g id="shape41-134" v:mid="41" v:groupcontext="shape" transform="translate(279.75,-108.75)">		<title>Sheet.41</title>		<path d="M0 343.17 C4.98 343.17 8.99 341.51 8.99 339.43 L8.99 324.44 C8.99 322.36 13.04 320.67 17.98 320.67 C13.04 320.67					 8.99 319.01 8.99 316.93 L8.99 301.94 C8.99 299.86 4.98 298.17 0 298.17" class="st1"></path>	</g></g>
</svg>

**Control registers**

### Aliased registers

The control registers have numeric aliases (C0 through C31). The control register numbers (0 through 31)
specify the control registers in  [Instruction encoding](https://docs.qualcomm.com/doc/80-N2040-60/topic/instruction-encoding.html).

Aliased control registers

| **Register** | **Alias** | **Name** |
| --- | --- | --- |
| SA0 | C0 | Loop start address register 0 |
| LC0 | C1 | Loop count register 0 |
| SA1 | C2 | Loop start address register 1 |
| LC1 | C3 | Loop count register 1 |
| P3:0 | C4 | Predicate registers 3:0 |
| reserved | C5 |  |
| M0 | C6 | Modifier register 0 |
| M1 | C7 | Modifier register 1 |
| USR | C8 | User status register |
| PC | C9 | Program counter |
| UGP | C10 | User general pointer |
| GP | C11 | Global pointer |
| CS0 | C12 | Circular start register 0 |
| CS1 | C13 | Circular start register 1 |
| UPCYCLELO | C14 | Cycle count register (low) |
| UPCYCLEHI | C15 | Cycle count register (high) |
| UPCYCLE | C15:14 | Cycle count register |
| FRAMELIMIT | C16 | Frame limit register |
| FRAMEKEY | C17 | Frame key register |
| PKTCOUNTLO | C18 | Packet count register (low) |
| PKTCOUNTHI | C19 | Packet count register (high) |
| PKTCOUNT | C19:18 | Packet count register |
| reserved | C20-29 |  |
| UTIMERLO | C30 | QTimer register (low) |
| UTIMERHI | C31 | QTimer register (high) |
| UTIMER | C31:30 | QTimer register |

### Control register pairs

The control registers can be specified as register pairs that
represent a single 64-bit register. Control registers specified as
pairs must use their numeric aliases. For example:

C1:0 = R5:4      / C1:0 specifies the LC0/SA0 register pair
    Copy to clipboard

The first register in a control register pair must always
be odd-numbered, and the second must be the next lower register.

| **Register** | **Register pair** |
| --- | --- |
| C0 | C1:0 |
| C1 | C1:0 |
| C2 | C3:2 |
| C3 | C3:2 |
| C4 | C5:4 |
| C5 | C5:4 |
| C6 | C7:6 |
| C7 | C7:6 |
| **…** | **…** |
| C30 | C31:30 |
| C31 | C31:30 |
|  |  |

### Program counter

The program counter (PC) register points to the instruction
packet to execute ([instruction packets](https://docs.qualcomm.com/doc/80-N2040-60/topic/instructions.html#v79-prm-instruction-packets)).

The PC is read-only and updates when the current packet completes.

Instruction execution modifies the PC. For example:

R7 = PC    // Get program counter
    Copy to clipboard

### Loop registers

The Hexagon processor includes two sets of loop registers to support
nested [Hardware loops](https://docs.qualcomm.com/doc/80-N2040-60/topic/registers.html#hardware-loops). Each hardware loop is
implemented with a pair of registers containing the loop count and
loop start address. The loop instruction implicitly modifies the loop
registers, but the loop instructions can also be accessed directly.
For example:

loop0(start, R4)   // Modifies LC0 and SA0  (LC0 = R4, SA0 = start)
    LC1 = R22          // Set loop1 count
    R9 = SA1           // Get loop1 start address
    Copy to clipboard

Loop registers

| **Register** | **Name** | **Description** |
| --- | --- | --- |
| LC0, LC1 | Loop count | Number of loop iterations to execute. |
| SA0, SA1 | Loop start address | Address of first instruction in loop. |

### User status register

The user status register (USR) stores processor status and control
bits that user programs can access. The status bits contain the
status results of certain instructions, while the control bits
contain user-settable processor modes for hardware prefetching. For
example:

R9:8 = vaddw(R9:8, R3:2):sat    // Vector add words
    R6 = USR                        // Get saturation status
    Copy to clipboard

USR stores the following status and control values:

- [Cache prefetch types supported by the Hexagon processor](https://docs.qualcomm.com/doc/80-N2040-60/topic/registers.html#cache-prefetch-types-supported-by-the-hexagon-processor) enable
- Cache prefetch status
- [Floating point](https://docs.qualcomm.com/doc/80-N2040-60/topic/registers.html#floating-point) modes
- Floating point status
- Floating point exception enable
- Hardware loop configuration ([hardware loops](https://docs.qualcomm.com/doc/80-N2040-60/topic/program-flow.html#v79-prm-hardware-loops))
- Sticky [Saturation](https://docs.qualcomm.com/doc/80-N2040-60/topic/registers.html#saturation) overflow

A user control register transfer to USR cannot be grouped
in an instruction packet with a
[Floating point](https://docs.qualcomm.com/doc/80-N2040-60/topic/registers.html#floating-point) instruction.

When a transfer to USR changes the enable trap bits [29:25], an isync
instruction ([memory ordering](https://docs.qualcomm.com/doc/80-N2040-60/topic/memory.html#v79-prm-memory-ordering)) must execute before
the new exception programming can take effect.

User status register

| **Name** | **RW** | **Bits** | **Field** | **Description** |
| --- | --- | --- | --- | --- |
| USR |  | 32 |  | User status register |
|  | R | 31 | PFA | L2 prefetch active.<br><ul class="simple"><br><li><p>1: l2fetch instruction in progress</p></li><br><li><p>0: l2fetch finished (or inactive)</p></li><br></ul><br><br>Set when the nonblocking l2fetch instruction prefetches<br>therequested data.<br><br><br>Remains set until thel2fetch prefetch operation completes<br>(or is inactive). |
|  | R | 30 | reserved | Reserved. |
|  | RW | 29 | FPINEE | Enable exception on IEEE inexact. |
|  | RW | 28 | FPUNFE | Enable exception on IEEE underflow. |
|  | RW | 27 | FPOVFE | Enable exception on IEEE overflow. |
|  | RW | 26 | FPDBZE | Enable exception on IEEE divide-by-zero. |
|  | RW | 25 | FPINVE | Enable exception on IEEE invalid. |
|  | R | 24 | reserved | Reserved |
|  | RW | 23:22 | FPRND | Rounding mode for floating point instructions.<br><ul class="simple"><br><li><p>00: Round to nearest, ties to even (default)</p></li><br><li><p>01: Toward zero</p></li><br><li><p>10: Downward (toward negative infinity)</p></li><br><li><p>11: Upward (toward positive infinity)</p></li><br></ul> |
|  | R | 21:20 | FPCOPROC | Controls IEEE-754 floating point behavior.<br><ul class="simple"><br><li><p>USR[20]: When set to 1, max exponent represents IEEE-754 Infinity or NaN</p></li><br><li><p>USR[21]: When set to 1, IEEE-754 Infinity and NaN representation is IEEE-754 compliant instead of a finite overflow.</p></li><br></ul><br><br>Both bits set to 1 gives IEEE-754 behavior. |
|  | R | 19:18 | reserved | Reserved |
|  | R | 17 | reserved | Reserved. |
|  | RW | 16:15 | HFI | L1 instruction prefetch.<br><ul class="simple"><br><li><p>00: Disable</p></li><br><li><p>01: Enable (1 line)</p></li><br><li><p>10: Enable (2 lines)</p></li><br><li><p>11: Reserved</p></li><br></ul> |
|  | RW | 14:13 | HFD | L1 data cache prefetch.<br><br><br>Four levels are defined from disabled to aggressive.<br>Implementation defines how to interpret these levels.<br><ul class="simple"><br><li><p>00: disable</p></li><br><li><p>01: conservative</p></li><br><li><p>10: moderate</p></li><br><li><p>11: aggressive</p></li><br></ul> |
|  | RW | 12 | PCMME | Enable packet counting in monitor mode. |
|  | RW | 11 | PCGME | Enable packet counting in guest mode. |
|  | RW | 10 | PCUME | Enable packet counting in user mode. |
|  | RW | 9:8 | LPCFGE | Hardware loop configuration.<br><br><br>Number of loop iterations (0 to 3) that remain before the<br>pipeline predicate should be set. |
|  | R | 7:6 | reserved | Reserved. |
|  | RW | 5 | FPINPF | Floating-point IEEE inexact sticky fag. Remains set until explicitly cleared. |
|  | RW | 4 | FPUNFF | Floating-point IEEE underflow sticky flag. Remains set until explicitly cleared. |
|  | RW | 3 | FPOVFF | Floating-point IEEE overflow sticky flag. Remains set until explicitly cleared. |
|  | RW | 2 | FPDBZF | Floating-point IEEE divide-by-zero sticky flag. Remains set until explicitly cleared. |
|  | RW | 1 | FPINVF | Floating-point IEEE invalid sticky flag. Remains set until explicitly cleared. |
|  | RW | 0 | OVF | Sticky saturation overflow.<br><ul class="simple"><br><li><p>1: saturation occurred for :sat instructions</p></li><br><li><p>0: no saturation</p></li><br></ul><br><br>Remains set until explicitly cleared. |

### Modifier registers

The following addressing modes use the modifier registers (M0 and M1):

#### Indirect auto-increment

In [indirect with auto-increment register](https://docs.qualcomm.com/doc/80-N2040-60/topic/memory.html#v79-prm-indirect-with-auto-increment-register)
addressing, the modifier registers store a signed 32-bit value that specifies the
increment or decrement value.

R2 = memw(R0++M1)
    Copy to clipboard

Modifier registers used in indirect auto-increment addressing

| **Register** | **Name** | **Description** |
| --- | --- | --- |
| M0, M1 | Increment | Signed auto-increment value. |

#### Circular

In [circular addressing](https://docs.qualcomm.com/doc/80-N2040-60/topic/memory.html#v79-prm-circular-with-auto-increment-immediate), the modifier
registers store the circular buffer length and related “I” values.

R2 = memw(R2++#8:circ(M0))
    Copy to clipboard

Modifier registers as used in circular addressing

| **Name** | **RW** | **Bits** | **Field** | **Description** |
| --- | --- | --- | --- | --- |
| M0, M1 |  | 32 |  | Circular buffer specifier. |
|  | RW | 31:28 | I[10:7] | I value (MSB - see [cirular with auto-increment](https://docs.qualcomm.com/doc/80-N2040-60/topic/memory.html#v79-prm-circular-with-auto-increment-register)) |
|  | RW | 27:24 |  | 0x0 |
|  | RW | 23:17 | I[6:0] | I value (LSB) |
|  | RW | 16:0 | Length | Circular buffer length |

#### Bit-reversed

In [bit-reversed addressing](https://docs.qualcomm.com/doc/80-N2040-60/topic/memory.html#v79-prm-bit-reversed-with-auto-increment-register),
the modifier registers store a signed 32-bit value that specifies
the increment or decrement value.

R2 = memw(R0++M1:brev)
    Copy to clipboard

Modifier registers as used in bit-reversed addressing

| **Register** | **Name** | **Description** |
| --- | --- | --- |
| M0, M1 | Increment | Signed auto-increment value. |

### Predicate registers

The predicate registers (P0 through P3) store the status results of
the scalar and vector compare instructions
([Conditional execution](https://docs.qualcomm.com/doc/80-N2040-60/topic/conditional-execution.html)).
For example:

P1 = cmp.eq(R2, R3)   // Scalar compare
    if (P1) jump end      // Jump to address (conditional)
    R8 = P1               // Get compare status (P1 only)
    P3:0 = R4             // Set compare status (P0 through P3)
    Copy to clipboard

Unlike the other control registers, the predicate registers are only 8 bits wide
because instructions return a maximum of eight status results. The register
quadruple (P3:0) accesses the four 8-bit predicates as a single 32-bit register.

P3:0 = R4             // Set compare status (P0 through P3)
    Copy to clipboard

Predicate registers

| **Register** | **Bits** | **Description** |
| --- | --- | --- |
| P0, P1, P2, P3 | 8 | Compare status results. |
| P3:0 | 32 | Compare status results. |
|  | 31:24 | P3 register |
|  | 23:16 | P2 register |
|  | 15:8 | P1 register |
|  | 7:0 | P0 register |

### Circular start registers

The circular start registers (CS0 and CS1) store the start
address of a circular buffer in
[circular addressing](https://docs.qualcomm.com/doc/80-N2040-60/topic/memory.html#v79-prm-circular-with-auto-increment-immediate).
For example:

CS0 = R5                      // Set circ start register
    M0 = R7                       // Set modifier register
    R0 = memb(R2++#4:circ(M0))    // Load from circ buffer pointed
                                  // to by CS0 with size/K vals in M0
    Copy to clipboard

Circular start registers

| **Register** | **Name** | **Description** |
| --- | --- | --- |
| CS0, CS1 | Circular start | Circular buffer start address. |

### User general pointer register

The user general pointer (UGP) register is a general-purpose control
register. For example:

R9 = UGP   // Get UGP
    UGP = R3   // Set UGP
    Copy to clipboard

User general pointer register

| **Register** | **Name** | **Description** |
| --- | --- | --- |
| UGP | User general pointer | General-purpose control register. |

### Global pointer

GP-relative addressing uses the global pointer (GP). For
example:

GP = R7               // Set GP
    R2 = memw(GP+#200)    // GP-relative load
    Copy to clipboard

Global pointer register

| **Name** | **R/W** | **Bits** | **Field** | **Description** |
| --- | --- | --- | --- | --- |
| GP |  | 32 |  | Global pointer register |
|  | R/W | 31:6 | GDP | [Global data pointer](https://docs.qualcomm.com/doc/80-N2040-60/topic/memory.html#v79-prm-global-pointer-relative). |
|  | R | 5:0 | reserved | Reserved. |

### Cycle count registers

The cycle count registers UPCYCLELO and UPCYCLEHI together store a 64-bit
value containing the current number of processor cycles executed
since the Hexagon processor was last reset. For example:

R5 = UPCYCLEHI    // Get cycle count (high)
    R4 = UPCYCLELO    // Get cycle count (low)
    R5:4 = UPCYCLE    // Get cycle count
    Copy to clipboard

System software controls access to these registers. When access is disabled, read operations return 0.

Cycle count registers

| **Register** | **Name** | **Description** |
| --- | --- | --- |
| UPCYCLELO | Cycle count (low) | Processor cycle count (low 32 bits) |
| UPCYCLEHI | Cycle count (high) | Processor cycle count (high 32 bits) |
| UPCYCLE | Cycle count | Processor cycle count (64 bits) |

### Frame limit register

The FRAMELIMIT register stores the low address of the
memory area reserved for the software stack
([stack bounds checking](https://docs.qualcomm.com/doc/80-N2040-60/topic/software-stack.html#v79-prm-stack-bounds-checking)).
For example:

R9 = FRAMELIMIT      // Get frame limit register
    FRAMELIMIT = R3      // Set frame limit register
    Copy to clipboard

Frame limit register

| **Register** | **Name** | **Description** |
| --- | --- | --- |
| FRAMELIMIT | Frame limit | Low address of software stack area. |

### Frame key register

The processor XORs the return address with the FRAMEKEY when pushing the address
on the software stack ([stack smashing protection](https://docs.qualcomm.com/doc/80-N2040-60/topic/software-stack.html#v79-prm-stack-smashing-protection)).
For example:

R2 = FRAMEKEY    // Get frame key register
    FRAMEKEY = R1    // Set frame key register
    Copy to clipboard

Frame key register

| **Register** | **Name** | **Description** |
| --- | --- | --- |
| FRAMEKEY | Frame key | Key to scramble return addresses stored on the software stack. |

### Packet count registers

The packet count registers PKTCOUNTLO and PKTCOUNTHI store a 64-bit
value containing the current number of instruction packets executed
since a packet count register was last written. For example:

R9 = PKTCOUNTHI    // Get packet count (high)
    R8 = PKTCOUNTLO    // Get packet count (low)
    R9:8 = PKTCOUNT    // Get packet count
    Copy to clipboard

Packet counting can be configured to operate only in specific sets of
processor modes (for example, user mode only, or guest and monitor
modes only). USR[12:10]
[User status](https://docs.qualcomm.com/doc/80-N2040-60/topic/registers.html#user-status-register)
[register](https://docs.qualcomm.com/doc/80-N2040-60/topic/registers.html#user-status-register) control the configuration for
each mode.

Packets with exceptions are not counted as committed packets.

System software controls access to these register. When access is disabled, read operations return 0.

When a value is written to a packet count register, the 64-bit packet
count value is incremented before the value is stored in the
register.

Packet count registers

| **Register** | **Name** | **Description** |
| --- | --- | --- |
| PKTCOUNTLO | Packet count (low) | Processor packet count (low 32 bits) |
| PKTCOUNTHI | Packet count (high) | Processor packet count (high 32 bits) |
| PKTCOUNT | Cycle count | Processor packet count (64 bits) |

### QTimer registers

The QTimer registers UTIMERLO and UTIMERHI provide access to the
QTimer global reference count value. The QTimer registers enable Hexagon
software to read the 64-bit time value without having to perform an
advanced high-performance bus (AHB) load. For example:

R5 = UTIMERHI    // Get QTimer reference count (high)
    R4 = UTIMERLO    // Get QTimer reference count (low)
    R5:4 = UTIMER    // Get QTimer reference count
    Copy to clipboard

These registers are read only and hardware automatically updates these
registers with the current QTimer value.

System software controls access to these registers. When access is disabled, read operations return 0.

QTimer registers

| **Register** | **Name** | **Description** |
| --- | --- | --- |
| UTIMERLO | QTimer (low) | QTimer global reference count (low 32 bits) |
| UTIMERHI | QTimer (high) | QTimer global reference count (high 32 bits) |
| UTIMER | QTimer | QTimer global reference count (64 bits) |

### UPMUCNT registers

The eight 32-bit read-only User PMU Count (UPMUCNT) registers count performance events. The counters increment
each time a selected event occurs and wrap-around on overflow. These registers have undefined
value on reset. SSR.PE enables access to the UPMUCNT registers.

UPMU counter registers

| **Register** | **Fields** | **Access** |
| --- | --- | --- |
| UPMUCNT0 | [31:0] PMU Counter 0 | Monitor CR map RW |
| UPMUCNT1 | [31:0] PMU Counter 1 | Monitor CR map RW |
| UPMUCNT2 | [31:0] PMU Counter 2 | Monitor CR map RW |
| UPMUCNT3 | [31:0] PMU Counter 3 | Monitor CR map RW |
| UPMUCNT4 | [31:0] PMU Counter 4 | Monitor CR map RW |
| UPMUCNT5 | [31:0] PMU Counter 5 | Monitor CR map RW |
| UPMUCNT6 | [31:0] PMU Counter 6 | Monitor CR map RW |
| UPMUCNT7 | [31:0] PMU Counter 7 | Monitor CR map RW |

Last Published: Jan 16, 2025

[Previous Topic
Revision history](https://docs.qualcomm.com/bundle/publicresource/80-N2040-60/topics/revision.md) [Next Topic
Instructions](https://docs.qualcomm.com/bundle/publicresource/80-N2040-60/topics/instructions.md)

Source: [https://docs.qualcomm.com/doc/80-N2040-60/topic/registers.html](https://docs.qualcomm.com/doc/80-N2040-60/topic/registers.html)