Processing device for processing unsorted data

The data processing device addresses inefficiencies in handling misaligned data by using a pack instruction and control register to align and manipulate data units, enhancing performance and memory efficiency.

KR103045692B1Active Publication Date: 2026-11-06GRAPHCORE LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
KR1020247021403
Authority / Receiving Office
KR · KR
Patent Type
Patents
Current Assignee / Owner
Priority Date
2021-12-31
Filing Date
2022-10-10
Publication Date
2026-11-06
Estimated Expiration
2042-10-10

AI Technical Summary

Technical Problem

Existing data processing devices face limitations due to architectural constraints that restrict memory access to aligned addresses, leading to inefficiencies when handling misaligned data, which can result in performance degradation and wasted memory space.

Method used

A data processing device equipped with a pack instruction and control register to handle misaligned data by loading and storing data units in registers, allowing for efficient alignment and manipulation of data without requiring additional memory access.

Benefits of technology

Enables efficient processing of misaligned data without performance degradation, optimizing memory usage and reducing the need for additional load operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 112024069308893-PCT00003_ABST
    Figure 112024069308893-PCT00003_ABST
Patent Text Reader

Abstract

A new type of instruction and a control register for the new type of instruction are provided to handle data that may not be aligned in memory. A first part of data (which may not be aligned in memory) is loaded into a first set of registers by loading a first atom containing the first part of data into the registers. A pack instruction is executed by an execution unit to place a portion of data from one set of registers (the length and starting position are indicated by the second and third values ​​of the control register) into an identified location within another set of registers (identified by the first value of the control register).
Need to check novelty before this filing date? Find Prior Art

Description

Technology Field

[0001] The present disclosure relates to a data processing device, and in particular to a data processing device comprising an execution unit configured to execute an instruction for accessing data from a memory of the data processing device. Background Technology

[0002] A processing device may include an execution unit and memory. An execution unit may execute one or more program threads to perform operations on data loaded from memory to produce a result and to store the result in memory. The result may be subject to subsequent processing by the execution unit or may be dispatched from the processing device.

[0003] When accessing data in memory, there may be specific constraints on accessing that data. In particular, there may be architectural constraints that limit the memory addresses where load and save operations can be performed. These memory addresses are determined by the size of the load and save operations provided as part of the instruction set for the processing device.

[0004] Refer to FIG. 1, which illustrates a memory unit (100) in which a data unit can be loaded by an execution unit and a data unit can be stored by an execution unit. Assume that the execution unit is configured to execute a load instruction for a data unit with a width of 4 bytes. In this case, each load instruction may cause one of four data units with a width of 4 bytes to be loaded from the memory unit (100). For example, the load instruction may be used to load 4 bytes of data starting at memory address 0x80000 or to load 4 bytes of data starting at memory address 0x80004. However, given the architectural constraints of the processing device, it is impossible to load data starting at memory address 0x80002, because this memory address is not aligned with the memory access size. Similar constraints are provided for storage. If each storage instruction causes 4 bytes to be stored in the memory unit (100), given the architectural constraints of the processing device, only 4-byte aligned storage may be performed. These memory addresses (e.g., memory addresses 0x80000, 0x80004, 0x80008, 0x80012, 0x80016) for which load or store operations are permitted by the architectural constraints of the processing device are referred to herein as aligned memory addresses. Data for which at least one of the boundaries (i.e., the start and end addresses) does not belong to any of these aligned memory addresses is referred to as misaligned data.

[0005] There is a problem with the restrictions imposed on the starting address of data for load and save operations, which means that in some cases, it may be required to perform operations on a portion of data that is not aligned with the starting address for the load or save operation. For example, in the example of FIG. 1, it may be necessary to load a portion of data starting at memory address 0x80002 of the memory unit (100). This portion of data may be loaded into a register to perform one or more specific arithmetic operations or copied to another portion of memory (through a save operation). However, given the constraint that access to aligned memory addresses is allowed only, any load operation that loads data starting at memory address 0x80002 must start at memory address 0x80000 and thus entails loading additional data that is not needed (for arithmetic operations or memory copying).

[0006] One of the proposed solutions is to reduce the size of the data accessed by load and store instructions. For example, instead of using a load instruction to load data in 4-byte units, a load instruction to perform a load of data in 1-byte units can be provided so that data of any byte can be accessed individually from the memory unit (100). However, this may result in performance degradation, especially when the portion of data to be accessed in memory is large, as a large number of load instructions may need to be executed.

[0007] Another proposed solution is to arrange all data to be accessed in memory so that it is aligned. In this way, whenever a portion of data is loaded from memory, the beginning of that portion of data is located at an address that can function as the starting address of the load operation. However, ensuring data alignment in memory may involve leaving holes in memory where useful data is not stored, because the size of all data required for the operation is unlikely to be a multiple of the load access size. Providing holes between useful data results in wasted memory space.

[0008] According to a first aspect, a data processing device is provided comprising: a memory; and at least one execution unit configured to execute load instructions to perform a load operation for loading data from the memory, wherein the memory is configured to store a first data unit, and the first data unit comprises a first portion and one or more additional portions, and the data processing device comprises a second set of one or more registers configured to store a second data unit; and a control register configured to store control values, wherein the control values ​​include: a first value indicating a starting position in which the first portion is provided in a third data unit; a second value indicating a starting position of the first portion in the first data unit; and a third value indicating the length of the first portion, and wherein the at least one execution unit executes at least one of load instructions to perform a first load operation for loading the first data unit into a first set of one or more registers; and in response to the execution of a first type of instruction and according to each of the control values, a first portion at one or more bit positions starting from a starting position indicated by the first value in a third data unit of a set of one or more registers; And it is configured to provide data from the corresponding bit positions of the second data unit to the remaining bit positions of the third data unit.

[0009] A new type of instruction, namely a new type of instruction that may be referred to as a pack instruction, and a control register for the new type of instruction are provided to process data that may not be aligned in memory. The pack instruction is executed by an execution unit to place a portion of data held in one set of registers (the length and starting position being indicated by the second and third values ​​of the control register) at an identified location (identified by the first value of the control register). For example, a first portion of data may not be aligned in memory. The first portion of data is loaded into a first set of registers by loading a first data unit (or first atom) containing the first portion of data into the corresponding registers. A second set of registers contains a second data unit. Together, the first and second units provide data for a third data unit that is to be aligned and provided to its own set of registers (to perform arithmetic operations or to store back into memory in an aligned format). When the pack instruction is executed, the execution unit causes the first part of the data to be provided to the third data unit at the location identified by the first value, and the remaining bits to be provided by the corresponding bits of the second data unit. Then, the third data unit can be operated on or stored back in memory. The pack instruction can be used with a second type of instruction called an extract instruction to perform memory copying.

[0010] In some embodiments, the memory is configured to store a second data unit, and the at least one execution unit is configured to load the second data unit into a second set of one or more registers in response to the additional execution of at least one of the load instructions before executing a first type of instruction.

[0011] In some embodiments, the set of one or more registers in which the third data unit is stored is a third set of one or more registers that is different from a first set of one or more registers and a second set of one or more registers.

[0012] In some embodiments, the set of one or more registers in which the third data unit is stored is a second set of one or more registers.

[0013] In some embodiments, the at least one execution unit is configured to execute a first type of instruction to provide a third data unit to a second set of one or more registers such that a first part overwrites a part of a second data unit.

