Movatterモバイル変換


[0]ホーム

URL:


US5948099A - Apparatus and method for swapping the byte order of a data item to effectuate memory format conversion - Google Patents

Apparatus and method for swapping the byte order of a data item to effectuate memory format conversion
Download PDF

Info

Publication number
US5948099A
US5948099AUS07/744,818US74481891AUS5948099AUS 5948099 AUS5948099 AUS 5948099AUS 74481891 AUS74481891 AUS 74481891AUS 5948099 AUS5948099 AUS 5948099A
Authority
US
United States
Prior art keywords
data item
format
bit
endian
microprocessor
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
US07/744,818
Inventor
John H. Crawford
Mustafiz R. Choudhury
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Intel Corp
Original Assignee
Intel Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Intel CorpfiledCriticalIntel Corp
Priority to US07/744,818priorityCriticalpatent/US5948099A/en
Application grantedgrantedCritical
Publication of US5948099ApublicationCriticalpatent/US5948099A/en
Anticipated expirationlegal-statusCritical
Expired - Lifetimelegal-statusCriticalCurrent

Links

Images

Classifications

Definitions

Landscapes

Abstract

A microprocessor instruction for performing an in-place byte swap on 32-bit data type to convert data stored in a big-endian memory format to a little-endian memory format, or visa-versa, is described. The invention comprises a modified barrel shifter which includes a plurality of multiplexers for selectively coupling data from one or more input buses to an output bus. The coupling of the individual bit lines of the data buses is arranged such that the lower order bits of the 32-bit quantity are exchanged with the higher order bits and visa-versa. Control lines connected to each of the multiplexers provide a means for controlling the byte swapping operation.

Description

