# US 8,578,209 B2 · Non-faulting and first faulting instructions for processing vectors

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

- Number: US 8,578,209 B2
- Document ID: US8578209B2
- Status: Granted
- Kind: B2
- Application number: 13/588,533
- Filed: 2012-08-17
- Published: 2012-12-13
- Granted: 2013-11-05
- Earliest claimed: 2008-08-15
- Assignees: Apple Inc.
- Applicants: Jeffry E. Gonion; Keith E. Diefendorff
- Inventors: Jeffry E. Gonion; Keith E. Diefendorff
- Web page: https://patentgrep.com/patent/US8578209B2

## CPC

- G06F 9/3861: {Recovery, e.g. branch miss-prediction, exception handling (error detection or correction G06F11/00)}
- G06F 8/4441: {Reducing the execution time required by the program code}
- G06F 9/30036: {Instructions to perform operations on packed data, e.g. vector, tile or matrix operations}
- G06F 9/30038: {using a mask}
- G06F 9/30072: {to perform conditional operations, e.g. using predicates or guards}
- G06F 9/3838: {Dependency mechanisms, e.g. register scoreboarding}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

The described embodiments include a processor that handles faults during execution of a vector instruction. The processor starts by receiving a vector instruction that uses at least one vector of values that includes N elements as an input. In addition, the processor optionally receives a predicate vector that includes N elements. The processor then executes the vector instruction. In the described embodiments, when executing the vector instruction, if the predicate vector is received, for each element in the vector of values for which a corresponding element in the predicate vector is active, otherwise, for each element in the vector of values, the processor performs an operation for the vector instruction for the element in the vector of values. While performing the operation, the processor conditionally masks faults encountered (i.e., faults caused by an illegal operation).

## Claims

### Claim 1

A method for handling faults encountered while executing a vector instruction in a processor, comprising:
receiving the vector instruction, wherein the vector instruction uses at least one vector of values that includes N elements as an input;
receiving a predicate vector that includes N elements; and
executing the vector instruction, wherein executing the vector instruction involves:
for each element in the vector of values for which a corresponding element in the predicate vector is active,
performing an operation for the vector instruction for the element in the vector of values, wherein performing the operation involves masking faults for illegal operations performed for any elements in the vector of values.

### Claim 2 (depends on 1)

The method of claim 1, wherein masking faults for illegal operations includes masking faults for one or more of:
reads of unmapped or illegal addresses;
mathematical operations; and
access violations.

### Claim 3 (depends on 1)

The method of claim 1, wherein masking the faults involves at least one of:
updating at least one corresponding bit position in a fault-status register to indicate that a fault was masked; or
updating a record in a fault tracking mechanism in the processor to indicate that a fault was masked.

### Claim 4 (depends on 1)

The method of claim 1, wherein, if an illegal operation is determined to have occurred for each element in the vector of values for which the operation is performed, setting an indicator to indicate that the operation was not completed for any element.

### Claim 5 (depends on 1)

The method of claim 1, wherein receiving the vector instruction involves receiving a non-faulting variant of the vector instruction.

### Claim 6 (depends on 1)

The method of claim 1, wherein the method further comprises:
configuring the processor to process the received vector instruction as non-faulting, regardless of a typical processing of the vector instruction.

### Claim 7 (depends on 1)

The method of claim 1, wherein the method further comprises, before executing the vector instruction:
reading a fault-status register to determine bit positions in the fault-status register that are set to a predetermined value; and
not performing the operation for the vector instruction for elements in positions for which a corresponding bit position in the fault-status register is set to the predetermined value.

### Claim 8

A processor that handles faults encountered while executing a vector instruction, comprising:
an execution unit, wherein the execution unit is configured to:
receive the vector instruction, wherein the vector instruction uses at least one vector of values that includes N elements as an input;
receive a predicate vector that includes N elements; and
execute the vector instruction, wherein executing the vector instruction involves:
for each element in the vector of values for which a corresponding element in the predicate vector is active,
performing an operation for the vector instruction for the element in the vector of values, wherein performing the operation involves conditionally masking faults for illegal operations performed for any elements in the vector of values.

