# US 2010/0250904 A1 · Methods and processor-related media to perform rapid returns from subroutines in microprocessors and microcontrollers

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2010/0250904 A1
- Document ID: US20100250904A1
- Status: Published application
- Kind: A1
- Application number: 12/795,582
- Filed: 2010-06-07
- Published: 2010-09-30
- Earliest claimed: 2005-06-10
- Assignees: Atmel Corporation
- Inventors: Erik K. Renno; Oyvind Strom; Morten W. Lund
- Web page: https://patentgrep.com/patent/US20100250904A1

## CPC

- G06F 9/30072: {to perform conditional operations, e.g. using predicates or guards}
- G06F 9/30054: {Unconditional branch instructions}
- G06F 9/30094: {Condition code generation, e.g. Carry, Zero flag}
- G06F 9/323: {for indirect branch instructions}
- G06F 9/3806: {using address prediction, e.g. return stack, branch history buffer}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Various embodiments include methods and related media for performing operations including a return operation. One such method includes testing a content of a return value register and setting status flags. Testing the content of the return value register and setting the status flags are performed in response to a single instruction.

## Claims

### Claim 1

A method comprising:
testing a content of a return value register; and
setting status flags that includes writing a value into a flag register to indicate a zero result based on the content of the return value register, wherein testing the content of the return value register and setting the status flags are performed in response to a single instruction, the single instruction includes a return operation.

### Claim 2 (depends on 1)

The method of claim 1, wherein the status flags are set according to a comparison of the content of the return value register with zero.

### Claim 3 (depends on 1)

The method of claim 1, wherein the single instruction is kept in an instruction decode stage for an additional cycle after the instruction is fetched.

### Claim 4 (depends on 1)

The method of claim 1, wherein the status flags are set before a content of a return address register are moved into a program counter.

### Claim 5 (depends on 1)

The method of claim 1, wherein the status flags are set before a return address is popped from a stack and moved into a program counter.

### Claim 6 (depends on 1)

The method of claim 1, wherein testing the content of the return value register is performed without a test instruction.

### Claim 7 (depends on 1)

The method of claim 1, further comprising:
loading consecutive words pointed to by a register pointer into a register specified by the single instruction, wherein the content of the return value register is tested and the status flags are updated if a program counter is loaded.

### Claim 8

A processing unit comprising:
a first portion to test a content of a return value register; and
a second portion to set status flags including writing a value into a flag register to indicate a zero result based on the content of the return value register, wherein testing the content of the return value register and setting the status flags are performed in response to a single instruction, the single instruction includes a return operation.

### Claim 9 (depends on 8)

The processing unit of claim 8, wherein the second portion is to write a content of a return address register through an arithmetic logic unit of the processor in parallel with setting of the status flags.

### Claim 10 (depends on 8)

The processing unit of claim 8, wherein the first portion is to test the content of the return value register in order to determine whether return conditions are satisfied.

### Claim 11 (depends on 8)

The processing unit of claim 8, wherein the second portion is to split the return operation into a first micro-operation for performing the return operation and a second micro-operation for performing a test operation to test the content of the return value register.

### Claim 12 (depends on 8)

The processing unit of claim 8, further comprising a first multiplexer, the first multiplexer including a first input to receive a content of a return address register, a node to receive a first control signal, and an output to enable writing the content of the return address register to a program counter when the first control signal has a first value.

### Claim 13 (depends on 12)

The processing unit of claim 12, wherein the first multiplexer further includes a second input to receive a content of a return address from memory, and wherein the first multiplexer is further to enable writing the content of the return address from the memory to the program counter when the first control signal has a second value.

### Claim 14 (depends on 13)

The processing unit of claim 13, further comprising a second multiplexer, the second multiplexer including a first input coupled to the output of the first multiplexer to receive the content of the return address register, a node to receive a second control signal, and an output to enable writing the content of the return address register to the program counter when the second control signal has a first value.

### Claim 15 (depends on 14)

The processing unit of claim 14, wherein the second multiplexer further includes a second input to receive a sequential program address, and wherein the second multiplexer is further to enable updating of the program counter with the sequential program address when the second control signal has a second value.

### Claim 16 (depends on 13)

The processing unit of claim 13, further comprising a second multiplexer, the second multiplexer including a first input coupled to the output of the first multiplexer to receive the content of the return address from the memory, a node to receive a second control signal, and an output to enable writing the content of the return address from the memory to the program counter when the second control signal has a first value.

### Claim 17 (depends on 16)

The processing unit of claim 16, wherein the second multiplexer further includes a second input to receive a sequential program address, and wherein the second multiplexer is further to enable updating of the program counter with the sequential program address when the second control signal has a second value.

### Claim 18

A non-transitory processor-readable storage medium storing instruction set that, when executed by a processor, causes the processor to perform a method, the method comprising:
testing a content of a return value register; and
setting status flags that includes writing a value into a flag register to indicate a zero result based on the content of the return value register, wherein testing the content of the return value register and setting the status flags are performed in response to a single instruction, the single instruction includes a return operation.

### Claim 19 (depends on 18)

The non-transitory processor-readable storage medium of claim 18, wherein the method further comprises:
writing a content of a return address register to a program counter in response to a first value of a first control signal; and
writing a content of a return address from memory to the program counter in response to a second value of the first control signal.

### Claim 20 (depends on 19)

The non-transitory processor-readable storage medium of claim 19, wherein the method further comprises updating of the program counter with a sequential program address in response to a second control signal, and wherein writing the content of the return address register to the program counter and writing the content of the return address from memory are performed when the second control signal has a first value, and updating the program counter with the sequential program address is performed when the second control signal has a second value, regardless of a value of the first control signal.