This is a continuation of application Ser. No. 331,640, filed Mar. 30, 1989 now abandoned.
FIELD OF THE INVENTION
The present invention relates to the field of semiconductor microprocessors.
BACKGROUND OF THE INVENTION
The present invention covers a byte swapping instruction which may be implemented within the architecture of a microprocessor. The microprocessor utilized with the present invention is the Intel 80486™ Microprocessor, frequently referred to as the 486™ Processor. The 486 processor is an improved version of the Intel 80386™ microprocessor, also known as the 386™ processor. (Intel, 80386, 386, 80486 and 486 are trademarks of Intel Corporation).
Generally, information is stored in the memory of a microprocessor system in data structures which typically vary anywhere between 8 to 64-bits in length. In the 486 microprocessor a "word" is defined to be 16-bits wide, while a doubleword, or "dword", is 32-bits wide. Words are stored in two consecutive 8-bit bytes in memory with the low-order byte at the lowest address and the higher-order byte at the higher address. Dwords are stored in four consecutive bytes in memory with the low-order byte at the lowest address and the high-order byte at a highest address. The address of a word or dword data item within the microprocessor is the byte address of the lowest-order byte. This type of addressing, particularly with respect to a dword data item, is known as the "little-endian" method for storing data types that are larger than one byte. All of Intel's x86 family members use the little-endian method for storing data types.
The alternative method of storing data types within a memory of a microprocessor is referred to as the "big-endian" method. In the big-endian method, data is stored with the high-order bits at the lowest addressed byte.
Thus, the big-endian format is opposite to the little-endian counterpart. The distinction between the two is simply which byte of a multiple byte quantity is assigned the lowest address, and which byte is assigned the highest address. In big-endian format, as the name implies, the big bytes come first; that is, the high-order bits are at lower addresses. The big-endian memory format is used by IBM's 370 line of computers as well as the 68000 line of microprocessors manufactured by Motorola, Inc. In addition, many RISC processors use the big-endian format.
Very often a programmer desires to form a data base having mixed data memory formats. Other programmers frequently want to send data over a network from one computer which stores integer data in a big-endian format to another computer which stores integer data in a little-endian format. Therefore, at some point in time, a conversion needs to be performed to convert data stored in one memory format to the other.
In a 16-bit environment the conversion between memory formats is straightforward. A number of instructions are generally available within a microprocessor to simply rotate or exchange 8-bit registers. In other words, the 8-bit quantities that form the 16-bit data item can simply be swapped or exchanged.
Byte swaps of higher-order number of bits, say 32 or 64-bit quantities, are more problematic. For example, one way that a prior art microprocessor might perform this byte swap operation on a 32-bit item is to first execute a byte swap of the lower two bytes; then rotate by sixteen; then perform a second bye swap on the remaining two bytes. Hence, three separate instructions are required to perform a conversion--each instruction taking two clocks to implement for a total of six clocks for the entire conversion. Also, because each instruction is generally two to three bytes in length, a great deal of code needs to be generated--probably nine instruction bytes--for these three rotate instructions.
An alternative approach would be to have the memory format conversation take place in consecutive steps in microcode. However, using microcode would still take six clocks or more along with a large number of instruction bytes. Consequently, performing memory format conversions from big-endian to little-endian, or visa-versa, in prior art machines requires a substantial amount of internal memory space and a significant performance penalty.
A different approach that is used by certain RISC processors is referred to as "pin-strapping". Pin-strapping consists of nothing more than a static switch that is hard-wired into the printed circuit board housing the microprocessor. The pin-strap option forces the computer to treat memory in one fashion or another, i.e., either as big-endian or little-endian format. This hard-wired approach has the obvious drawback in that it is static and therefore incapable of being programmed or controlled dynamically by the microprocessor or user.
As will be seen, the present invention replaces these past approaches with a single byte swap instruction capable of converting a big-endian dword to a little-endian format. This instruction provides rapid conversion between the two formats without adding any extra hardware or performance cost. An approximately 10% speed increase is reported for programs that make heavy use of big-endian data when executing on a 486 processor (e.g., a little-endian machine).
SUMMARY OF THE INVENTION
A specialized microprocessor instruction optimized for performing an in-place byte swap on 32-bit data type is described. This byte swap operation is especially useful in converting data stored in a big-endian memory format to a little-endian memory format, or visa-versa. The invention comprises a modified barrel shifter which includes a plurality of multiplexers for selectively coupling data from one or more input buses to an output bus. The coupling of the individual bit lines of the data buses is arranged such that bits 0-7, 8-15, 16-23 and 24-31 of the input bus are coupled to corresponding bits 24-31, 16-23, 8-15 and 0-7, respectively. Control lines connected to each of the multiplexers provide a means for controlling the byte swapping operation.
The presently described byte swap instruction allows the programmer to convert data from a big-endian memory format to a little-endian data format, and back again, without incurring the performance penalties associated with past microprocessors. In addition, this one instruction requires only one execution clock cycle to perform the conversion whereas prior art microprocessors typically require three instructions and six clocks.
BRIEF DESCRIPTION OF THE DRAWINGS
The present invention will be understood more fully from the detailed description given below and from the accompanying drawings of the preferred embodiment of the invention which, however should not be taken to limit the invention to the specific embodiment but are for explanation and understanding only.
FIG. 1 is a comparison between little-endian and big-endian memory formats. Both memory formats are shown with their corresponding memory addresses and bit numbering. The highest order bit is shown asbit 31 while the lowest order bit isbit 0.
FIG. 2 is a block diagram illustrating the data flow through the barrel shifter of the invented microprocessor.
FIGS. 3A-3L collectively comprise a circuit schematic of the barrel shifter utilized in the currently preferred embodiment of the present invention.
FIG. 4 shows the circuit schematic for the 4×4 multiplexer utilized within the barrel shifter of FIG. 3.
DETAILED DESCRIPTION OF THE INVENTION
A microprocessor comprising a byte swap instruction for converting the memory data formats from one type to another is described. In the following description, numerous specific details are set forth, such as bit lengths, etc., in order to provide a thorough understanding of the present invention. It will be obvious however, to one skilled in the art that these specific details need not be used to practice the present invention. In other instances, well-known structures and circuits have not been shown in detail in order not to unnecessarily obscure the present invention.
FIG. 1 illustrates the differences between the big-endian and little-endian memory formats for dwords having a length of 32-bits. In FIG. 1, for both the little-endian and big-endian memory formats, the 32-bits of data are shown with the low-order bit numberedbit 0, the high-order bit numberedbit 31, and the memory addresses numbered along the top.
As shown, each 32-bit dword is partitioned into four 8-bit bytes. These are denoted by capital letters A-D in FIG. 1. In the little-endian memory format, dwords are stored in four consecutive bytes in memory with the low-order byte being positioned at the lowest address and the high-order byte positioned at the highest address. This is illustrated in FIG. 1 where for a little-endian memory format, bits 0-7 are stored in memory address M, bits 8-15 are stored in memory address M+1, bits 16-22 are stored in memory address M+2, and bits 24-31 are stored in memory address M+3. The address of a dword data item in a little-endian format is the byte address of the lowest-order byte, (e.g., memory address "M").
In the big-endian memory data format, the bits are arranged in the opposite order. That is, bit-endian data is stored with the high-order bits at the lowest address byte, and the lowest-order bits at the highest memory address byte. Therefore, as shown in FIG. 1, in big-endian format bits 0-7 are stored at memory address M+3; bits 8-15 are stored at memory address M+2; bits 16-23 are stored at memory address M+1; and bits 24-31 are stored at memory address M. The address of a dword data item in big-endian memory format is the byte address of the highest-order byte.
To perform a conversion from big-endian memory format to little-endian, the following process needs to occur. First, the data item is moved from memory to an internal register. Next, byte A corresponding to bits 24-31 in the big-endian format need to be transferred or swapped with the contents of byte D corresponding to bits 0-7. Similarly, byte B needs to be swapped with byte C. This byte swapping operation is performed in the preferred embodiment using the barrel shifter located within the integer execution unit of the microprocessor. Finally, the swapped data item is latched into a temporary latch or register to be subsequently written back to the source destination register in memory.
Referring now to FIG. 2, a block diagram of the data flow through the barrel shifter utilized to implement the byte swap instruction of the present invention is shown. Thebarrel shifter 20 is a device commonly known in the art, and is typical found in most microprocessors.Barrel shifter 20 can shift/rotate a word of data by N positions in a single operation--N ranging from 0 to the word size. Ordinarily,barrel shifter 20 is used for a variety of operations. For instance,barrel shifter 20 is used for shift instructions, rotate instructions, bit scans, etc.
In the invented microprocessor,barrel shifter 20 is comprised of two parts: amatrix element 23 and atree 24.Matrix 23 receives data inputs along 32-bit buses 21 and 22, labelled dsma and dsmb, respectively. Generally, the data supplied alongbus line 21 is identical to the data supplied onbus line 22. This facilitates rapid rotation or shifting of data as will be seen.Matrix 23 receives these data inputs and performs a shift operation on a nibble granular basis, (i.e., the data is shifted by a multiple of 4). In this way, the data is initially shifted in the first stage of the shift operation by multiples of 4 (e.g., 4, 8, 12, 16, etc.). Additional shifting by anything less than 4 (i.e., 0-3) is performed intree 24.Matrix 23 is coupled totree 24 alongbus 25 labelled DST.Tree 24 then provides an output on 32-bit bus 26 labelled DSL toALU output register 27.
Referring now to FIGs. 3A-3L, a detailed circuit schematic of thebarrel shifter 20 utilized in the currently preferred embodiment of the present invention is illustrated.Barrel shifter 20 comprises a plurality of vertical data input lines coupled to dsma anddsmb bus lines 21 and 22, respectively. These data input lines are shown comprised of individual bit lines DSMA0-31 and DSMB0-31. Each line is coupled to the inputs of a plurality of 4×4 multiplexers. For example, dsmb31 is coupled to the 14 input of multiplexors 42-49.
Also included in FIGS. 3A-L are a plurality of horizontal data output lines. These horizontal data bit lines compriseDST bus 25 and are coupled to the outputs of a plurality of multiplexers. The individual bit lines ofDST bus 25 are shown labelled DST0-31 and are connected to ALU output register 27 as discussed in connection with FIG. 2 (additional lines are shown, e.g., DST35, but these are not germane to the invention; therefore, they will not be discussed). For instance, DST31 is shown connected to multiplexers 42, 59, 68, 77, 86, 95,104 and 113. Control is provided to each of the multiplexers ofbarrel shifter 20 via control lines labelled DSMC0-22.
Each of the multiplexers 41-119 (excludingdevices 57, 66, 75, 84, 93, 102 and 111 which are only used in conjunction with tree 24) comprise a multiplexer having four input pins (i.e., I1-I4), four output pins (i.e.,O1-O4), and a control pin (i.e.,C). During operation, when the control line of an individual multiplexer is asserted, the input data lines are electrically coupled to the output data lines. By way of example, when the control input line tomultiplexer 110 is asserted the data present at input pin I1 (e.g., DSMB0 is electrically coupled to output pin O1, (e.g., DST0). In a similar manner, the data associated with pins I2, I3, and I4 (e.g., DSMB1, DSMB2, and DSMB3, respectively) is electrically coupled to output pins O2, O3 and O4, respectively (e.g., DST1, DST2, and DST3, respectively). Thus, each individual multiplexer withinbarrel shifter 20 operates as a switching element connecting groups of data inputs to corresponding output lines.
With reference now to FIG. 4, a circuit schematic of the 4×4 multiplexer used in the currently preferred embodiment of the present invention is shown. This multiplexer includes field-effect devices 120-123 which preferably comprise ordinary n-channel MOS devices. The gate of each of these field-effect transistors is coupled to controlline 124. The drain and source regions of each transistor are coupled to a different pair of input and output lines. For instance,transistor 123 has its source connected to inputline 128 labelled I1 and its drain coupled tooutput line 129 labelled O1. Whencontrol line 124 is asserted by taking it to a high positive potential, a conductive channel is formed between the source and drain regions of devices 120-123. This conductive channel provides electrical connection between the corresponding input and output pins. Thus, a high positive potential oncontrol line 124 provides electrical connection betweenlines 128 and 129, 127 and 130, 126 and 131, and 125 and 132.
Barrel shifter 20 of the invented microprocessor is similar to barrel shifters found in prior art microprocessors such as the 80386 with the exception that certain control signals have been split to accommodate the format conversion of the present invention. The original matrix control signal DSMC2 of the 386 processor has been split into three control signals, DSMC2a, DSMC2b and DSMC2c in order to aid the one execution clock implementation of the byte swap (BSWAP) instruction. Also, the DSMC17 signal is shown split into three signals, DSMC17a-c. For ordinary operations (everything except a BSWAP) these control lines are merged into their original form andbarrel shifter 20 operates normally. It is only during execution of the BSWAP instruction that the separate split lines become important.
Inphase 1 of the execution clock cycle of the BSWAP instruction, four of the matrix control signals are asserted. All other control signals of the matrix are negated. The four matrix control signals which are asserted include dsmc21 (which muxes bits 24-31 of dsmb bus to bits 0-7 of the matrix output bus DST), dsmc17b (which muxes bits 16-23 of dsmb bus to bits 8-15 of matrix output bus DST), dsmc2b (muxing bits 8-15 of dsma bus to bits 16-23 of matrix output bus DST) and dsmc17c (muxing bits 0-7 of dsma bus onto bits 24-31 of matrix output bus DST). Inphase 2 of the execution clock, the barrel shifter accepts the data inputs along the dsma and dsmb buses and swaps the bytes simply by providing appropriate electrical connection between the DSMA, DSMB buses and DST output lines. Therefore, the memory item data format is automatically converted from either big-endian to little-endian or from little-endian to big-endian. The converted data output by the matrix proceeds through the tree of the shifter without any additional shifts and is subsequently loaded into theALU output latch 27.
In the currently preferred embodiment, the BSWAP instruction is comprised by two 8-bit instruction bytes. Thirteen of the bits of the instruction are defined as the opcode while the lower four bits of the second byte specify the register that is to participate in the operation.
One important aspect of the present invention is that the BSWAP instruction acts as its own inverse so that a separate instruction to convert back from a previously converted format is unnecessary. In other words, the data provided ondata input buses 21 and 22, may be converted from big to little, or from little to big, using the same instruction.
Another operation where the BSWAP instruction proves useful is in load/store operations. Consider the case in which a user wishes to perform operations on a machine which stores all data in a little-endian format. If the user performs a normal load to a register followed by a BSWAP instruction, the big-endian format is translated into little-endian automatically, thereby enabling the processor to operate on it immediately (i.e., add, subtract, multiply, etc.). Following completion of all arithmetic operations, the programmer might execute another BSWAP followed by a normal store to memory to restore the data in its original format in memory. Achieving the identical sequence of operations on a prior art microprocessor such as the 80386 takes considerably more time and storage area.
Although the byte swap instruction of the present invention is currently defined for 32-bit dwords, it also provides a basic building block for higher-order memory format conversions (e.g., 64-bits and on). In executing a 64-bit swap, the machine first loads the 64-bit quantity into two registers. Next, it executes BSWAPs on each of the registers. Afterwards, the processor simply renames the registers in reverse order. In other words, the register containing the higher-order bits is renamed as the lower-order register, and visa-versa. This type of renaming scheme obviates the need to physically swap the registers. When utilized for conversions of 64-bits and higher, the performance cost savings are magnified.
Thus, a byte swap instruction in a microprocessor for converting between memory data formats has been described.

Claims (47)

We claim:
1. Apparatus for swapping the byte order of a 32-bit data item stored in a register of microprocessor means, said apparatus operating in response to a single instruction executed by said microprocessor means, said apparatus comprising:
matrix coupling means for coupling said data item from said register on a plurality of input data lines to a corresponding plurality of output data lines, the coupling swapping the byte order of bits 0-7, 8-15, 16-23 and 24-31 of said data item to corresponding bit positions 24-31, 16-23, 8-15 and 0-7, respectively, of said output data lines; and
control means responsive to said single instruction coupled to said matrix coupling means for controlling said swapping of said byte order of said data item.
2. The apparatus of claim 1, further comprising a register means coupled to said output data lines for storing said swapped data item.
3. The apparatus of claim 2, wherein said matrix coupling means comprises a barrel shifter which includes a plurality of multiplexers, each coupling at least one bit of said data item on said input data lines to said output data lines.
4. The apparatus of claim 2, wherein said single instruction comprises two instruction bytes.
5. The apparatus of claim 1, 2 3 or 4 wherein said swapping of said byte order is performed in one execution clock cycle of said microprocessor means.
6. In a computer system receiving a data item at an input and producing a shifted or rotated data item at an output, an apparatus for changing the format of a 32-bit data item from a first format to a second format, said apparatus comprising:
a matrix shifter means including a plurality of input lines for connection to said input, a plurality of output lines for connection to said output, and a plurality of multiplexers, said multiplexers electrically connecting ordered bits 0-7, 8-15, 16-23 and 24-31 defining said first format to corresponding ordered bit positions 24-31, 16-23, 8-15 and 0-7, respectively, of said output lines defining said second format when said multiplexers are enabled; and
control means coupled to said plurality of multiplexers for enabling said multiplexers in response to a single instruction executed by said computer system for operating on said data item.
7. The computer system of claim 6 wherein said apparatus is operable to change the format of said data item from said second format to said first format in response to the execution of said single instruction by said computer system.
8. The computer system of claim 6 wherein said first format is big-endian and said second format is little-endian.
9. The computer system of claim 6, wherein said matrix shifter means comprises a barrel shifter.
10. The computer system of claim 6, 7, 8 or 9 wherein said computer system further includes a clocking means for defining execution clock cycles, and wherein the changing of said format of said 32-bit data item from said first format to said second format is completed in response to said single instruction within one of said execution clock cycles of said computer system.
11. In a microprocessor having an internal register set and a barrel shifter, a method of converting a 32-bit data item stored in a first memory format to a second memory format comprising the steps of:
inputting said data item into said barrel shifter along a pair of input buses;
asserting certain control signals connected to said barrel shifter to initiate a conversion;
connecting the ordered bits 0-7, 8-15, 16-23 and 24-31 of said data item along said input buses to corresponding ordered bit positions 24-31, 16-23, 8-15 and 0-7, respectively, of an output data bus, thereby producing a converted data item.
12. The method of claim 11 further including the step of latching said converted data item into a storage location.
13. A method of converting a 32-bit data item from a first format to a second format in a microprocessor device, said method comprising the steps of:
moving said data item from a location in which said data item is stored in said first memory format, to a register; and, in response to the execution of a single instruction by said microprocessor device;
swapping the byte order of said data item such that ordered bits 0-7, 8-15, 16-23 and 24-31 of said data item in said first format correspond to the ordered bit positions 24-31, 16-23, 8-15 and 0-7, respectively, of said register, said swapped data item being in said second format.
14. The method of claim 13 wherein said microprocessor device system further comprises a barrel shifter having a plurality of input bit lines and a plurality of output bit lines, and wherein said swapping step comprises the steps of:
asserting control signals coupled to said barrel shifter to electrically connect the order bit positions 0-7, 8-15, 16-23 and 24-31 of said input bit lines to the corresponding bit positions 24-31, 16-23, 8-15, and 0-7, respectively, of said output bit lines; and
reading said data item onto said output bit lines.
15. The method of claim 13 wherein said swapping step is performed within one execution clock cycle of said microprocessor device.
16. The method of claim 15 wherein said first format is little-endian and said second format is big-endian.
17. In a system comprising:
a plurality of computers;
a network, said plurality of computers being coupled to said network for transfer of data therebetween;
a clocking means for defining repetitive execution clock cycles;
a first computer of said system storing a data item in a big-endian memory format and including a means for executing successive instructions and an apparatus for converting said data item to a little-endian memory format in response to a single one of said instructions, said apparatus comprising:
means for transferring said data item stored in said big-endian memory format to a storage element;
means for swapping the byte order of said data item to convert said data item into said little-endian memory format, said swapping means moving the ordered bits 0-7, 8-15, 16-23 and 24-31 of said data item into the ordered bit positions 24-31, 16-23, 8-15 and 0-7, respectively, of said storage element.
18. The system of claim 17 further comprising means for transferring said swapped data item to a second computer of said system across said network.
19. A microprocessor device, comprising:
a unit for receiving and executing instructions;
apparatus responsive to execution of a single one of said instructions for receiving an input data item from a location in said device and swapping the byte order of said input data item to produce an output data item such that ordered bits 0-7, 8-15, 16-23 and 24-31 of said input data item correspond to the ordered bit positions 24-31, 16-23, 8-15, and 0-7, respectively, of said output data item.
20. A device according to claim 19 wherein said input data item is a 32-bit data word.
21. A device according to claim 20 wherein said location is a register.
22. A method of operating a microprocessor device, comprising the steps of:
a) receiving and executing sequential instructions;
b) in response to execution of a single one of said instructions, receiving an input data item from a location in said device and swapping the byte order of said input data item to produce an output data item such that ordered bits 0-7, 8-15, 16-23 and 24-31 of said input data item correspond to the ordered bit positions 24-31, 16-23, 8-15, and 0-7, respectively, of said output data item.
23. A method according to claim 22 wherein said location is a register.
24. Apparatus for swapping the byte order of a 32-bit data item stored in a register of a processor, said apparatus operating in response to a single instruction executed by said processor, said apparatus comprising:
a coupling device having a plurality of input data lines and a corresponding plurality of output data lines, said device being operative to receive said data item from said register on said input data lines and swap the byte order of bits 0-7, 8-15, 16-23 and 24-31 of said data item to corresponding bit positions 24-31, 16-23, 8-15 and 0-7, respectively, on said output data lines; and
control logic responsive to said single instruction, said control logic providing signals to said coupling device for controlling said swapping of said byte order of said data item.
25. The apparatus as in claim 24 wherein said coupling device comprises a barrel shifter which includes a plurality of multiplexers, each multiplexer coupling at least one bit of said data item from an input data line to a corresponding output data line.
26. The apparatus as in claim 25, wherein said single instruction comprises two instruction bytes.
27. The apparatus as in claim 24, wherein said swapping of said byte order is performed in one execution clock cycle of said processor.
28. The apparatus as in claim 24, 25, 26, or 27 wherein said apparatus is operable to swap said corresponding bit positions 24-31, 16-23, 8-15 and 0-7, to said byte order of bits 0-7, 8-15, 16-23 and 24-31, respectively, in response to the execution of said single instruction.
29. In a processor operable to execute a set of instructions, a method of converting a 32-bit data item stored in a first memory format to a second memory format in response to the execution of a single instruction of said set comprising the steps of:
inputting said data item into a shifter having input and output data lines;
connecting the ordered bits 0-7, 8-15, 16-23 and 24-31 of said data item along said input lines to corresponding ordered bit positions 24-31, 16-23, 8-15 and 0-7, respectively, of said output data lines.
30. The method as in claim 29, further comprising the step of:
asserting at least one control signal coupled to said shifter to initiate said connecting step.
31. A method of converting a 32-bit data item from a first format to a second format in a microprocessor, said method comprising the steps of:
loading said data item in said first format into a register; and
swapping the byte order of said data item in response to the execution of a single instruction by said microprocessor such that ordered bits 0-7, 8-15, 16-23 and 24-31 of said data item in said first format correspond to the ordered bit positions 24-31, 16-23, 8-15 and 0-7, respectively, of said register, said swapped data item being in said second format.
32. The method as in claim 31 further comprising the step of:
loading said swapped data item in said second format into an arithmetic logic unit.
33. The method as in claim 31 wherein said swapping step is performed within one clock cycle of said microprocessor.
34. A computer system comprising:
a network;
a plurality of processors coupled to said network for transfer of data therebetween;
a first processor of said system storing a 32-bit data item in a big-endian memory format, and a unit for converting said data item to a little-endian memory format in response to a single one of said instructions, said unit reversing the byte order of said data item to convert said data item into said little-endian memory format by swapping the ordered bits 0-7, 8-15, 16-23 and 24-31 of said data item into the ordered bit positions 24-31, 16-23, 8-15 and 0-7, respectively.
35. The computer system as in claim 34 further comprising a clocking means for defining repetitive clock cycles for said system.
36. The computer system as in claim 35 wherein said first processor further comprises a register for storing said data item.
37. The computer system as in claim 36 wherein said unit is operable to convert said data item from said big-endian memory format to said little-endian memory format in response to said single instruction.
38. The computer system as in claim 37 further comprising means for transferring said converted data item to a second processor of said system across said network.
39. The computer system as in claim 35, 36, 37, or 38 wherein the conversion of said data item is performed in one clock cycle of said system.
40. A microprocessor comprising:
a register storing a 32-bit data item in a first memory format;
a unit for executing instructions;
a circuit for converting said data item stored in said register to a second memory format in response to a single one of said instructions, said circuit reversing the byte order of said data item to convert said data item into said second memory format by swapping the ordered bits 0-7, 8-15, 16-23 and 24-31 of said data item into the ordered bit positions 24-31, 16-23, 8-15 and 0-7, respectively, of said register.
41. The microprocessor as in claim 40 wherein said first memory format is big-endian and said second memory format is little-endian.
42. The microprocessor as in claim 40 wherein said first memory format is big-endian and said second memory format is little-endian.
43. The microprocessor as in claim 41, wherein said circuit comprises a barrel shifter.
44. The microprocessor as in claim 43 wherein said barrel shifter comprises a plurality of input data lines coupled to receive said data item in said first memory format from said register, and a plurality of output data lines providing said data item in said second memory format to said register.
45. The microprocessor as in claim 43 further comprising an arithmetic logic unit having a latch coupled to said register for latching said data item in said second memory format.
46. The microprocessor as in claim 45, wherein said single instruction comprises two instruction bytes.
47. The microprocessor as in claim 40, 41, 42, 43, 44, 45 or wherein said swapping of said byte order is performed in one execution clock cycle of said processor.
US07/744,8181989-03-301991-08-12Apparatus and method for swapping the byte order of a data item to effectuate memory format conversionExpired - LifetimeUS5948099A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
US07/744,818US5948099A (en)1989-03-301991-08-12Apparatus and method for swapping the byte order of a data item to effectuate memory format conversion