[0014] In some embodiments, the at least one execution unit is configured to execute an initialization instruction to provide control values ​​to a control register using one or more operands indicating the location of a data buffer in memory prior to the execution of a first type of instruction, wherein the data buffer includes a first portion.

[0015] In some embodiments, one or more operands of the initialization instruction further indicate the location of a memory region in memory where the data buffer is to be copied.

[0016] In some embodiments, the memory is configured to store a second data unit in the memory area prior to the execution of a first type of instruction.

[0017] In some embodiments, the first data unit belongs to a data buffer.

[0018] In some embodiments, the data processing device includes an additional control register configured to store a single value, the single value indicates: a starting position of a third part of data within a fourth data unit; and an ending position of a fourth part of data within a fifth data unit, and the at least one execution unit is configured to execute an additional instruction of a second type to provide a sixth data unit within a set of one or more registers based on the single value, and the sixth data unit includes: a third part of data starting at a starting position indicated by the single value; and a fourth part of data ending at an ending position indicated by the single value.

[0019] In some embodiments, the at least one execution unit is configured to perform a memory copy of a buffer in memory by executing a sequence of instructions, and the memory is configured to store the buffer such that at least one of the beginning and end of the buffer is not aligned with a set of memory addresses supported as a starting address for a load operation, and the sequence of instructions includes: a first instance of an instruction of a first type; a plurality of instances of an additional instruction of a second type; and a second instance of an instruction of the first type.

[0020] In some embodiments, the at least one execution unit is configured to execute at least one initialization instruction to provide a single value to an additional control register and to provide at least one register for use by at least one instance of a plurality of instances of an instruction of the first type, using one or more operands indicating the location of a buffer in memory prior to the execution of a first instance of an instruction of the first type, and the control values ​​are used by the first instance and the second instance of an additional instruction of the first type.

[0021] In some embodiments, the memory is configured to store a first part as part of a first data unit such that at least one of the start or end of the first part is not aligned with a set of memory addresses supported for use as a start address for a load operation.

[0022] In some embodiments, sets of memory addresses in memory are spaced apart from each other by a fixed amount, and the fixed amount includes one of: 32 bits; 64 bits; or 128 bits.

[0023] According to a second aspect, a method is provided in a data processing device comprising at least one execution unit that supports the execution of load instructions to perform a load operation for loading data from memory of the processing device, the method comprising: storing a first data unit in memory, wherein the first data unit comprises a first portion and one or more additional portions; storing a second data unit in a second set of one or more registers; storing control values ​​in a control register, wherein the control values ​​comprise: a first value indicating a starting position where the first portion is provided in a third data unit; a second value indicating a starting position of the first portion in the first data unit; and a third value indicating the length of the first portion; executing at least one of load instructions to perform a first load operation for loading the first data unit into a first set of one or more registers; and, in response to the execution of a first type of instruction and according to each of the control values, a first portion at one or more bit positions starting from a starting position indicated by the first value in a third data unit of a set of one or more registers; And includes the step of providing data from the corresponding bit positions of the second data unit to the remaining bit positions of the third data unit.

[0024] In some embodiments, the method comprises the steps of: storing a second data unit in memory; and loading the second data unit into a second set of one or more registers in response to the additional execution of at least one of load instructions before executing a first type of instruction.

[0025] In some embodiments, the set of one or more registers in which the third data unit is stored is a third set of one or more registers that is different from a first set of one or more registers and a second set of one or more registers.

[0026] In some embodiments, the set of one or more registers in which the third data unit is stored is a second set of one or more registers.

[0027] In some embodiments, the method includes the step of executing a first type of instruction to provide a third data unit to a second set of one or more registers such that the first part overwrites a part of the second data unit.

[0028] In some embodiments, the method includes the step of executing an initialization instruction to provide control values ​​to a control register using one or more operands indicating the location of a data buffer in memory prior to the execution of a first type of instruction, wherein the data buffer includes a first portion.

[0029] In some embodiments, one or more operands of the initialization instruction further indicate the location of a memory region in memory where the data buffer is to be copied.

[0030] In some embodiments, the method includes the step of storing a second data unit in a memory area prior to the execution of a first type of instruction.

[0031] In some embodiments, the first data unit belongs to a data buffer.

[0032] In some embodiments, the method comprises the step of storing a single value in an additional control register, wherein the single value indicates: a starting position of a third part of data within a fourth data unit; and an end position of a fourth part of data within a fifth data unit, and the method comprises the step of executing a second type of additional instruction to provide a sixth data unit within a set of one or more registers based on the single value, wherein the sixth data unit includes: a third part of data starting at a starting position indicated by the single value; and a fourth part of data ending at an end position indicated by the single value.

[0033] In some embodiments, the method comprises: storing a data buffer in memory such that at least one of the beginning and end of the buffer is misaligned with a set of memory addresses supported as a starting address for a load operation; and performing a memory copy of the buffer in memory by executing a sequence of instructions, wherein the sequence of instructions comprises: a first instance of an instruction of a first type; a plurality of instances of an additional instruction of a second type; and a second instance of an instruction of the first type.

[0034] In some embodiments, the method comprises: executing at least one initialization instruction to provide the single value to an additional control register and to provide it to at least one register, using one or more operands indicating the location of a buffer in memory prior to the execution of a first instance of an instruction of a first type, and the control values ​​are used by the first instance and the second instance of an additional instruction of the first type.

[0035] In some embodiments, the method includes the step of storing a first part as part of a first data unit such that at least one of the start or end of the first part is not aligned with a set of memory addresses supported for use as a start address for a load operation.

[0036] In some embodiments, sets of memory addresses in memory are spaced apart from each other by a fixed amount, and the fixed amount includes one of: 32 bits; 64 bits; or 128 bits.

[0037] According to a third aspect, a computer program is provided comprising a set of computer-readable instructions that cause a method according to a second aspect or any embodiment to be performed when executed by at least one execution unit of a processing device. The computer-readable instructions include load instructions that cause a load operation to be performed to load data from memory when executed.

[0038] According to the fourth aspect, a non-transient computer-readable medium for storing a computer program according to the third aspect is provided. Brief explanation of the drawing

[0039] To better understand the present invention and to show how the present invention can be implemented, we will now refer to the attached drawings by way of example: FIG. 1 illustrates the concept of an aligned memory address; FIG. 2 illustrates a processor in which an embodiment is implemented; FIG. 3 illustrates an exemplary use of providing a data unit in response to the execution of a pack instruction; FIG. 4 illustrates an exemplary use of providing a data unit in response to the execution of an extraction command; FIG. 5a illustrates the state of the registers and memory after the execution of the first initialization instruction; FIG. 5b illustrates an update to the register state in response to the execution of a load instruction, a first extract instruction, and a first pack instruction; FIG. 5c illustrates an update to the memory state in response to the execution of a save instruction; FIG. 5d illustrates the state of the registers and memory after the execution of the second initialization instruction; FIG. 5e illustrates updates to register and memory states in response to the execution of a load instruction, a second extract instruction, and a store instruction; FIG. 5f illustrates the update of the state of registers and memory in response to the execution of a load instruction, a third extract instruction, and a store instruction; FIG. 5g illustrates an update to the register state in response to the execution of the load instruction, the fourth extract instruction, and the second pack instruction; and FIG. 5h illustrates an update to the memory state in response to the execution of a save instruction; FIG. 6 illustrates the use of a single-pack instruction for aligning data to be processed in memory; and FIG. 7 illustrates a method according to an embodiment of the present application. Specific details for implementing the invention

