Multiple modes for handling overflow conditions resulting from arithmetic operations
AssigneeGraphcore Limited
InventorsAlan Graham Alexander, Edward Andrews, Stephen Felix, Mrudula Chidambar Gore
Life of this patent
Estimating the term…
Abstract
A method and apparatus for handling overflow conditions resulting from arithmetic operations involving floating point numbers. An indication is stored as part of a thread's context indicating one of two possible modes for handling overflow conditions. In a first mode, a result of an arithmetic operation is set to the limit representable in the floating point format. In a second mode, a result of an arithmetic operation is set to a NaN.
Claims23
A processing system comprising:
- a processing unit configured to execute one or more arithmetic operations using values represented by digital representations which extend between predefined limit values;
- at least one register configured to store a mode indication indicating operation in a first mode or a second mode;
- at least one memory for storing outputs of the one or more arithmetic operations,
- wherein the processing unit is configured to:
- check the mode indication to determine whether the arithmetic operation is to be executed in the first mode or in the second mode;
- wherein in the first mode, in response to the respective arithmetic operation resulting in a value exceeding a limit value of the digital representation, a result number having the limit value is stored in the memory;
- and
- in a second mode, in response to the respective arithmetic operation resulting in a value exceeding a limit value of the digital representation, an output code is stored with the memory, the output code indicating a result that cannot be processed as a value.
A processing system as claimed in 2, wherein the at least one register comprises a plurality of status registers each associated with one of the plurality of threads.
A method for executing one or more arithmetic operations using values represented by digital representations which extend between predefined limit values, the method comprising:
- storing a mode indication indicating operation in a first mode or a second mode;
- storing outputs of the one or more arithmetic operations;
- checking the mode indication to determine whether the arithmetic operation is to be executed in the first mode or in the second mode;
- wherein in the first mode, in response to the respective arithmetic operation resulting in a value exceeding a limit value of the digital representation, a result number having the limit value is stored in a memory;
- and
- in the second mode, in response to the respective arithmetic operation resulting in a value exceeding a limit value of the digital representation, an output code is stored in the memory, the output code indicating a result that cannot be processed as a value.
A non-transitory computer readable medium comprising computer program instructions which when executed cause a hardware module to carry out a method, the method comprising:
- storing a mode indication indicating operation in a first mode or a second mode;
- checking the mode indication to determine that an arithmetic operation is to be executed in the first mode;
- and
- wherein in the first mode, in response to the arithmetic operation resulting in a value exceeding a limit value, a result number having the limit value is stored in a memory.
Dependencies are inferred from the claim text.