Applications Claiming Priority (2)

Application NumberPriority DateFiling DateTitle
US33164089A1989-03-301989-03-30
US07/744,818US5948099A (en)1989-03-301991-08-12Apparatus and method for swapping the byte order of a data item to effectuate memory format conversion

Related Parent Applications (1)

Application NumberTitlePriority DateFiling Date
US33164089AContinuation1989-03-301989-03-30

Publications (1)

Publication NumberPublication Date
US5948099Atrue US5948099A (en)1999-09-07

Family

ID=23294766

Family Applications (1)

Application NumberTitlePriority DateFiling Date
US07/744,818Expired - LifetimeUS5948099A (en)1989-03-301991-08-12Apparatus and method for swapping the byte order of a data item to effectuate memory format conversion

Country Status (7)

CountryLink
US (1)US5948099A (en)
JP (1)JPH02285426A (en)
DE (1)DE4010119C2 (en)
FR (1)FR2645293A1 (en)
GB (1)GB2229832B (en)
HK (1)HK107293A (en)
IT (1)IT1239828B (en)

Cited By (24)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US6243808B1 (en)*1999-03-082001-06-05Chameleon Systems, Inc.Digital data bit order conversion using universal switch matrix comprising rows of bit swapping selector groups
KR20020074564A (en)*2001-03-202002-10-04엘지전자 주식회사Apparatus and method for interface of CPU core and outer host
US20030014616A1 (en)*2001-07-022003-01-16Thavatchai MakphaibulchokeMethod and apparatus for pre-processing a data collection for use by a big-endian operating system
US20030131029A1 (en)*2002-01-082003-07-10Bandy James HenryBarrel shifter
US6670895B2 (en)*2002-05-012003-12-30Analog Devices, Inc.Method and apparatus for swapping the contents of address registers
US6687263B2 (en)2001-04-182004-02-03Nonend Inventions N.V.Method for inverse multiplexing
US20040103336A1 (en)*2002-11-222004-05-27Flores Jose L.Apparatus for alignment of data collected from multiple pipe stages with heterogeneous retention policies in an unprotected pipeline
US20040103256A1 (en)*2002-11-222004-05-27Flores Jose L.Pipeline stage single cycle sliding alignment correction of memory read data with integrated data reordering for load and store instructions
US20040202115A1 (en)*2001-07-042004-10-14Oldenborgh Marc VanMethod, device and software for digital inverse multiplexing
US20040221274A1 (en)*2003-05-022004-11-04Bross Kevin W.Source-transparent endian translation
US7181562B1 (en)*2004-03-312007-02-20Adaptec, Inc.Wired endian method and apparatus for performing the same
US20070055855A1 (en)*2002-11-222007-03-08Manisha AgarwalaTracing through reset
US20080140992A1 (en)*2006-12-112008-06-12Gurumurthy RajaramPerforming endian conversion
US20090172349A1 (en)*2007-12-262009-07-02Eric SprangleMethods, apparatus, and instructions for converting vector data
US20090222800A1 (en)*2004-12-132009-09-03Adiletta Matthew JMethod and apparatus for implementing a bi-endian capable compiler
US20090249032A1 (en)*2008-03-252009-10-01Panasonic CorporationInformation apparatus
US20100293298A1 (en)*2003-02-112010-11-18Brocade Communications Systems, Inc.Cookie invalidation or expiration by a switch
US7971042B2 (en)2005-09-282011-06-28Synopsys, Inc.Microprocessor system and method for instruction-initiated recording and execution of instruction sequences in a dynamically decoupleable extended instruction pipeline
US20120191956A1 (en)*2011-01-262012-07-26Advanced Micro Devices, Inc.Processor having increased performance and energy saving via operand remapping
US8595452B1 (en)2005-11-302013-11-26Sprint Communications Company L.P.System and method for streaming data conversion and replication
CN103460180A (en)*2011-03-252013-12-18飞思卡尔半导体公司Processor system with predicate register, computer system, method for managing predicates and computer program product
US8683182B2 (en)1995-08-162014-03-25Microunity Systems Engineering, Inc.System and apparatus for group floating-point inflate and deflate operations
US8719837B2 (en)2004-05-192014-05-06Synopsys, Inc.Microprocessor architecture having extendible logic
CN104011672A (en)*2011-12-302014-08-27英特尔公司Transpose instruction

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US5446482A (en)*1991-11-131995-08-29Texas Instruments IncorporatedFlexible graphics interface device switch selectable big and little endian modes, systems and methods
US5928349A (en)*1995-02-241999-07-27International Business Machines CorporationMixed-endian computing environment for a conventional bi-endian computer system
US5687337A (en)*1995-02-241997-11-11International Business Machines CorporationMixed-endian computer system
US5778406A (en)*1995-06-301998-07-07Thomson Consumer Electronics, Inc.Apparatus for delivering CPU independent data for little and big endian machines
US5819117A (en)*1995-10-101998-10-06Microunity Systems Engineering, Inc.Method and system for facilitating byte ordering interfacing of a computer system
WO1998044409A1 (en)*1997-04-031998-10-08Seiko Epson CorporationMicrocomputer, electronic apparatus and information processing method