[0040] An embodiment is implemented in a processing device that may take the form of a processor (4), which is described in more detail with reference to FIG. 2. In some embodiments, the processor (4) may take the form of a tile (4) of a multi-tile processing unit. Examples of such multi-tile processing units are described in more detail in our prior application, U.S. Application No. 16 / 527,410, incorporated by reference.

[0041] Refer to FIG. 2, which illustrates an example of a processor (4) including details of an execution unit (18) and a context register (26). The illustrated processor (4) includes a weight register file (26W), so it can be specifically adapted for machine learning applications in which a machine learning model is trained by adjusting weights for the model. However, embodiments of the application are not limited to machine learning applications and are more broadly applicable. Additionally, the described processor (4) is a multi-threaded processor capable of executing M threads simultaneously. The processor (4) can support the execution of M worker threads and one supervisor thread, where the worker threads perform arithmetic operations on data to produce results, and the supervisor thread coordinates the worker threads and controls the synchronization, transmission, and reception functions of the processor (4).

[0042] The processor (4) includes a respective instruction buffer (53) for each of the M threads that can be executed simultaneously. The context register (26) includes a respective main register file (MRF) (26M) for each of the M worker contexts and supervisor contexts. The context register further includes a respective auxiliary register file (ARF) (26A) for at least each worker context. The context register (26) further includes a common weight register file (WRF) (26W) that can be accessed for reading by all currently executing worker threads. The WRF may be associated with the supervisor context in that the supervisor thread is the only thread that can write to the WRF. The context register (26) may also include a separate group of control status registers (26CSR) for each of the supervisor and worker contexts. The execution unit (18) includes a main execution unit (18M) and an auxiliary execution unit (18A). The main execution unit (18M) includes a load-store unit (LSU) (55) and an integer arithmetic logic unit (IALU) (56). The auxiliary execution unit (18A) includes at least a floating-point arithmetic unit (FPU).

[0043] In each of the J interleaved time slots (S0...SJ-1), the scheduler (24) controls the fetch step (14) to fetch at least one instruction of each thread from the instruction memory (11) into each of the J instruction buffers (53) corresponding to the current time slot. In the embodiment, each time slot is one execution cycle of the processor, but other methods (e.g., weighted round robin) are not excluded. In each execution cycle of the processor (4) (i.e., each cycle of the processor clock that clocks the program counter), the fetch step (14) fetches a single instruction or a small "instruction bundle" (e.g., a 2-instruction bundle or a 4-instruction bundle) according to the embodiment. Subsequently, each instruction is issued via the decoder stage (16) to either the LSU (55) or IALU (56) of the main execution unit (18A) or the FPU of the auxiliary execution unit (18A), depending on whether the instruction (depending on the opcode) is a memory access instruction, an integer arithmetic instruction, or a floating-point arithmetic instruction. The LSU (55) and IALU (56) of the main execution unit (18M) execute the instruction using registers from the MRF (26M), where specific registers within the MRF (26M) are specified by the operands of the instruction. The FPU of the auxiliary execution unit (18A) performs operations using registers of the ARF (26A) and WRF (26W), where specific registers within the ARF are specified by the operands of the instruction. In an embodiment, the registers of the WRF may be implicit for the instruction type (i.e., predetermined for the corresponding instruction type). The auxiliary execution unit (18A) may include a circuit in the form of a logic latch inside the auxiliary execution unit (18A) to maintain some internal state (57) for use in performing one or more operations of a floating-point arithmetic instruction type.

[0044] In an embodiment where instructions are fetched and executed as bundles, individual instructions of a given instruction bundle are executed simultaneously in parallel in independent pipelines (18M, 18A) (shown in FIG. 2). In an embodiment where two instruction bundles are executed, the two instructions may be executed simultaneously in their respective auxiliary pipelines and main pipelines. In this case, the main pipeline is arranged to execute instructions of the type using MRF, and the auxiliary pipeline is used to execute instructions of the type using ARF. Instruction pairing to appropriate complementary bundles can be handled by the compiler.

[0045] Each worker thread context has its own instance of a main register file (MRF) (26M) and an auxiliary register file (ARF) (26A) (i.e., one MRF and one ARF for each barrel thread slot). It should be understood that the functions described herein with respect to the MRF or ARF operate on a context basis. However, there is a single shared WRF (weight register file) that is shared among threads. Each thread can access only the MRF and ARF of its own context (26). However, all currently executing worker threads can access the common WRF. Thus, the WRF provides a common set of weights available to all worker threads. In the embodiment, only the supervisor can write to the WRF, and workers can read only from the WRF.

[0046] The instruction set of the processor (4) includes at least one type of load instruction in which, when executed, the opcode causes the LSU (55) to load data from data memory (22) into each ARF (26A) of the thread where the load instruction is executed. The destination location within the ARF is specified by the operand of the load instruction. Another operand of the load instruction specifies the address register of each MRF (26M) that holds a pointer to the address of the data memory (22) to be loaded. The instruction set of the processor (4) also includes at least one type of store instruction in which, when executed, the opcode causes the LSU (55) to store data from each ARF of the thread where the store instruction is executed into data memory (22). The store source location within the ARF is specified by the operand of the store instruction. Another operand of the store instruction specifies the address register of the MRF that holds a pointer to the address of the data memory (22) to be stored. Generally, the instruction set may include separate load and save instruction types, and / or at least one load-save instruction type that combines load and save operations into a single instruction.

[0047] In response to an opcode of the type associated with an arithmetic instruction, the arithmetic unit (e.g., FPU) of the auxiliary execution unit (18A) performs an arithmetic operation as specified by the opcode, which includes operations on the values ​​in the specified source registers in each ARF of the thread and optionally the source registers in the WRF. It also outputs the result of the arithmetic operation to the destination registers in each ARF of the thread as explicitly specified by the destination operand of the arithmetic instruction.

[0048] It will be understood that the labels "main" and "secondary" are not necessarily restrictive. In the embodiments, they may be any first register file (per worker context), second register file (per worker context), and shared third register file (e.g., part of a supervisor context but accessible to all workers). The ARF (26A) and secondary execution unit (18) may also be called the arithmetic register file and arithmetic execution unit because they are used for arithmetic instructions (or at least floating-point arithmetic). The MRF (26M) and secondary execution unit (18) may also be called the memory address register file and arithmetic execution unit because one of their uses is accessing memory. The weight register file (WRF) (26W) is so called because it is used to hold multiplication weights used for a specific type or type of arithmetic instruction, which will be discussed in more detail later. For example, it may be used to represent node weights in a neural network. In other words, the MRF can be called an integer register file because it is used to hold integer operands, whereas the ARF can be called a floating-point register file because it is used to hold floating-point operands. In an example where instructions are executed in two bundles, the MRF is a register file used by the main pipeline and the ARF is a register used by the auxiliary pipeline.

[0049] However, it should be noted that in an alternative embodiment, the register space (26) does not necessarily need to be divided into these separate register files for these different purposes. Instead, instructions executed through the main execution unit and the auxiliary execution unit may specify registers from the same shared register file (one register file per context in the case of a multithreaded processor). Also, the pipeline (13) does not necessarily need to include parallel configuration pipelines (e.g., an auxiliary pipeline and a main pipeline) to execute instruction bundles simultaneously.

