1. Field of the Invention
This invention relates in general to the field of microprocessors, and more particularly to a method and apparatus for converting and transferring data between floating point and integer registers without first storing the data in memory.
2. Description of the Related Art
One of the fundamental applications of a computer system is the processing and storing of numeric data (sometimes called "number crunching"). To more efficiently perform digital operations on numeric data, scientists and engineers have adopted numerical structures that differ from those used in traditional mathematics. First of all, to perform arithmetic operations, a computer must be capable of storing and retrieving numerical data. The numerical data should ideally be stored in consistent formats designed to minimize space and optimize processing efficiency. Historically, numeric data was stored in structures devised to fit the characteristics of a specific machine. Only recently have common standards been adopted that define mathematical standards for digital computers.
In general, modern computer systems treat numerical data as either integer data or floating point data depending on the application, the size of the number required by the application, and the type of operation to be performed on the data. Because of the difference in data formats between integer data and floating point data, microprocessors typically have two separate processing units, one for processing integer data (the Integer Unit, or IU), the other for processing floating point data (the Floating Point Unit, or FPU). Integer data is operated on by the integer unit within a microprocessor, while floating point data is operated on by the floating point unit within a microprocessor.
Frequently, data is shared by both an integer unit and a floating point unit. When data is shared, it must first be converted into an acceptable form, depending on whether it will be operated upon by the integer unit or the floating point unit. Conversion of data into an acceptable form is typically accomplished as a single operation that converts the data, from integer to floating point, or from floating point to integer, and then stores the converted data into memory.
Thus, before an integer unit can operate on data that is in a floating point unit, the data must first be converted into integer format, and then stored to memory. Alternatively, before a floating point unit can operate on data that is in an integer unit, the data must first be converted into floating point format, and then stored to memory. In modern microprocessors, requiring data to be converted, stored to memory, and then retrieved from memory, is very time consuming for the microprocessor, and adds significant delay in processing the data.
Therefore, what is needed is an apparatus and method that converts numerical data into an acceptable format for either an integer unit, or a floating point unit, without requiring the data to be stored to, and later retrieved from memory. Furthermore, what is needed is a microprocessor that shares data between an integer unit and a floating point unit, and separates the steps of format conversion and data movement.