Citations (16)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
GB1029880A (en)*1963-12-201966-05-18Control Data CorpData exchanger
US4373180A (en)*1980-07-091983-02-08Sperry CorporationMicroprogrammed control system capable of pipelining even when executing a conditional branch instruction
US4437166A (en)*1980-12-231984-03-13Sperry CorporationHigh speed byte shifter for a bi-directional data bus
US4509144A (en)*1980-02-131985-04-02Intel CorporationProgrammable bidirectional shifter
US4556978A (en)*1983-07-201985-12-03Sperry CorporationError checked high speed shift matrix
US4653019A (en)*1984-04-191987-03-24Concurrent Computer CorporationHigh speed barrel shifter
US4771396A (en)*1984-03-161988-09-13British Telecommunications PlcDigital filters
EP0304615A2 (en)*1987-07-241989-03-01Kabushiki Kaisha ToshibaData rearrangement processor
US4814976A (en)*1986-12-231989-03-21Mips Computer Systems, Inc.RISC computer with unaligned reference handling and method for the same
US4918624A (en)*1988-02-051990-04-17The United States Of America As Represented By The United States Department Of EnergyVector generator scan converter
US4939684A (en)*1988-06-021990-07-03Deutsche Itt Industries GmbhSimplified processor for digital filter applications
US4959779A (en)*1986-02-061990-09-25Mips Computer Systems, Inc.Dual byte order computer architecture a functional unit for handling data sets with differnt byte orders
US4984189A (en)*1985-04-031991-01-08Nec CorporationDigital data processing circuit equipped with full bit string reverse control circuit and shifter to perform full or partial bit string reverse operation and data shift operation
US5029069A (en)*1987-06-301991-07-02Mitsubishi Denki Kabushiki KaishaData processor
US5107415A (en)*1988-10-241992-04-21Mitsubishi Denki Kabushiki KaishaMicroprocessor which automatically rearranges the data order of the transferred data based on predetermined order
US5132898A (en)*1987-09-301992-07-21Mitsubishi Denki Kabushiki KaishaSystem for processing data having different formats

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US3930232A (en)*1973-11-231975-12-30Raytheon CoFormat insensitive digital computer
EP0282969A3 (en)*1987-03-181989-03-15Hitachi, Ltd.Computer system having byte sequence conversion mechanism
JPH0649102B2 (en)*1989-05-021994-06-29株式会社竹屋 Call display device at Pachinko Islanddai
JPH0451981A (en)*1990-06-191992-02-20San Denshi KkAutomatic display device

