RUNTIME CHECKING OF DYNAMIC SUBRANGES
First Claim
1. A method comprising:
- determining a target register, wherein an instruction indicates operations to modify contents of the target register;
determining a lower range bound value and an upper range bound value for the target register, wherein a set of one or more range bound registers indicate the upper range bound value and the lower range bound value;
determining, based on the lower range bound value and the upper range bound value, that a value to be stored in the target register is invalid; and
generating a range checking exception, wherein the range checking exception indicates that the value to be stored in the target register violates any one of the lower and the upper range bound values.
1 Assignment
0 Petitions
Accused Products
Abstract
Software defects (e.g., array access out of bounds, stack overflow, infinite loops, and data corruption) occur due to integer values falling outside their expected range. Because programming languages do not include range-checking instructions as part of their language, to detect software defects and ensure that the code runs smoothly, programmers generally use 1) runtime assertions and/or 2) sub-range data types. However, these techniques cause additional conditional branches, incur additional overhead, and decrease processor performance. Processors comprising a range checking hardware feature supported by machine instructions for runtime integer range checking can eliminate the conditional branches generated during runtime integer range checks. Programming language extensions for the range checking hardware can allow dynamic range bounds to be defined during runtime without decreasing the processor'"'"'s performance. This can allow for easier programming and code that is easier to maintain.
24 Citations
20 Claims
-
1. A method comprising:
-
determining a target register, wherein an instruction indicates operations to modify contents of the target register; determining a lower range bound value and an upper range bound value for the target register, wherein a set of one or more range bound registers indicate the upper range bound value and the lower range bound value; determining, based on the lower range bound value and the upper range bound value, that a value to be stored in the target register is invalid; and generating a range checking exception, wherein the range checking exception indicates that the value to be stored in the target register violates any one of the lower and the upper range bound values. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9)
-
-
10. One or more machine-readable media having stored therein a program product, which when executed a set of one or more processor units causes the set of one or more processor units to perform operations that comprise:
-
determining a target register, wherein an instruction indicates operations to modify contents of the target register; determining a lower range bound value and an upper range bound value for the target register, wherein a set of one or more range bound registers indicates the upper range bound value and the lower range bound value; determining, based on the lower range bound and the upper range bound values, that a value to be stored in the target register is invalid; and generating a range checking exception, wherein the range checking exception indicates that the value to be stored in the target register violates any one of the lower and the upper range bound values. - View Dependent Claims (11, 12, 13, 14, 15, 16, 17, 18)
-
-
19. An apparatus comprising:
-
one or more registers; one or more range checking registers comprising a set of one or more range bound registers indicating an upper and a lower range bound value for the registers; an arithmetic and logic unit operable to perform arithmetic and logic operations on one or more of the registers; and a range checking unit operable to determine a target register, wherein an instruction indicates operations to modify contents of the target register; determine a lower range bound value and an upper range bound value for the target register, wherein the set of one or more range bound registers indicate the upper range bound value and the lower range bound value; determine, based on the lower range bound and the upper range bound values, that a value to be stored in the target register is invalid; and generate a range checking exception, wherein the range checking exception indicates that the value to be stored in the target register violates any one of the lower and the upper range bound values. - View Dependent Claims (20)
-
Specification