[0050] The processor (4) may also include an exchange interface (51) for exchanging data between memory (11) and one or more other resources, such as other instances of the processor and / or external devices such as a network interface or a NAS (Network Attached Storage) device. As described above, in the embodiment, the processor (4) may form one of an array (6) of interconnected processor tiles, each tile executing a portion of a broader program. Thus, individual processors (4) (tiles) form a portion of a broader processor or processing system (6). The tiles (4) may be connected together through an interconnection subsystem (34) connected via each exchange interface (51). The tiles (4) may be implemented on the same chip (i.e., die) or on different chips, or in combination (i.e., the array may be formed as multiple chips each containing multiple tiles (4). Thus, the interconnection system (34) and the exchange interface (51) may include an internal (on-chip) interconnection mechanism and / or an external (inter-chip) exchange mechanism.

[0051] As mentioned, the LSU (55) can execute load and store instructions to load and store data units in tile memory (11). These operations are subject to an architectural constraint that load and store instruction operations can only be performed at aligned memory addresses. These aligned memory addresses may be 32-bit, 64-bit, 128-bit, or multiples of other bit counts depending on the instruction set architecture. Consequently, some of the data to be loaded from memory (11) may not be aligned, which means that at least one of the boundaries (start and / or end) of the data does not belong to an aligned memory address. Consequently, any load operation to load data must involve an operation to load additional data from memory.

[0052] According to an embodiment of the application, the processor (4) may execute a load instruction to load data from memory into a register of the processor (4) (e.g., a register belonging to ARF (26A)). In particular, a first load instruction is executed to load a first data unit into a first set of one or more registers, and a second load instruction is executed to load a second data unit into a second set of one or more registers. Then, the processor (4) executes a pack instruction to form a third data unit in a register, wherein the third data unit includes a first portion from the first data unit and data from corresponding bit positions of the second data unit. The first portion of the data is provided at the location of the third data unit, indicated by control values ​​for the pack instruction, so that the data can be placed as needed. This may be used for memory copying, wherein the pack instruction is used in conjunction with an extract instruction to copy a data buffer spanning a memory address range that is not accessible using a single load instruction, or may be used to align a portion of the data unit at the beginning of a register set operated by an arithmetic operation.

[0053] Each data unit discussed in this specification (i.e., the first data unit, the second data unit, and the third data unit) may also be referred to as an atom. Each atom / unit of data represents an amount of data loaded in a single load operation or stored in a single store operation. In the described embodiment, each of these atoms has a size of 128 bits. Each of these load and store operations is performed in response to a load instruction or a store instruction. The load instruction used to perform the described load instruction may be a double load instruction, where two load operations are performed in response to the execution of the same double load instruction. Similarly, the store instruction used to perform the described store instruction may be a double store instruction, where two store operations are performed in response to the execution of the same double store instruction.

[0054] A second type of instruction that can be used with the pack instruction is also described herein. The pack instruction operates to provide a third data unit identical to the second data unit, except for a specific number of bit positions within the third data unit where a portion of the first data unit is inserted. On the other hand, a second type of instruction called the "extract instruction" operates to provide a result data unit, wherein the result data unit consists of data extracted from the input data unit up to a specified pivot point, and the result data unit thereafter consists of data extracted from additional input data units. As described, when performing a memory copy of a data buffer from one memory location to another, both the pack instruction and the extract instruction are executed as part of the memory copy process.

[0055] In the description below, reference is made to instructions and operations performed by execution units. However, it is not necessary to execute different instructions in the same execution unit. In the embodiment, load and store instructions are executed by the LSU (55), while pack and extract instructions are executed by the execution unit of the auxiliary pipeline (18A). References below to operations performed by execution units should be interpreted as operations performed by one or more execution units or processors, e.g., at least one execution unit of the processor (4), unless specified as being performed by a specific execution unit.

[0056] Refer to FIG. 3, which illustrates an example of the operation of a pack instruction. FIG. 3 illustrates a first data unit (300) stored in memory and a second data unit (310) stored in memory at a different location. In this example, the first data unit (300) is stored in a memory portion starting at memory location 0x82000, while the second data unit (310) is stored in a memory portion starting at memory location 0x80000.

[0057] The processor (4) executes load instructions to load data units into registers. Each of these load instructions is executed by the LSU (55). A first load instruction is executed to load a first data unit (300) into a first register set ($indicated as a4:7). A second load instruction is executed to load a second data unit (310) into a second register set ($indicated as a0:3).

[0058] When both data units are loaded into registers, the processor (4) executes a pack instruction to provide the third data unit to another set of registers ($a8:11). The pack instruction is executed by the execution unit of the processor’s auxiliary pipeline (18A). The pack instruction uses several operands to identify registers. Specifically, the first operand identifies the destination register (in this example, $a8:11) where the third data unit will be stored. The second operand identifies the source register (in this example, $a0:3) where the second data unit will be stored. The third operand identifies the source register (in this example, $a4:7) where the first data unit will be stored.

[0059] The PACK instruction uses various values ​​in the control register in addition to the operands, and these values ​​are referred to here as the $PACK register. These values ​​indicate (above all) the starting position of the first part of the data belonging to the first data unit to be included in the third data unit and the ending position of the second part of the data belonging to the second data unit to be included in the third data unit. The value of the $PACK register includes a first value that specifies the starting position within the destination register where the first part of the data will be written. This first value is labeled "INSERT_BYTE" in FIG. 3, and in the example of FIG. 3, the value 9 is used. The value of the $PACK register includes a second value that specifies the starting position of the first part of the data in the source register containing the first data unit. This second value is labeled "EXTRACT_BYTE" in FIG. 3, and in the example of FIG. 3, the value 2 is used. The value of the $PACK register includes a third value that specifies the size (i.e., number of bytes) of the first part of the data. This third value is labeled "NUM_BYTES" in Fig. 3, and the value 3 is used in the example of Fig. 3.

[0060] When the pack instruction is executed by the execution unit of the processor (4) using the value of the $PACK register, it causes the second data unit to be copied to the destination register and overwrites the first part of the data of the first data unit with the second part of the data in the destination register. The result is shown in FIG. 3. The destination register contains the second part (320) of the data taken from the second data unit and the first part (330) of the data taken from the first data unit. In this example, the destination register also contains an additional part (340) of the data taken from the second data unit.

[0061] It will be understood that the pack instruction can be used to move a portion of data to a new location within the atomic portion of the data. This may be useful when the first portion of the data (330) and the second portion of the data (320) need to be processed together. For example, a specific set of arithmetic operations can be performed on the two portions of the data (320, 330). Given that the size of the load and store instructions is limited to a minimum size, it may be impossible to align these portions of the data (320, 330) together in the destination register (for example, if the boundary of the first portion of the data and the end location of the second portion of the data are not aligned with the boundary where the load operation can be performed in memory).

[0062] When the third data unit is provided to the destination register, the third data unit can be immediately computed by an arithmetic operation or stored back in memory (11) before being processed.

[0063] In FIG. 3, the pack instruction is denoted as pack128, which is a version of the pack instruction in which the lengths of the first and second data units being operated and the third data unit being generated as a result are each 128 bits. However, various versions of the pack instruction that operate on data units of various sizes may also be provided. In particular, in an embodiment, as part of the four instruction sets of the processor, a version of the pack instruction that operates on data units of each 32 bits (referred to as pack32) and a version of the pack instruction that operates on data units of each 64 bits (referred to as pack64) are provided.

[0064] Refer to FIG. 4, which illustrates an example of the operation of an extract command. FIG. 4 illustrates a first data unit (400) stored in memory and a second data unit (410) stored in memory at a different location. In this example, the first data unit (400) is stored at memory location 0x80000, while the second data unit (410) is stored at memory location 0x80010. As illustrated, in this case, the first data unit (400) and the second data unit (410) are stored contiguously in memory. The extract command is useful for extracting a portion of data and combining it together when the corresponding portion of the data is not aligned with the boundaries of the data units that can be accessed by load and store commands. As illustrated, the first data unit (400) contains a first portion (420) of data, while the second data unit (410) contains a second portion (430) of data.

[0065] Before the execution of the extract instruction, the LSU (55) performs two load operations, the first of which loads the first data unit (400) into the first register set ($a4:7) and the second loads the second data unit (410) into the second register set ($a0:3).

[0066] When both data units are loaded into registers, the extract instruction is executed by the processor (4) to provide a third data unit to another set of registers ($indicated as a8:11). The extract instruction is executed by the execution unit of the processor’s auxiliary pipeline (18A). The extract instruction uses several operands to identify registers. Specifically, the first operand identifies the destination register (in this example, a8:11) where the third data unit will be stored. The second operand identifies the source register (in this example, a0:3) where the second data unit (410) will be stored. The third operand identifies the source register (in this example, a4:7) where the first data unit (400) will be stored.

[0067] In addition to the operands, the extract instruction uses the value of a control register called the $EXTRACT register here. The value of the $EXTRACT register specifies both the starting position of the first part (420) of data within the first data unit (400) and the ending position of the second part (430) of data within the second data unit (410). Since the third data unit, which is the result of executing the extract instruction, consists entirely of the first part (420) of data and the second part (430) of data, the same value (here referred to as the “pivot point”) can be used to specify both these starting and ending positions. In FIG. 4, the value is denoted as “PIVOT_POINT” and takes a value of 11, thereby specifying that the relevant starting and ending positions are at the beginning of byte 11 in each of the source register sets for the extract instruction.

[0068] When the extract instruction is executed by the execution unit of the processor (4), the value of the $EXTRACT register is used to copy a first part (420) of data from a source register containing a first data unit (400) into a part of a destination register. Additionally, in response to the execution of the extract instruction, a second part (430) of data is copied from a source register containing a second data unit (410) into a part of a destination register. As illustrated, the execution unit of the processor (4) causes the second part (430) of data to be stored in the second part of the destination register. Additionally, the execution unit of the processor (4) causes the first part (420) of data to be stored in the first part of the destination register, where the second part of the destination register follows the first part of the destination register. In this way, the location of each part (420, 430) of the destination register set is inverted relative to the location of the source register set. A first part of the data (420) is stored at the end (i.e., least significant bits) of a source register set containing a first data unit (400) and at the beginning (i.e., most significant bits) of a destination register set. A second part of the data (430) is stored at the beginning (i.e., most significant bits) of a source register containing a second data unit (410) and at the end (i.e., least significant bits) of a destination register set.

[0069] When the third data unit is provided to the destination register, the third data unit can be immediately computed by an arithmetic operation or stored back in memory (11) before being processed.

[0070] In FIG. 4, the extraction command is denoted as extract128, which is an extraction command version in which the lengths of the first and second data units being operated and the third data unit being generated as a result are each 128 bits. However, various versions of the extraction command that operate on data units of various sizes may also be provided.

[0071] FIGS. 3 and 4 provide examples in which the three sets of registers specified by the relevant instruction (i.e., two sets of source registers and a set of destination registers) are all different. However, in some examples, one of the source sets of registers may be identical to the set of destination registers, and the effect of the instruction execution is to overwrite part of the data in the source register set. Such an example is presented for the pack instruction in FIG. 6.

[0072] The extract instruction can be particularly useful when used to perform a memory copy of a buffer from one part of memory (where the buffer is not aligned with memory access boundaries) to another part of memory, when the buffer contains multiple data atoms.

[0073] An example of memory copying of an unaligned data buffer using both pack and extract instructions is described in relation to FIGS. 5a through 5h. To perform this memory copying, a method is described in which initialization instructions using specific parameters related to copying can be executed in advance by the execution unit of the processor (4) before executing pack and extract instructions to perform rearrangement of the data loaded into the registers.

[0074] Refer to FIG. 5a, which illustrates a portion of memory (11) (which may be referred to as source memory) where a buffer of data (500) is copied. The buffer (500) is copied to another portion of memory (11) (which may be referred to as destination memory). The source memory and the destination memory are each referred to as "memory," but they may form part of the same memory unit or memory bank.

[0075] The buffer (500) will be copied to a memory region (510) within the destination memory that is the same size as the buffer (500). Since the load and save operations are limited to accessing data of a minimum size (e.g., 128 bits or 64 bits), it can be seen that the boundaries of both the buffer (500) and the memory region (510) are not aligned with the memory access boundaries. Consequently, two of the load operations performed to load the data of the buffer (500) will also load some data (which is not desirable to copy to the memory region (510). Additionally, two of the save operations performed to store the data of the buffer (500) in the memory region (510) will also store some data (other than the data of the buffer (500)) in the memory region (510). Pack and extract commands can be used together to handle this situation by loading some data from the destination memory and combining it with the data in the buffer (500) to form appropriate data to be stored in the destination memory, and the final result is that the only new data stored in the destination memory is the data from the buffer (500).

[0076] Before executing the pack and extract instructions, the first initialization instruction (referred to as init128headtail) is executed. This init128headtail instruction fills the registers used to provide the first and last atoms of data to be stored in destination memory. The first atom may be referred to as the "head" atom, and the last atom as the "tail" atom. These registers include the $PACK register, which is filled with the control value used when the first pack instruction is executed. The registers also include the $EXTRACT register, which is filled with the control value used when the first extract instruction is executed. The registers also include a register (referred to as $m5) containing the control value to be used when the second (and, last) pack instruction is executed. The registers also include a register (referred to as $m4) where the address for the first load operation (referred to as the head address) for loading data from source memory is executed.

[0077] The init128headtail instruction has several operands used to provide control register values. The first of these is the starting address of the buffer (500). In the example of FIG. 5a, this is equal to 0x80002 and is in register $m0. The second operand is the starting address of the memory area (510). In the example of FIG. 5a, this is equal to 0x82004 and is in register $m1. The third of the operands is the size of the buffer (500). In the example of FIG. 5a, this size is 48 bytes and is in register $m2.

[0078] In response to the execution of the init128headtail instruction, the execution unit determines the pivot value for the $EXTRACT register by determining how many bytes the source address (e.g., 0x80002 in this example) has been displaced from the previously aligned memory address (0x80000 in this example). The previously aligned memory address is the starting address where the first load operation to load the first portion of the buffer (500) is performed. In this example, the pivot value determined by the extract instruction and stored in the $EXTRACT register is 2 bytes.

[0079] Additionally, in response to the execution of the init128headtail instruction, the execution unit determines a first control value (i.e., an insert byte) to be stored in the $PACK register. The execution unit determines the first control value (i.e., an insert byte) by determining how many bytes the source destination (e.g., 0x82004) is displaced from the previously aligned memory address (0x82000 in this example). The previously aligned memory address is the starting address where the first storage operation is performed to store a data unit containing part of the buffer (500) into the destination memory. In this example, the insert byte value determined by the extract instruction and stored in the $PACK register is 4 bytes.

[0080] The execution unit sets the second control value (i.e., extract byte) to zero in response to the execution of the init128headtail instruction. Since the data to be inserted starts at the beginning of the register set containing only the data of the buffer (500), this value is set to zero for the memory copy of the buffer. As described, the data is provided to this register set by the execution of the first extract instruction.

[0081] In response to the execution of the init128headtail instruction, the execution unit sets a third control value (i.e., number of bytes) to be equal to the amount of data in the buffer (500) to be stored in the destination memory in the first storage operation. This is visually indicated as part of the memory region (510) belonging to the first atom of the destination memory (i.e., between addresses 0x82000 and 0x82010). Thus, in the examples of FIGS. 5a through 5h, the third control value is the number of bytes between the destination address value specified in $m1 (e.g., 0x82004) and the next memory address aligned in the destination memory (e.g., 0x82010). In the examples of FIGS. 5a through 5f, the third control value is 12 bytes.

[0082] As mentioned, the execution unit determines pack control values ​​for the second (and, last) pack instruction in response to the execution of the init128headtail instruction. This is indicated as tail $PACK in FIG. 5a and is referred to as the second pack control value below.

[0083] In response to the execution of the init128headtail instruction, the execution unit determines the first control value (i.e., the insertion byte) among the second pack control values. The execution unit determines this first control value by determining the number of bytes of the memory area (510) existing in the last unit of data to be stored in the destination memory. This number of bytes is the number of bytes of the buffer (500) to be stored in the last data unit of the destination memory. In the example of FIG. 5a, the last atom of data starts at address 0x82030. The end of the memory area (510) that the execution unit can determine by adding the number of bytes of $m2 (i.e., 48) to the starting address of the memory area (510) of $m1 (i.e., 0x82004) is 0x82034. The execution unit can determine the number of bytes (i.e., 4) representing the first control value among the second pack control values ​​by subtracting the end of the memory area from the aligned memory address prior to that address (i.e., 0x82030).

[0084] In response to the execution of the init128headtail instruction, the execution unit determines the second control value (i.e., the extracted byte) of the second pack control values. The execution unit sets this value to the same value as the first control value (e.g., 4 bytes in the given example).

[0085] In response to the execution of the init128headtail instruction, the execution unit determines the third control value (i.e., the number of bytes) of the second pack control values. The execution unit sets this value to be equal to the size of the data unit loaded in each load operation (e.g., 16 bytes) minus the values ​​of the first and second control values ​​of the second pack control values ​​(e.g., 4 bytes). This represents the amount of data loaded from destination memory to be written back to destination memory in the last save operation (i.e., the save operation starting at memory address 0x82030). This value is equal to 12 bytes in the example.

[0086] Refer to FIG. 5b, which describes the operations performed after the execution of the init128headtail instruction. The execution unit executes a first load instruction (indicated as ld128pace) to load a data unit (515) from source memory into a register set. The execution unit executes a second load instruction (indicated as ld128step) to load a data unit (516) from source memory into an additional register set. The execution unit executes a third load instruction (indicated as ld128) to load a data unit (517) from destination memory into another register set.

[0087] After loading the data, the execution unit executes an extract instruction (indicated as extract128 in FIG. 5b). This instance of the extract instruction is executed using a first operand specifying a first source register set in which the data unit (516) is loaded and a second source operand specifying a register set in which the data unit (515) is loaded. Since the pivot point specified in the $EXTRACT register has a value of 2, the execution unit causes the first 2 bytes of the data unit (516) to be stored in the destination register set, and the bytes of the data unit (515) after the first 2 bytes of the corresponding unit (515) to be stored in the same destination register set. That is, in response to the extract instruction, the execution unit uses the pivot point to take the n-2 most significant bytes of the unit (515) and combines them with the least significant 2 bytes of the unit (516) to provide the entire n bytes of the unit (518). The resulting unit of data (518) resulting from the execution of this extract instruction is illustrated in FIG. 5b. As illustrated, the data unit (518) consists of data from the first unit (515), excluding the last two bytes of the data unit (518), which are the first two bytes of the second unit (516). As a result, the data unit (518) is the first total data unit of the buffer (500).

[0088] After acquiring the data unit (518), the execution unit executes a pack instruction (indicated as pack128 in FIG. 5b). The pack instruction takes a register containing the data unit (518) as a first operand specifying a source register set, and a register containing the data unit (517) as a second operand specifying a source register set. The result of executing this pack instruction is that the data unit (517) is copied to the destination register set for the pack instruction, and a portion of the data is overwritten with the data of the data unit (518). If the extraction value of the $PACK register is 0, the execution unit causes the data starting from the beginning of the data unit (518) to be written to the destination register set. If the insertion value 0x04 is given to the $PACK register, the execution unit causes the extracted data to be written to the destination register set starting from a 4-byte offset from the beginning of the destination register set. When the byte count value is 12 (0x0c in hexadecimal), the execution unit causes 12 bytes of the data unit (518) to be written to the destination register set. The result data unit (519) held in the destination register set is illustrated in FIG. 5b. This data unit (519) resulting from the execution of the first pack instruction constitutes the first data unit (519) to be stored in the destination memory.

[0089] Refer to FIG. 5c, which illustrates how the data unit (519) can be stored back into memory. In particular, the execution unit executes a store instruction (indicated as st128) to store the data unit (519) in destination memory. The store instruction uses an operand that specifies a memory address (e.g., 0x82000) aligned to a first atom of the data to be stored in destination memory as part of a memory copy. As illustrated, the load operation causes the data unit (519) to be stored starting from memory address 0x82000.

[0090] Referring to FIG. 5d, which illustrates how a second initialization instruction (referred to as init128body) can be executed and loaded into a register, values ​​are provided for processing an operation to create a data unit to be located between two last data units in destination memory. This data unit between two last data units may be referred to as a body section of the buffer (500).

[0091] When the init128body instruction is used, the value in the $EXTRACT control register is modified. This value is modified to enable an extraction operation used to create a data unit that forms the body section of the buffer (500) when stored in the memory area (510). In response to the execution of the init128body instruction, the execution unit determines a new pivot value by subtracting the previous value (e.g., 2 bytes) held in the $EXTRACT control register (determined by executing init128headtail) from the number of bytes in each data unit (e.g., 16 bytes). The result value (e.g., 14 bytes) is stored in the $EXTRACT control register instead of the previous pivot value used in the first extraction instruction.

[0092] In response to the execution of the init128body instruction, the execution unit determines the number of data atoms belonging to the body section of the buffer (500). This number is equal to the number of storage operations that must be performed to store the body section of the buffer (500) in destination memory. The body section of the buffer (500) consists of the data of the buffer (500) excluding the data of the buffer (500) stored in the destination memory of the first atom (i.e., atom (519)) or the data of the buffer (500) stored in the destination memory of the last atom (i.e., the atom starting at memory address 0x80030). In the examples of FIGS. 5a through 5h, the body section of the buffer (500) is located between memory addresses 0x82010 and 0x82030 and consists of two data atoms.

[0093] In response to the execution of the init128body instruction, the execution unit determines a memory address for a first load operation to be performed in source memory to determine the body of the buffer (500). This memory address (e.g., 0x80000 in the example) is indicated as being stored in $m0 in the example. Additionally, the execution unit determines a memory address for a first save operation for the body of the buffer (500) to the destination memory (following the save operation of the data unit (519)). This memory address (e.g., 0x82010 in the example) is indicated as being held in $m1 in the example.

[0094] Refer to FIG. 5e, which illustrates the operations performed by the processor (4) after the execution of the init128body instruction. The execution unit executes a first load instruction (indicated as ld128pace) for loading a data unit (515) from source memory and a second load instruction (indicated as ld128pace) for loading a data unit (516) from source memory. Since these same data units (515, 516) are loaded from source memory to provide a head data unit (517), in some embodiments, these data units (515, 516) are not reloaded after the execution of init128body and may remain in the set of registers previously loaded to form the head data unit (517).

[0095] After loading the data, the execution unit executes an extract instruction (indicated as extract128 in FIG. 5e). This instance of the extract instruction is executed with a first operand specifying a register set loaded as a first source register set for the data unit (516) and a second operand specifying a register set loaded as a second source register set for the data unit (515). Since the pivot point specified in the $EXTRACT register has a value of 14, the execution unit provides a data unit (520). The unit (520) contains the bytes of the data unit (515) following the first 14 bytes of the data unit (515) (i.e., the last two units). The unit (520) also contains the first 14 bytes of the data (516). The 14 bytes taken from the unit (516) come into the data unit (520) following the 2 bytes taken from the unit (515). The execution unit provides a data unit (520) to a set of destination registers identified by the operand of the extraction instruction. The data unit (520) stored in these destination registers forms a first atom of the buffer (500) body.

[0096] After providing the data unit (520), the execution unit executes a store instruction to store the data unit (520) in memory. The data unit (520) is stored at an aligned memory address, which is the next aligned memory address after the address where the data unit (519) is stored.

[0097] Refer to Fig. 5f, which illustrates how the second atom of data for the body of the buffer (500) is generated.

[0098] The execution unit executes a load instruction to load a data unit (525) into a register set. This data unit (525) is loaded at the next aligned memory address (i.e., 0x80020) following the aligned memory address (i.e., 0x80010) where the data unit (516) is loaded. This address is provided by the source address value of register $m0, which is incremented (i.e., to 0x80030) according to the load instruction executed to load the data unit (516).

[0099] After loading the data, the execution unit executes an extract instruction (indicated as extract128 in FIG. 5f). This instance of the extract instruction is executed with a first operand specifying a register set loaded as a first source register set for the data unit (525) and a second operand specifying a register set loaded as a second source register set for the data unit (516). In response to this instance of the extract instruction, the execution unit provides a data unit (526). Since the pivot value of the $EXTRACT register is 14, the unit (526) consists of the bytes of the data unit (516) following the first 14 bytes (i.e., the last 2 bytes) of the data unit (516). The unit (526) also includes the first 14 bytes of the unit (525). The 14 bytes taken from the unit (525) come after the 2 bytes taken from the unit (516) of the data unit (526). The execution unit provides a data unit (526) to a set of destination registers identified by the relevant operand of the extraction instruction. The data unit (526) stored in these destination registers forms a second atom of the buffer (500) body.

[0100] After providing the data unit (526), ​​the execution unit executes a store instruction to store the data unit (526) in memory. The data unit (526) is stored at an aligned memory address (i.e., 0x82020), which is the next aligned memory address after the address where the data unit (520) is stored. The next aligned address is provided by the value in the $m1 register. After performing the store operation, the value of this register is incremented to point to the next aligned memory address (e.g., 0x82030).

[0101] Refer to Fig. 5g, which illustrates an example of how the last atom (i.e., the tail) to be stored in destination memory is generated. To provide this last atom, a second pack instruction using a second pack control value set must be executed. To make this available when the second pack instruction is executed, the execution unit copies these values ​​(the $m5 register in the example), determined using the init128headtail instruction, into the $PACK control register.

[0102] The execution unit executes a load instruction (indicated by ld128) to load the last data unit (527) from source memory into a register set. Only the first part (527a) of this data unit (527) is shown in source memory in FIG. 5g. At execution, this value is loaded from the source address value of $m0.

[0103] After loading the data unit (529), the execution unit executes an extract instruction (indicated as extract128 in FIG. 5g). This instance of the extract instruction is executed with a first operand specifying the register set loaded as the first source register set of the data unit (527) and a second operand specifying the register set loaded as the second source register set of the data unit (525). In response to this instance of the extract instruction, the execution unit provides the data unit (528). Since the pivot value of the $EXTRACT register is 14, the unit (528) consists of the bytes of the data unit (525) following the first 14 bytes (i.e., the last 2 bytes) of the data unit (525). The unit (528) also includes the first 14 bytes of the unit (527). The 14 bytes taken from the unit (527) come after the 2 bytes taken from the unit (525). The execution unit provides a data unit (528) to a set of destination registers identified by the relevant operand of the extraction instruction.

[0104] The execution unit executes an additional load instruction (ld128) to load a data unit (529) from destination memory into a register set. Only the first part (529a) of this data unit (529) is shown in FIG. 5g.

[0105] The execution unit executes a second pack instruction (indicated as pack128 in FIG. 5g). This instance of the pack instruction has one operand that designates a register containing a data unit (528) as the source register set and another operand that designates a register containing a data unit (529) as the source register set. The result of executing this pack instruction is that the data unit (528) is copied to the destination register set for the pack instruction, and part of the data (528) is overwritten with the data of the data unit (529). When the extract value 4 of the $PACK register is given, the execution unit causes the data starting from the fourth byte of the data unit (529) to be written to the destination register set. When the insert value 0x04 of the $PACK register is given, the execution unit causes the extracted data to be written to the destination register set starting from a 4-byte offset from the beginning of the destination register set. When the byte count value is 12 (0x0c in hexadecimal), the execution unit causes 12 bytes of the data unit (529) to be written to the destination register set. The effect of the pack instruction is to overwrite the data portion of the unit (528), which is not the data of the buffer (500) being copied, with the data of the destination memory. The resulting data unit (530) held in the destination register set is illustrated in FIG. 5B. This data unit (530), resulting from the execution of the second pack instruction, constitutes the last atom of the data (530) to be stored in the destination memory as part of the memory copy.

[0106] Refer to FIG. 5h, which illustrates how an execution unit executes a save instruction to store a data unit (530) in destination memory. The execution of the save instruction causes the data unit (530) to be stored starting from the next aligned memory address (i.e., 0x82030) following the memory address where the data unit (526) was stored. Only the first part (530a) of this data unit (530) is shown in FIG. 5h.

[0107] The embodiments are not limited to the use of the pack instruction to perform memory copying. For example, the pack instruction may be used to place unaligned data in memory into appropriate locations in one or more registers to be processed.

[0108] Refer to Fig. 6, which shows an example of using a pack instruction to place data at the beginning of one or more registers for processing.

[0109] Assume that one or more arithmetic operations must be performed using data (610) stored in memory. Since the data (610) is not aligned in memory, the data (610) cannot be directly loaded into an appropriate location in one or more registers using a load instruction. Therefore, a load operation is performed to load a data unit containing the data (610) into a register set $a4:7. This data unit is indicated as starting at memory address 0x82000 in FIG. 6.

[0110] When data (610) is stored in register set $a4:7, a pack instruction is executed so that data (610) is stored at the beginning of another register set $a0:3. The remaining part of the $a0:3 register is filled with the initial contents of the $a0:3 register portion. Then, one or more arithmetic operations can be executed on the data (610) aligned at the beginning of the relevant item in register $a0:3.

[0111] It will be understood that the embodiments are described merely as examples. The names used in various instructions (e.g., pack, extract, init128headtail, init128body), registers (e.g., $PACK, $EXTRACT), and register values ​​(e.g., pivot point, insert byte, extract byte, number of bytes) are names only and should not be interpreted as restrictive.

[0112] Refer to FIG. 7, which illustrates a method (700) according to an embodiment of the present application. The method (700) is a method of providing a third data unit to a register set using a first data set and a second data set.

[0113] In S710, the first data unit is stored in the memory (11) of the processing device (4). The first data unit includes a first part and one or more additional parts. The first data unit may be stored in the memory (11) by the LSU (55) of the processing device (4) or by another circuit of the processing device (4) (e.g., a receiving engine) configured to store data received from the processing device (4) in the memory (11).

[0114] In S720, the second data unit is stored in the second set of registers of the processing device (4). These registers may be the registers of ARF 26A. The second data unit may be stored in these registers by executing a load instruction to load the second data unit from memory.

[0115] In S730, control values ​​are stored in the $PACK control register.

[0116] In S740, at least one execution unit executes a load instruction to load a first data unit into a first set of one or more registers.

[0117] In S750, at least one execution unit executes a pack instruction to provide a third data unit based on control values ​​provided in a set of one or more registers. The third data unit includes a first portion in one or more bit positions starting at a starting position indicated by a first value; and the remaining bit positions of the third data unit include data from the corresponding bit positions of the second data unit.

[0118] It will be understood that the embodiments have been described merely as examples.

Claims

Claim 1 As a data processing device, the data processing device comprises: a memory; and at least one execution unit configured to execute load instructions to perform a load operation for loading data from the memory, wherein the memory is configured to store a first data unit, and the first data unit comprises a first portion and one or more additional portions, and the data processing device comprises a second set of one or more registers configured to store a second data unit; and a control register configured to store control values, wherein the control values ​​include: a first value indicating a starting position where the first portion is provided in a third data unit; a second value indicating a starting position of the first portion in the first data unit; and a third value indicating the length of the first portion, and wherein the at least one execution unit executes at least one of load instructions to perform a first load operation for loading the first data unit into a first set of one or more registers; and in response to the execution of a first type of instruction, and according to each of the control values, a first portion at one or more bit positions starting from a starting position indicated by the first value in a third data unit of a set of one or more registers; A data processing device configured to provide data from corresponding bit positions of a second data unit to the remaining bit positions of a third data unit. Claim 2 A data processing device according to claim 1, wherein the memory is configured to store a second data unit, and the at least one execution unit is configured to load the second data unit into a second set of one or more registers in response to the additional execution of at least one of load instructions before executing a first type of instruction. Claim 3 A data processing device according to claim 1 or 2, wherein the set of one or more registers in which the third data unit is stored is a third set of one or more registers different from a first set of one or more registers and a second set of one or more registers. Claim 4 A data processing device according to claim 1 or 2, wherein the set of one or more registers in which the third data unit is stored is a second set of one or more registers. Claim 5 In paragraph 4, the data processing device wherein at least one execution unit is configured to execute a first type of instruction to provide a third data unit to a second set of one or more registers such that a first part overwrites a part of a second data unit. Claim 6 A data processing device according to claim 1, wherein the at least one execution unit is configured to execute an initialization instruction to provide the control values ​​to a control register using one or more operands indicating the location of a data buffer in memory prior to the execution of a first type of instruction, and the data buffer comprises a first portion. Claim 7 A data processing device according to claim 6, wherein one or more operands of the initialization instruction further indicate the location of a memory region within the memory to which the data buffer is to be copied. Claim 8 A data processing device according to claim 7, wherein the memory is configured to store a second data unit in the memory area prior to the execution of a first type of instruction. Claim 9 In claim 7 or 8, the first data unit is a data processing device belonging to the data buffer. Claim 10 The data processing device according to claim 1, wherein the data processing device comprises an additional control register configured to store a single value, the single value indicates: a starting position of a third part of data within a fourth data unit; and an end position of a fourth part of data within a fifth data unit, and the at least one execution unit is configured to execute an additional instruction of a second type to provide a sixth data unit to a set of one or more registers based on the single value, and the sixth data unit comprises: a third part of data starting at a starting position indicated by the single value; and a fourth part of data ending at an end position indicated by the single value. Claim 11 In claim 10, the at least one execution unit is configured to perform a memory copy of the buffer in memory by executing a sequence of instructions, and the memory is configured to store the buffer such that at least one of the beginning and end of the buffer is misaligned with a set of memory addresses supported as a starting address for a load operation, and the sequence of instructions comprises: a first instance of an instruction of a first type; a plurality of instances of an additional instruction of a second type; and a second instance of an instruction of a first type, a data processing device. Claim 12 A data processing device according to claim 11, wherein the at least one execution unit is configured to execute at least one initialization instruction to provide the single value to an additional control register and to provide it to at least one register for use by at least one instance of a plurality of instances of an instruction of type 2, using one or more operands indicating the location of the buffer in memory prior to the execution of a first instance of an instruction of type 1, and the control values ​​are used by the first instance and the second instance of an additional instruction of type 1. Claim 13 A data processing device according to claim 1, wherein the memory is configured to store a first part as part of a first data unit such that at least one of the start or end of the first part is not aligned with a set of memory addresses supported for use as a start address for a load operation. Claim 14 A data processing device according to claim 13, wherein a set of memory addresses within the memory is spaced apart from each other by a fixed amount, and the fixed amount comprises: 32 bits; 64 bits; or 128 bits. Claim 15 A method implemented in a data processing device comprising at least one execution unit that supports the execution of load instructions to perform a load operation for loading data from memory of the processing device, the method comprising: storing a first data unit in memory, wherein the first data unit comprises a first portion and one or more additional portions; storing a second data unit in a second set of one or more registers; storing control values ​​in a control register, wherein the control values ​​comprise: a first value indicating a starting position where the first portion is provided in a third data unit; a second value indicating a starting position of the first portion in the first data unit; and a third value indicating the length of the first portion; executing at least one of load instructions to perform a first load operation for loading the first data unit into a first set of one or more registers; and, in response to the execution of a first type of instruction and according to each of the control values, a first portion at one or more bit positions starting from a starting position indicated by the first value in a third data unit of a set of one or more registers; A method comprising the step of providing data from corresponding bit positions of a second data unit to the remaining bit positions of a third data unit. Claim 16 A computer program comprising a set of computer-readable instructions that causes a method to be performed when executed by at least one execution unit of a processing device, wherein the computer-readable instructions include load instructions that cause a load operation to be performed for loading data from memory when executed, and the method comprises: a step of storing a first data unit in memory, wherein the first data unit comprises a first part and one or more additional parts; a step of storing a second data unit in a second set of one or more registers; a step of storing control values ​​in a control register, wherein the control values ​​include: a first value indicating a starting position where the first part is provided in a third data unit; a second value indicating a starting position of the first part in the first data unit; and a third value indicating the length of the first part; and a step of performing a first load operation for loading the first data unit into a first set of one or more registers in response to executing at least one of the load instructions. A computer program comprising the step of providing, in response to the execution of a first type of instruction and according to each of the control values, a first portion in one or more bit positions starting at a starting position indicated by a first value in a third data unit of a set of one or more registers; and providing data from corresponding bit positions of a second data unit in the remaining bit positions of the third data unit.

Citation Information

Patent Citations

  • Register move operations

    KR1020040005829A

  • Arithmetic extension in data processing units

    KR1020190119074A

  • Load-store instruction

    KR1020200083123A