Patent Citations (18)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
GB1029880A (en)*1963-12-201966-05-18Control Data CorpData exchanger
US4509144A (en)*1980-02-131985-04-02Intel CorporationProgrammable bidirectional shifter
US4373180A (en)*1980-07-091983-02-08Sperry CorporationMicroprogrammed control system capable of pipelining even when executing a conditional branch instruction
US4437166A (en)*1980-12-231984-03-13Sperry CorporationHigh speed byte shifter for a bi-directional data bus
US4556978A (en)*1983-07-201985-12-03Sperry CorporationError checked high speed shift matrix
US4771396A (en)*1984-03-161988-09-13British Telecommunications PlcDigital filters
US4653019A (en)*1984-04-191987-03-24Concurrent Computer CorporationHigh speed barrel shifter
US4984189A (en)*1985-04-031991-01-08Nec CorporationDigital data processing circuit equipped with full bit string reverse control circuit and shifter to perform full or partial bit string reverse operation and data shift operation
US4959779A (en)*1986-02-061990-09-25Mips Computer Systems, Inc.Dual byte order computer architecture a functional unit for handling data sets with differnt byte orders
US4814976A (en)*1986-12-231989-03-21Mips Computer Systems, Inc.RISC computer with unaligned reference handling and method for the same
US4814976C1 (en)*1986-12-232002-06-04Mips Tech IncRisc computer with unaligned reference handling and method for the same
US5029069A (en)*1987-06-301991-07-02Mitsubishi Denki Kabushiki KaishaData processor
US4931925A (en)*1987-07-241990-06-05Kabushiki Kaisha ToshibaHigh speed byte data rearranging processor
EP0304615A2 (en)*1987-07-241989-03-01Kabushiki Kaisha ToshibaData rearrangement processor
US5132898A (en)*1987-09-301992-07-21Mitsubishi Denki Kabushiki KaishaSystem for processing data having different formats
US4918624A (en)*1988-02-051990-04-17The United States Of America As Represented By The United States Department Of EnergyVector generator scan converter
US4939684A (en)*1988-06-021990-07-03Deutsche Itt Industries GmbhSimplified processor for digital filter applications
US5107415A (en)*1988-10-241992-04-21Mitsubishi Denki Kabushiki KaishaMicroprocessor which automatically rearranges the data order of the transferred data based on predetermined order

