Performing rounding operations responsive to an instruction
AssigneeIntel Corporation
InventorsRonen Zohar, Shane Story
Life of this patent
Estimating the term…
Abstract
In one embodiment, the present invention includes a method for receiving a rounding instruction and an immediate value in a processor, determining if a rounding mode override indicator of the immediate value is active, and if so executing a rounding operation on a source operand in a floating point unit of the processor responsive to the rounding instruction and according to a rounding mode set forth in the immediate operand. Other embodiments are described and claimed.
Claims20
A processor comprising:
- a controller to receive a round instruction of an instruction set architecture (ISA) having a format including a source operand, a destination operand and an immediate data element, wherein the controller is to decode the immediate data element to determine if a default round mode is to be overridden based on an override indicator of the immediate data element, and if the default round mode is to be overridden to decode a round mode field of the immediate data element;
- an execution unit coupled to the controller to execute a round operation responsive to the round instruction, wherein the execution unit is to execute the round operation according to the round mode field of the immediate data element if the default round mode is to be overridden based on the override indicator;
- and
- a configuration register, wherein when the configuration register is set for denormal numbers as zero and the source operand is a denormal number, the processor is to convert the source operand to zero before execution of the round operation.
A non-transitory machine-readable medium having stored thereon instructions, which if performed by a machine cause the machine to perform a method comprising:
- receiving a user-level rounding instruction of an instruction set architecture (ISA) having a format including a source operand, a destination operand and an immediate value, in a control selector unit of a processor;
- determining if a rounding mode override indicator of the immediate value is active by decoding the immediate value in the control selector unit;
- if so, obtaining a rounding mode field of the immediate value and dispatching the source operand and information to control a rounding mode to a floating point unit of the processor coupled to the control selector unit;
- and
- executing a rounding operation on the source operand in the floating point unit of the processor responsive to the user-level rounding instruction and according to the information, including if the source operand is a signaling not a number, converting the source operand to a quiet not a number.
A system comprising:
- a processor comprising:
- an execution unit to execute a round instruction on a first operand to obtain a rounded result in accordance with a round mode portion of a control field associated with the round instruction if an override indicator separate from the round mode portion is present in the control field;
- a selector unit coupled to the execution unit to receive the round instruction and the control field, wherein the selector unit is to decode the round mode portion of the control field and generate control signals therefrom if the override indicator is present and to provide the control signals to the execution unit to cause execution of the round instruction, wherein when the first operand is a signaling not a number, the execution unit is to convert the first operand from the signaling not a number to a quiet not a number, the round mode portion to encode one of a plurality of round modes;
- and
- a register to store a default round mode for the execution unit and to store status information regarding execution in the execution unit, wherein the execution unit is to execute the round instruction in accordance with a different round mode than the default round mode if the override indicator is present in the control field, and to not update the status information indicative of a precision exception caused by execution of the round instruction if a suppression indicator is present in the control field;
- and
- a dynamic random access memory (DRAM) coupled to the processor.
Dependencies are inferred from the claim text.