### Claim 9 (depends on 8)

The processor of claim 8, wherein, when masking faults for illegal operations, the execution unit is configured to mask faults for one or more of:
reads of unmapped or illegal addresses;
mathematical operations; and
access violations.

### Claim 10 (depends on 8)

The processor of claim 8, wherein when masking the faults, the execution unit is configured to at least one of:
update at least one corresponding bit position in a fault-status register to indicate that a fault was masked; or
update a record in a fault tracking mechanism in the processor to indicate that a fault was masked.

### Claim 11 (depends on 8)

The processor of claim 8, wherein if an illegal operation is determined to have occurred for each element in the vector of values for which the operation is performed, the execution unit is configured to set an indicator to indicate that the operation was not completed for any element.

### Claim 12 (depends on 8)

The processor of claim 8, wherein when receiving the vector instruction, the execution unit is configured to receive a non-faulting variant of the vector instruction.

### Claim 13 (depends on 8)

The processor of claim 8, wherein the processor further comprises:
one or more mechanisms that configure the execution unit to process the received vector instruction as non-faulting, regardless of a typical processing of the vector instruction.

### Claim 14 (depends on 8)

The processor of claim 8, wherein before executing the vector instruction, the execution unit is configured to:
read a fault-status register to determine bit positions in the fault-status register that are set to a predetermined value;
wherein when performing the operation for the vector instruction, the execution unit is configured not to perform the operation for elements in positions for which a corresponding bit position in the fault-status register is set to the predetermined value.

### Claim 15

A computer system that handles faults during execution of a vector instruction, comprising:
a processor;
a memory coupled to the processor, wherein the memory stores instructions and data for the processor;
an execution unit in the processor, wherein the execution unit is configured to:
receive the vector instruction, wherein the vector instruction uses at least one vector of values that includes N elements as an input;
receive a predicate vector that includes N elements; and
execute the vector instruction, wherein executing the vector instruction involves:
for each element in the vector of values for which a corresponding element in the predicate vector is active,
performing an operation for the vector instruction for the element in the vector of values, wherein performing the operation involves conditionally masking faults encountered while performing the operation.

### Claim 16 (depends on 15)

The computer system of claim 15, wherein, when masking faults for illegal operations, the execution unit is configured to mask faults for one or more of:
reads of unmapped or illegal addresses;
mathematical operations; and
access violations.

### Claim 17 (depends on 15)

The computer system of claim 15, wherein when masking the faults, the execution unit is configured to at least one of:
update at least one corresponding bit position in a fault-status register to indicate that a fault was masked; or
update a record in a fault tracking mechanism in the processor to indicate that a fault was masked.

### Claim 18 (depends on 15)

The computer system of claim 15, wherein if an illegal operation is determined to have occurred for each element in the vector of values for which the operation is performed, the execution unit is configured to set an indicator to indicate that the operation was not completed for any element.

### Claim 19 (depends on 15)

The computer system of claim 15, wherein when receiving the vector instruction, the execution unit is configured to receive a non-faulting variant of the vector instruction.

### Claim 20 (depends on 15)

The computer system of claim 15, wherein the processor further comprises:
one or more mechanisms that configure the execution unit to process the received vector instruction as non-faulting, regardless of a typical processing of the vector instruction.

### Claim 21 (depends on 15)

The computer system of claim 15, wherein before executing the vector instruction, the execution unit is configured to:
read a fault-status register to determine bit positions in the fault-status register that are set to a predetermined value;
wherein when performing the operation for the vector instruction, the execution unit is configured not to perform the operation for elements in positions for which a corresponding bit position in the fault-status register is set to the predetermined value.