Non-Patent Citations (12)

* Cited by examiner, † Cited by third party
Title
"Architecture of the TRON VLSI CPU", Ken Sakamura, University of Tokyo, Apr. 1987.
"TRON Project, 1987", Proceedings of the Third TRON Project Symposium, Nov. 13, 1987.
Architecture of the TRON VLSI CPU , Ken Sakamura, University of Tokyo, Apr. 1987.*
Hubert Kirrmann, "Data Format and Bus Compatibility in Multi-processors," IEEE Micro, Aug. 1983, pp. 32-47.
Hubert Kirrmann, Data Format and Bus Compatibility in Multi processors, IEEE Micro , Aug. 1983, pp. 32 47.*
Hwang et al., Computer Architecture and Parallel Processing , 1984, pp. 328 354.*
Hwang et al., Computer Architecture and Parallel Processing, 1984, pp. 328-354.
Ken Sakamura (Ed.), TRON Project 1987: Open Architecture Computer Systems , Proceedings of the Third TRON Project Symposium, Springer Verlag, New York, 1987.*
Ken Sakamura (Ed.), TRON Project 1987: Open-Architecture Computer Systems, Proceedings of the Third TRON Project Symposium, Springer-Verlag, New York, 1987.
TRON Project, 1987 , Proceedings of the Third TRON Project Symposium, Nov. 13, 1987.*
Weste et al., Principles of CMOS VLSI Design , Addison Wesley Publishing Co., pp. 366 368, Oct. 1985.*
Weste et al., Principles of CMOS VLSI Design, Addison-Wesley Publishing Co., pp. 366-368, Oct. 1985.

