Data processing apparatus and method for converting a number between fixed-point and floating-point representations
First Claim
1. A data processing apparatus comprising:
- a data processing unit operable to execute instructions;
the data processing unit being responsive to a format conversion instruction to apply a format conversion operation to a number to perform a conversion between a fixed-point representation of said number and a floating-point representation of said number, a control field being arranged to provide a programmable value specifying a decimal point location within the fixed-point representation of said number, and the data processing unit being operable to reference the control field and to control the format conversion operation in accordance with the programmable value;
wherein the format conversion instruction is a fixed-point to floating-point conversion instruction and the format conversion operation applied to the number is operable to perform a conversion from a fixed-point representation of said number to a floating-point representation of said number, wherein the format conversion operation includes an exponent generation operation operable to generate an exponent value for the floating-point representation of the number by performing an operation equivalent to subtracting from an initial exponent value a value indicative of the number of leading zeros in the fixed-point representation of the number, and the format conversion operation being operable, prior to said exponent generation operation, to adjust the initial exponent value based on the programmable value provided within the control field.
0 Assignments
0 Petitions
Accused Products
Abstract
A data processing apparatus and method are provided for converting a number between fixed-point and floating-point representations. More particularly, the data processing apparatus comprises a data processing unit operable to execute instructions, with the data processing unit being responsive to a format conversion instruction to apply a format conversion operation to a number to perform a conversion between the fixed-point representation of the number and the floating-point representation of the number. Furthermore, a control field is provided which is arranged to provide a programmable value specifying a decimal point location within the fixed-point representation of the number, and the data processing unit is operable to reference the control field and to control the formal conversion operation in accordance with the programmable value. This enables a single instruction to be used to directly convert between fixed-point formats (where the position of the decimal point may be programmable varied) and floating-point representations.
-
Citations
17 Claims
-
1. A data processing apparatus comprising:
-
a data processing unit operable to execute instructions; the data processing unit being responsive to a format conversion instruction to apply a format conversion operation to a number to perform a conversion between a fixed-point representation of said number and a floating-point representation of said number, a control field being arranged to provide a programmable value specifying a decimal point location within the fixed-point representation of said number, and the data processing unit being operable to reference the control field and to control the format conversion operation in accordance with the programmable value; wherein the format conversion instruction is a fixed-point to floating-point conversion instruction and the format conversion operation applied to the number is operable to perform a conversion from a fixed-point representation of said number to a floating-point representation of said number, wherein the format conversion operation includes an exponent generation operation operable to generate an exponent value for the floating-point representation of the number by performing an operation equivalent to subtracting from an initial exponent value a value indicative of the number of leading zeros in the fixed-point representation of the number, and the format conversion operation being operable, prior to said exponent generation operation, to adjust the initial exponent value based on the programmable value provided within the control field. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8)
-
-
9. A method of converting a number between a fixed-point representation of said number and a floating-point representation of said number within a data processing apparatus comprising a data processing unit operable to execute instructions, the method comprising the steps of:
-
providing within a control field a programmable value specifying a decimal point location within the fixed-point representation of said number; and responsive to a format conversion instruction, causing the data processing unit to apply a format conversion operation to said number to perform a conversion between the fixed-point representation of said number and the floating-point representation of said number, including causing the data processing unit to reference the control field and to control the format conversion operation in accordance with the programmable value, wherein the format conversion instruction is a fixed-point to floating-point conversion instruction and the format conversion operation applied to the number is operable to perform a conversion from a fixed-point representation of said number to a floating-point representation of said number, wherein the step of applying the format conversion operation includes the steps of; performing an exponent generation operation to generate an exponent value for the floating-point representation of the number by performing an operation equivalent to subtracting from an initial exponent value a value indicative of the number of leading zeros in the fixed-point representation of the number; and prior to said exponent generation operation, adjusting the initial exponent value based on the programmable value provided within the control field. - View Dependent Claims (10, 11, 12, 13, 14, 15, 16, 17)
-
Specification