# US 7,080,236 B2 · Updating stack pointer based on instruction bit indicator without executing an update microinstruction

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

- Number: US 7,080,236 B2
- Document ID: US7080236B2
- Status: Granted
- Kind: B2
- Application number: 10/262,214
- Filed: 2002-09-30
- Published: 2004-04-01
- Granted: 2006-07-18
- Earliest claimed: 2002-09-30
- Assignees: Intel Corporation
- Inventors: Stephan J. Jourdan; Alan B. Kyker; Nicholas G. Samra
- Web page: https://patentgrep.com/patent/US7080236B2

## CPC

- G06F 9/30101: {Special purpose registers}
- G06F 9/3854: {Instruction completion, e.g. retiring, committing or graduating}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A stack pointer update technique in which the stack pointer is updated without executing micro-operations to add or subtract a stack pointer value. The stack pointer update technique is also described to reset the stack pointer to a predetermined value without executing micro-operations to add or subtract stack a stack pointer value.

## Claims

### Claim 1

An apparatus comprising:
a first unit to execute a first instruction, the first instruction comprising a first micro-operation (uop);
a second unit to access a value in a memory in response to the first uop being executed by the first unit;
a third unit to update a pointer to the memory in response to decoding a first bit field within the first instruction without the first uop first being executed.

### Claim 2 (depends on 1)

The apparatus of claim 1 wherein the third unit comprises a first storage unit to store a stack pointer offset value.

### Claim 3 (depends on 2)

The apparatus of claim 2 wherein the third unit comprises a second storage unit to store a pointer to a stack pointer base value.

### Claim 4 (depends on 3)

The apparatus of claim 3 wherein a stack pointer value is equal to the sum of the stack pointer base value and the stack pointer offset value.

### Claim 5 (depends on 1)

The apparatus of claim 1 wherein the third unit is positioned to receive the first bit field before the first uop is executed by the first unit.

### Claim 6 (depends on 5)

The apparatus of claim 5 wherein the first instruction is a pop instruction and the first uop is a load uop.

### Claim 7 (depends on 5)

The apparatus of claim 5 wherein the first instruction is a push instruction and the first uop is a store uop.

### Claim 8

A system comprising:
a memory unit to store a first instruction comprising a first micro-operation (uop), the first instruction comprising a bit field to indicate whether the first instruction will change a stack pointer when executed;
a processor to decode the bit field and update the stack pointer according to the first instruction without the first uop first being executed by the processor.

### Claim 9 (depends on 8)

The system of claim 8 wherein the memory unit further comprises a second instruction to reset the stack pointer to an updated stack pointer value, the second instruction comprising a second uop to read a current stack pointer value and a third uop to change the current stack pointer by an immediate value.

### Claim 10 (depends on 9)

The system of claim 9 wherein the processor comprises logic to add a base stack pointer value to an offset stack pointer value to yield the current stack pointer value after fetching the second instruction.

### Claim 11 (depends on 10)

The system of claim 10 wherein the processor comprises logic to add the current stack pointer value to the immediate value to yield the updated stack pointer value after fetching the second instruction.

### Claim 12 (depends on 11)

The system of claim 11 wherein the first instruction is a pop instruction and the first uop is a load operation.

### Claim 13 (depends on 11)

The system of claim 11 wherein the first instruction is a push instruction and the first uop is a store operation.

### Claim 14 (depends on 11)

The system of claim 11 wherein the first uop is a no-operation (nop).

### Claim 15

A method comprising:
fetching a first instruction, the first instruction comprising a first micro-operation (uop) to access a stack and a bit field;
decoding the bit field in order to determine whether the first uop is to access the stack;
changing the stack pointer by a first value corresponding to a size of data to be accessed by the first uop without the first uop first being executed.

### Claim 16 (depends on 15)

The method of claim 15 wherein the changing of the stack pointer comprises adding the first value and a stack pointer offset value and a stack pointer base value.

### Claim 17 (depends on 16)

The method of claim 16 further comprising executing the first uop independently of the changing of the stack pointer.

### Claim 18 (depends on 15)

The method of claim 15 further comprising fetching a second instruction to reset the stack pointer, the second instruction comprising an immediate value.

### Claim 19 (depends on 18)

The method of claim 18 wherein the stack pointer is reset to a value to be determined by reading a stack pointer base value, adding a sum of the stack pointer base value and a stack pointer offset value to the immediate value.

### Claim 20 (depends on 17)

The method of claim 17 wherein the first instruction is a pop instruction and the first uop is a load operation.

### Claim 21 (depends on 17)

The method of claim 17 wherein the first instruction is a push instruction and the first uop is a push operation.

### Claim 22 (depends on 15)

The method of claim 15 wherein determining a stack pointer value to which the stack pointer is to be changed does not require executing a uop.

### Claim 23

A machine-readable medium having stored thereon a set of instructions, which when executed by a machine cause the machine to perform a method comprising:
decoding a bit field to indicate whether a stack painter is to be updated as a result of executing a first instruction;
determining an updated stack pointer value without the first instruction first being executed, the determining comprising adding a sum of a stack pointer base value and a stack painter offset value to a value corresponding to a size of data to be accessed by the first instruction.

### Claim 24 (depends on 23)

The machine-readable medium of claim 23 wherein the size of data is 16 or 32 bytes.

### Claim 25 (depends on 24)

The machine-readable medium of claim 24 wherein the bit field indicates that the stack pointer is to be updated if the first instruction is a push or pop instruction.

### Claim 26 (depends on 25)

The machine-readable medium of claim 25 wherein the bit field is stored within the first instruction.

### Claim 27 (depends on 23)

The machine-readable medium of claim 23 wherein the stack pointer offset value is changed by a value equal to a sum of the stack pointer offset value and the value corresponding to the size of data to be accessed by the first instruction.

### Claim 28 (depends on 23)

The machine-readable medium of claim 23 wherein the stack pointer is updated by a second instruction being executed, the second instruction comprising an immediate value.

### Claim 29 (depends on 28)

The machine-readable medium of claim 28 wherein the stack pointer is updated by reading the stack pointer base value and adding the immediate value to the sum of the stack pointer base value and the stack pointer offset value.

### Claim 30 (depends on 28)

The machine-readable medium of claim 28 wherein the stack pointer is updated by reading the stack pointer base value and subtracting the immediate value from the sum of the stack pointer base value and the stack pointer offset value.

### Claim 31

An apparatus comprising:
means for decoding a bit field to indicate whether executing a first instruction will change a stack pointer without the first instruction first being executed;
means for updating a stack pointer offset value in response to decoding the bit field;
means for determining a sum of a stack pointer base value, the stack pointer offset value, and a value corresponding to a size of data to be accessed by the first instruction;
means for storing the stack pointer base value and the stack pointer offset value;
means for resetting the stack pointer comprising a means for reading the stack pointer base value and a means a means for summing the stack pointer base value, stack pointer offset value, and an immediate value provided by a second instruction.

### Claim 32 (depends on 31)

The apparatus of claim 31 wherein the first instruction is a pop instruction.

### Claim 33 (depends on 31)

The apparatus of claim 31 wherein the first instruction is a push instruction.