Cited By (45)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US8769248B2 (en)1995-08-162014-07-01Microunity Systems Engineering, Inc.System and apparatus for group floating-point inflate and deflate operations
US8683182B2 (en)1995-08-162014-03-25Microunity Systems Engineering, Inc.System and apparatus for group floating-point inflate and deflate operations
US6243808B1 (en)*1999-03-082001-06-05Chameleon Systems, Inc.Digital data bit order conversion using universal switch matrix comprising rows of bit swapping selector groups
KR20020074564A (en)*2001-03-202002-10-04엘지전자 주식회사Apparatus and method for interface of CPU core and outer host
US7738513B2 (en)2001-04-182010-06-15Nonend Inventions N.V.Method for inverse multiplexing
US7995624B2 (en)2001-04-182011-08-09Nonend Inventions N.V.Systems and methods for multiplexing digital data
US20040114639A1 (en)*2001-04-182004-06-17Oldenborgh Marc VanMethod for inverse multiplexing
US20100220746A1 (en)*2001-04-182010-09-02Nonend Inventions N.V.Method for inverse multiplexing
US6687263B2 (en)2001-04-182004-02-03Nonend Inventions N.V.Method for inverse multiplexing
US20030014616A1 (en)*2001-07-022003-01-16Thavatchai MakphaibulchokeMethod and apparatus for pre-processing a data collection for use by a big-endian operating system
US7529190B2 (en)2001-07-042009-05-05Nonend Inventions N.V.Method, device and software for digital inverse multiplexing
US20040202115A1 (en)*2001-07-042004-10-14Oldenborgh Marc VanMethod, device and software for digital inverse multiplexing
US6877019B2 (en)*2002-01-082005-04-053Dsp CorporationBarrel shifter
US20030131029A1 (en)*2002-01-082003-07-10Bandy James HenryBarrel shifter
US6670895B2 (en)*2002-05-012003-12-30Analog Devices, Inc.Method and apparatus for swapping the contents of address registers
US6889311B2 (en)*2002-11-222005-05-03Texas Instruments IncorporatedPipeline stage single cycle sliding alignment correction of memory read data with integrated data reordering for load and store instructions
US20040103256A1 (en)*2002-11-222004-05-27Flores Jose L.Pipeline stage single cycle sliding alignment correction of memory read data with integrated data reordering for load and store instructions
US7444504B2 (en)2002-11-222008-10-28Texas Instruments IncorporatedTracing through reset
US20070055855A1 (en)*2002-11-222007-03-08Manisha AgarwalaTracing through reset
US7254704B2 (en)*2002-11-222007-08-07Texas Instruments IncorporatedTracing through reset
US6996735B2 (en)*2002-11-222006-02-07Texas Instruments IncorporatedApparatus for alignment of data collected from multiple pipe stages with heterogeneous retention policies in an unprotected pipeline
US20040103336A1 (en)*2002-11-222004-05-27Flores Jose L.Apparatus for alignment of data collected from multiple pipe stages with heterogeneous retention policies in an unprotected pipeline
US20100293298A1 (en)*2003-02-112010-11-18Brocade Communications Systems, Inc.Cookie invalidation or expiration by a switch
US20130173775A1 (en)*2003-02-112013-07-04Rui LiCookie Invalidation Or Expiration By A Switch
US8327000B2 (en)2003-02-112012-12-04Brocade Communications Systems, Inc.Cookie invalidation or expiration by a switch
US7925789B2 (en)*2003-02-112011-04-12Brocade Communications Systems, Inc.Cookie invalidation or expiration by a switch
US20040221274A1 (en)*2003-05-022004-11-04Bross Kevin W.Source-transparent endian translation
US7181562B1 (en)*2004-03-312007-02-20Adaptec, Inc.Wired endian method and apparatus for performing the same
US8719837B2 (en)2004-05-192014-05-06Synopsys, Inc.Microprocessor architecture having extendible logic
US9003422B2 (en)2004-05-192015-04-07Synopsys, Inc.Microprocessor architecture having extendible logic
US8863103B2 (en)*2004-12-132014-10-14Intel CorporationMethod and apparatus for implementing a bi-endian capable compiler
US20090222800A1 (en)*2004-12-132009-09-03Adiletta Matthew JMethod and apparatus for implementing a bi-endian capable compiler
US7971042B2 (en)2005-09-282011-06-28Synopsys, Inc.Microprocessor system and method for instruction-initiated recording and execution of instruction sequences in a dynamically decoupleable extended instruction pipeline
US8595452B1 (en)2005-11-302013-11-26Sprint Communications Company L.P.System and method for streaming data conversion and replication
US7721077B2 (en)*2006-12-112010-05-18Intel CorporationPerforming endian conversion
US20080140992A1 (en)*2006-12-112008-06-12Gurumurthy RajaramPerforming endian conversion
US8667250B2 (en)2007-12-262014-03-04Intel CorporationMethods, apparatus, and instructions for converting vector data
US20090172349A1 (en)*2007-12-262009-07-02Eric SprangleMethods, apparatus, and instructions for converting vector data
US9495153B2 (en)2007-12-262016-11-15Intel CorporationMethods, apparatus, and instructions for converting vector data
US20090249032A1 (en)*2008-03-252009-10-01Panasonic CorporationInformation apparatus
US20120191956A1 (en)*2011-01-262012-07-26Advanced Micro Devices, Inc.Processor having increased performance and energy saving via operand remapping
CN103460180A (en)*2011-03-252013-12-18飞思卡尔半导体公司Processor system with predicate register, computer system, method for managing predicates and computer program product
US20140013087A1 (en)*2011-03-252014-01-09Freescale Semiconductor, IncProcessor system with predicate register, computer system, method for managing predicates and computer program product
US9606802B2 (en)*2011-03-252017-03-28Nxp Usa, Inc.Processor system with predicate register, computer system, method for managing predicates and computer program product
CN104011672A (en)*2011-12-302014-08-27英特尔公司Transpose instruction

Also Published As

Publication numberPublication date
DE4010119C2 (en)1995-10-26
FR2645293A1 (en)1990-10-05
DE4010119A1 (en)1990-10-04
JPH02285426A (en)1990-11-22
GB2229832B (en)1993-04-07
HK107293A (en)1993-10-22
GB9003070D0 (en)1990-04-11
IT9019824A1 (en)1991-09-27
IT9019824A0 (en)1990-03-27
FR2645293B1 (en)1994-12-02
IT1239828B (en)1993-11-15
GB2229832A (en)1990-10-03

Similar Documents

PublicationPublication DateTitle
US5948099A (en)Apparatus and method for swapping the byte order of a data item to effectuate memory format conversion
US5805486A (en)Moderately coupled floating point and integer units
EP0743594B1 (en)Matrix transposition
US4141005A (en)Data format converting apparatus for use in a digital data processor
US4135242A (en)Method and processor having bit-addressable scratch pad memory
US6523107B1 (en)Method and apparatus for providing instruction streams to a processing device
US6754810B2 (en)Instruction set for bi-directional conversion and transfer of integer and floating point data
US5854939A (en)Eight-bit microcontroller having a risc architecture
KR940005202B1 (en) Bit order switch
US5666510A (en)Data processing device having an expandable address space
US4247893A (en)Memory interface device with processing capability
US5848284A (en)Method of transferring data between moderately coupled integer and floating point units
JPH0769782B2 (en) Microprogrammable 32-bit cascadable bit slice
US5682339A (en)Method for performing rotate through carry using a 32 bit barrel shifter and counter
US6542989B2 (en)Single instruction having op code and stack control field
JPS6014338A (en)Branch mechanism for computer system
US6012138A (en)Dynamically variable length CPU pipeline for efficiently executing two instruction sets
US4999808A (en)Dual byte order data processor
US5187799A (en)Arithmetic-stack processor which precalculates external stack address before needed by CPU for building high level language executing computers
US6442676B1 (en)Processor with different width functional units ignoring extra bits of bus wider than instruction width
EP0377466B1 (en)Microcomputer system for digital signal processing
US6564312B1 (en)Data processor comprising an arithmetic logic unit
KR970705075A (en) Execution Unit Architecture to Support x86 Instruction Set and x86 Segment Addressing (x86 Instruction Set and x86 Segmented Addressing)
JacobThe risc-16 instruction-set architecture
Magar et al.An NMOS digital signal processor with multiprocessing capability

Legal Events

DateCodeTitleDescription
STCFInformation on status: patent grant

Free format text:PATENTED CASE

FEPPFee payment procedure

Free format text:PAYOR NUMBER ASSIGNED (ORIGINAL EVENT CODE: ASPN); ENTITY STATUS OF PATENT OWNER: LARGE ENTITY

FPAYFee payment

Year of fee payment:4

FEPPFee payment procedure

Free format text:PAYOR NUMBER ASSIGNED (ORIGINAL EVENT CODE: ASPN); ENTITY STATUS OF PATENT OWNER: LARGE ENTITY

Free format text:PAYER NUMBER DE-ASSIGNED (ORIGINAL EVENT CODE: RMPN); ENTITY STATUS OF PATENT OWNER: LARGE ENTITY

FPAYFee payment

Year of fee payment:8

FPAYFee payment

Year of fee payment:12


[8]ページ先頭

©2009-2025 Movatter.jp