System and method for loading and copying sub-vector values
The vector register is loaded through a dedicated load instruction and the sub-vector value is copied, which is directly used for vector operations. This solves the processing bottleneck in data loading and copying in the existing technology and improves the throughput and performance of the processor.
Patent Information
- Application Number
- CN201980032456.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2018-05-16
- Filing Date
- 2019-05-07
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2039-05-07
AI Technical Summary
Existing technologies have processing bottlenecks when loading and copying vector data, especially loading data from memory into registers, resulting in latency and reduced throughput.
A dedicated load instruction is used to load the vector register and copy the selected sub-vector value from the vector register for direct use in vector operations, avoiding multiple transfers through the scalar register.
Improves processor throughput, reduces the number of load instructions, reduces latency, and improves processor performance.
Smart Images

Figure CN112119375B_ABST
Abstract
Description
I. Priority claim
[0001] This patent application claims priority to U.S. Non-Provisional Patent Application No. 15 / 981,203, entitled “SYSTEM AND METHOD FOR LOADING AND COPYING SUB-VECTOR VALUES,” filed on May 16, 2018, to the present assignee, and is hereby expressly incorporated by reference in its entirety. II. Technical field
[0002] The present disclosure relates generally to processors, and more particularly to loading and copying of data for vector processing. III. Background Technology
[0003] Advances in technology have led to the emergence of more powerful computing devices. For example, computing devices such as laptop and desktop computers and servers, and wireless computing devices such as portable wireless phones have improved computing capabilities and are able to perform increasingly complex operations. Increased computing power has also enhanced device capabilities in various other applications. For example, a vehicle may include a processing device to enable global positioning system operations or other location operations, autonomous driving operations, interactive communications and entertainment operations, etc. Other examples include household appliances, security cameras, metering equipment, etc., which also incorporate computing devices to achieve enhanced functionality, such as communication between Internet of Things (IoT) devices.
[0004] The computing device may include one or more digital signal processors (DSPs), image processors, or other processing devices that perform vector processing, which includes performing multiple instances of a common operation (e.g., a multiplication operation) to process multiple elements of vector data in parallel. For example, a vector may include multiple sub-vector values (e.g., individual elements within a vector), such as 32 four-byte values. In an illustrative multiplication operation, for each vector four-byte value, the first byte is multiplied by the first one-byte value, the second byte is multiplied by the second one-byte value, the third byte is multiplied by the third one-byte value, and the fourth byte is multiplied by the fourth one-byte value. The four multiplication products are added together, and the resulting sum is added to the corresponding four-byte value in the target vector register.
[0005] To enable all of the resulting 128 multiplications to be performed simultaneously, each of the four one-byte values is read from a scalar register and copied from the scalar register (e.g., multiple copies of the four one-byte values are output substantially simultaneously, also referred to herein as "splatting" or "broadcasting") to the input of the vector multiplication circuit. However, loading the four one-byte values into the scalar register may result in a processing bottleneck due to the scalar register being loaded via conventional processor operations involving multiple transfers of data (e.g., loading the four-byte value from memory to a level 2 (L2) cache, from the L2 cache to a level 1 (L1) cache, and from the L1 cache to a scalar register in a register file). IV. Summary of the Invention
[0006] In certain aspects, a processor includes a vector register configured to load data in response to a dedicated load instruction. The processor also includes circuitry configured to copy a selected sub-vector value from the vector register.
[0007] In another aspect, a method of operating a processor includes loading a vector register in response to a dedicated load instruction, and copying a selected sub-vector value from the vector register.
[0008] In another aspect, an apparatus includes means for storing data loaded in response to a dedicated load instruction. The apparatus also includes means for copying selected sub-vector values from the means for storing data.
[0009] A particular advantage provided by at least one of the disclosed aspects is that processor throughput is increased when vector operations are performed by loading vector registers using dedicated load instructions and copying sub-vector values from vector registers, as compared to a processor that loads a value into a scalar register of a general register file and copies the value from the scalar register. For example, loading a value from an L2 cache into a general register file may include multiple transfers of data (e.g., from the L2 cache to the L1 cache, and from the L1 cache to the scalar register), which results in longer latency and reduced throughput compared to loading the value from the L2 cache into the vector register using a single transfer. Additionally, or alternatively, processor throughput may be increased by loading multiple values for copying into a vector register using a single load instruction, as compared to performing a separate load operation to load each value for copying into a scalar register of a register file. Other aspects, advantages, and features of the present disclosure will become apparent after reviewing the entire application, which includes the following sections: BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 shows a schematic diagram of a vector register in FIG. 1 and FIG. 2 shows a schematic diagram of a vector register in FIG. 1. DETAILED DESCRIPTION and claims. V. Description of the Figures
[0010] Figure 1 is a block diagram of a particular implementation of a processor that includes vector registers.
[0011] Figure 2 is used Figure 1 FIG. 1 is a diagram of a specific implementation of vector register operations.
[0012] Figure 3 It can be done by Figure 1 A flowchart of a specific embodiment of a method of operation performed by a processor.
[0013] Figure 4 It includes Figure 1 Block diagram of a processor for a portable device with vector registers. VI. Specific Implementation Methods
[0014] The specific aspects of the present disclosure are described below with reference to the accompanying drawings. In the specification, common features are represented by common reference numerals. In addition, it should be understood that some order terms (for example, "first" or "second") can be provided for reference and do not necessarily imply physical characteristics or sorting. Therefore, as used herein, ordinal terms (for example, "first", "second", "third", etc.) for modifying elements such as structures, components, operations, etc. do not necessarily indicate the priority or order of the element relative to another element, but distinguish the element from another element with the same name (but using ordinal terms). In addition, as used herein, indefinite articles ("one" and "a kind of") can indicate "one or more" instead of "one". Further, the operation "based on" condition or event execution can also be performed based on one or more other conditions or events that are not clearly recorded.
[0015] Figure 1 A processor system 100 is depicted, as further described below, the processor system includes: a vector register 172 configured to load data in response to a dedicated load instruction 170; and circuitry configured to enable copying of selected sub-vector values from the vector register 172. For example, the vector register 172 may include data corresponding to a plurality of pixels, such as a 128-byte vector including a four-byte value for each of 32 pixels. Each of the four-byte values forms a sub-vector value that may be selected for copying (e.g., generating multiple copies). Each copy of the selected sub-vector value may be used for a vector operation, as described in further detail below.
[0016] The processor system 100 includes a memory 102 coupled to the processor 101. The processor 101 includes a processor memory system including an L2 cache 104 and an L1 cache 106. The scalar component includes one or more execution units of a general register file, such as a representative execution unit 116, and one or more scalar registers, such as a representative scalar register 126. The vector component includes a vector register 172 coupled to a replica circuit 176, a vector register file 173, and a vector multiply-accumulate (MAC) circuit 178. The vector register 172 is external (e.g., external) to the vector register file 173. The vector register file 173 includes a plurality of vector registers, shown as a representative second vector register 174 and a third vector register 180, which can be accessed via one or more ports of the vector register file 173. Although two vector registers are shown in the vector register file 173, in other embodiments, the vector register file 173 includes more than two vector registers.
[0017] The execution unit 116 is configured to execute a dedicated load instruction 170 to initiate a "broadside" load operation 171 that loads a vector of scalar elements 118 from the L2 cache 104 to a vector register 172, such as via a bus or set of signal lines that couples the L2 cache 104 to the vector register 172. The dedicated load instruction 170 causes multiple scalar values (e.g., 32 four-byte words) of the vector 118 to be loaded into the vector register 172 in parallel. Although a 128-byte vector formed of 32 four-byte words is used for illustration herein, in other embodiments, other vector sizes and word sizes may be used. In contrast to the broadside load operation 171 that loads the vector register 172 with data from the L2 cache 104, a conventional load operation that loads data into the scalar register 126 transfers the data from the L2 cache 104 to the L1 cache 106, and then loads a single 32-bit word from the L1 cache 106 to the scalar register 126. Broadside load operation 171 thus loads a larger amount of data into scalar register 126 than a conventional load operation, and transfers the data to vector register 172 without using the L1 cache as an intermediate stage.
[0018] The vector register 172 is configured to enable replication of selected sub-vector values of the vector of scalar elements 118. In one example, each sub-vector cell (e.g., a four-byte word) of the vector of scalar elements 118 in the vector register 172 is coupled to the replication circuit 176 and is individually selectable as an input value to the replication circuit 176 (e.g., coupled to a selectable input of a multiplexer in the replication circuit 176). When selected by the replication circuit 176, the selected four-byte sub-vector cell is replicated (e.g., multiple copies of the four-byte sub-vector value are generated substantially simultaneously) and provided at each of the 32 outputs of the replication circuit 176. In a particular embodiment, the replication circuit 176 includes a multiplexer configured to select any one of the sub-vector values stored in the vector register 172. The multiplexer has a fan-out of 32 and is configured to select a single four-byte input value from the 32 available four-byte sub-vector values in the vector register 172 and output 32 copies of the selected four-byte sub-vector value. The 32 copies of the selected four-byte sub-vector value are provided to the input of vector multiply-accumulate circuitry 178. In some embodiments, copy circuitry 176 is dedicated for use with (e.g., implemented as part of) vector registers 172, as compared to vector registers in vector register file 173 that do not have the ability to copy or "splash" selected data (e.g., vector registers 174 and vector registers 180).
[0019] The vector multiply-accumulate (MAC) circuit 178 includes a vector operation circuit configured to perform a vector operation that uses the replicated sub-vector values received from the replica circuit 176 and that uses the sub-vector values in the second vector register 174. The vector multiply-accumulate circuit 178 may be configured to store the result of the vector operation in a third vector register 180. As shown, the replicated output from the replica circuit 176 is provided to the input of the vector multiply-accumulate circuit 178. The vector data 120 from the second vector register 174 is also provided to the input of the vector multiply-accumulate circuit 178. A byte-by-byte multiplication of each four-byte word from the replica circuit 176 with the corresponding four-byte word from the second vector register 174 is performed at the vector multiply-accumulate circuit 178. The results of each byte-by-byte multiplication are added together to generate a result for each four-byte word, and the result of each four-byte word is accumulated together with the accumulated vector data 182 in the third vector register 180. As used herein, a first value is "accumulated" with a second value when the first value is combined with the second value, such as by adding the first value to the second value. In some embodiments, the second value is "accumulated data" that represents a running total of multiple values to be accumulated with the second value, such as representing an output pixel that is determined during a filtering operation and has a value that is calculated as a weighted sum of multiple input pixel values.
[0020] Multiple instances of the replica circuit 176 are coupled to the vector register 172 to enable: multiple sub-vector values can be selected from the vector register 172, and the selected sub-vector values are replicated for input to a vector operation. For example, the processor 101 includes four instances of the replica circuit 176. Each instance of the replica circuit 176 is configured to select a different four-byte word from the vector register 172, replicate the selected four-byte word, and provide the replicated four-byte word to the vector multiply-accumulate circuit 178. Therefore, in response to a single vector instruction 184 (such as a vector multiply-accumulate (MAC) instruction), four vector multiply-accumulate operations can be performed in parallel on the vector data 120 using four selected four-byte words from the vector register 172. The vector instruction 184 is a special instruction that causes the processor 101 to select one or more sub-vector values from the vector register 172, replicate the one or more sub-vector values to the input of the vector multiply-accumulate circuit 178, and perform a vector operation at the vector multiply-accumulate circuit 178 using the replicated one or more sub-vector values.
[0021] For illustration, the vector MAC instruction 184 may include a parameter indicating an offset into the vector register 172, and each instance of the replica circuit 176 may select a corresponding four-byte word for replication based on the parameter. For example, the parameter may specify a value indicating one of the first eight four-byte words in the vector register 172. The parameter may be used to generate a selection signal at the control input of a multiplexer of the first instance of the replica circuit 176 to cause the multiplexer to select the indicated four-byte word. The replica circuit 176 may include an offset generation circuit configured to add the offset to the parameter to generate a second value indicating one of the four-byte words in the next group of eight four-byte words in the vector register 172, a third value indicating one of the four-byte words in the third group of eight four-byte words in the vector register 172, and a fourth value indicating one of the four-byte words in the fourth group of eight four-byte words in the vector register 172. The second value may be used to generate a second selection signal at the control input of the second multiplexer of the second instance of the replica circuit 176 to cause the second multiplexer to select the second indicated four-byte word. The third value may be used to generate a third selection signal at the control input of the third multiplexer of the third instance of the replica circuit 176 to cause the third multiplexer to select the third indicated four-byte word. The fourth value may be used to generate a fourth selection signal at the control input of the fourth multiplexer of the fourth instance of the replica circuit 176 to cause the fourth multiplexer to select the fourth indicated four-byte word. In the illustrative example where the parameter indicates the starting byte of the selected four-byte word in the first group of 8 four-byte words, the offset generation circuit applies a multiple of 32 bytes to the value of the parameter to select the remaining four-byte words for replication (e.g., select words starting at byte 8, byte 40, byte 72, and byte 104).
[0022] Alternatively, the vector instruction 184 may enable access to the vector register 172 via indirection. For illustration, the vector instruction 184 may include a parameter identifying a register (e.g., the scalar register 126), and the value stored in the identified register may be used as an offset into the vector register 172. For example, the parameter may identify a scalar register storing a scalar value indicating a selected sub-vector value. As described above, the additional offset may be calculated by adding a multiple of 32 bytes to the value stored in the identified register. Thus, the processor 101 includes circuitry configured to access a scalar value (e.g., an offset) from the scalar register 126, wherein the scalar value indicates a selected sub-vector element in the vector register 172.
[0023] During operation, the processor 101 executes instructions to perform vector operations, such as applying a filtering operation to a set of pixel data. For illustration, the set of pixel data may represent pixels of an image captured by a camera and loaded into the memory 102, and the filtering operation may include processing the pixel data using an edge detection filter to identify edges in the pixel data. In another illustrative example, the pixel data corresponds to elements in a convolutional layer of a neural network and does not necessarily represent image data. Data representing the filter may be loaded from the L2 cache 104 into a vector register 174 in a vector register file 173 as vector data 120 via a vector load operation. The processor 101 executes a dedicated load instruction 170 to load the data to be filtered into the vector register 172. For example, a portion (e.g., a first portion) of the pixel data is loaded from the L2 cache 104 into the vector register 172 via a broadside load operation 171.
[0024] After loading the first portion of the pixel data into the vector register 172, the processor 101 executes the vector multiply-accumulate instruction 184 to multiply one or more copies of the vector 118 with the portion of the vector data 120. For example, the first instance of the copy circuit 176 selects and copies the first four-byte word of the vector 118 and outputs a copy of the first four-byte word to each of the 32 inputs to the vector multiply-accumulate circuit 178. The vector register 174 also provides 32 four-byte values (e.g., 32 filter weights) from the vector data 120 to the input of the vector multiply-accumulate circuit 178. The vector multiply-accumulate circuit 178 multiplies each copy of the first four-byte word from the vector 118 with the corresponding four-byte word from the vector data 120 in parallel to generate 32 multiplication results. Each of the 32 multiplication results is accumulated with the corresponding value in the vector register 180 to generate 32 update values in the accumulated vector data 182.
[0025] In parallel with the first instance of copy circuit 176 selecting and copying the first four-byte word of vector 118, the second instance of copy circuit 176 selects and copies the second four-byte word of vector 118, the third instance of copy circuit 176 selects and copies the third four-byte word of vector 118, and the fourth instance of copy circuit 176 selects and copies the fourth four-byte word of vector 118. As used herein, two or more operations performed "in parallel" are performed substantially simultaneously, such as during the same clock cycle or at least partially overlapping each other in time, but not necessarily initiated (or ended) at exactly the same time as each other. Vector multiply-accumulate circuit 178 generates second, third, and fourth groups of 32 four-byte values by multiplying the 32 four-byte values from vector data 120 with the second four-byte word of vector 118, the third four-byte word of vector 118, and the fourth four-byte word of vector 118, respectively. The second, third, and fourth groups of 32 four-byte values are accumulated with corresponding values in accumulated vector data 182.
[0026] The vector multiply-accumulate instruction 184 may be included in a loop that updates the position of a four-byte word selected from the vector register 172 during each loop iteration. When all values in the vector register 172 have been processed, the next broadside load operation 171 may be performed to load the next batch of pixel data into the vector register 172 to continue processing, such as with reference to FIG. Figure 2 174. The resultant values in the accumulated vector data 182 may correspond to the result of applying (e.g., convolving) the filter represented by the pixel weights in the vector registers 174 to the pixel data. Although the above examples describe a use case in which the vector registers 172, the replica circuits 176, and the vector multiply-accumulate circuits 178 operate to filter the pixel data, in other embodiments, by way of non-limiting example, the vector registers 172, the replica circuits 176, and the vector multiply-accumulate circuits 178 operate according to other use cases, such as to perform matrix multiplication.
[0027] The vector registers 172 coupled to the copy circuit 176 enable selection and copying of sub-vector values for input into the vector multiply-accumulate circuit 178, and avoid delays that would be incurred if the sub-vector values were instead loaded into the scalar registers 126 and copied from the scalar registers 126 to the vector multiply-accumulate circuit 178 (e.g., delays incurred by transferring data to and from the L1 cache to the general register file are avoided). In addition, the broadside load operation 171 enables a relatively large amount of data to be transferred from the L2 cache 104 to the vector registers 172, thereby reducing the average number of load instructions that are executed by the processor 101 for each data element to be loaded from the L2 cache 104. In addition, because implementing the vector register file 173 with additional ports is relatively expensive and area-intensive, the vector register file 173 may be port-limited. In an embodiment where the vector register file 173 is port restricted, loading the vector of scalar elements 118 into a vector register within the vector register file 173 may incur delays and resource conflicts associated with transferring data into the vector register file 173 when all available ports of the vector register file 173 are used for other operations. As a result, loading the vector of scalar elements 118 into a vector register 172 that is external to the vector register file 173 and does not pass through a port of the vector register file 173 reduces delays and resource conflicts compared to loading the vector of scalar elements 118 into a vector register within the vector register file 173 in an embodiment where the vector register file 173 is port restricted.
[0028] although Figure 1 A specific illustrative embodiment of a vector register 172 in the processor 101 is depicted for purposes of explanation, but it should be understood that in other embodiments, the vector register 172 may be used in conjunction with other configurations. For example, although the replica circuit 176 is shown as being coupled to the vector register 172, in other embodiments, the replica circuit 176 is included within the vector register 172. Although four instances of the replica circuit 176 are shown as selecting and copying four values from the vector register 172 in parallel, in other embodiments, one, two, three, or more than four instances of the replica circuit 176 are configured to select and copy values from the vector register 172. In addition, the vector register 172 may be implemented to have any size and is not limited to the specific examples provided herein. In particular, the size of the vector register 172 may be orthogonal to the amount of replication, and in different embodiments, data of different sizes is loaded into the vector register 172, and different numbers of values are copied from the vector register 172.
[0029] Although the replica circuit 176 is shown as providing a replicated output to the input of the vector multiply-accumulate circuit 178, in other embodiments, the replica circuit 176 provides a replicated output to another vector processing circuit, such as a vector addition circuit, a vector multiplication circuit, a vector shift circuit, any other vector processing circuit, or any combination thereof. Similarly, although the vector instruction 184 is described as a vector multiply-accumulate instruction 184, in other embodiments, the vector instruction 184 corresponds to another type of vector instruction, such as a vector addition instruction, a vector multiplication instruction, a vector shift instruction, any other vector instruction, or any combination thereof.
[0030] Although processor 101 is shown in conjunction with a memory system that includes L1 cache 106, L2 cache 104, and memory 102, in other embodiments, processor 101 is used in conjunction with a memory system that omits one or more of L1 cache 106, L2 cache 104, or adds one or more additional memory devices (e.g., L3 memory) to memory 102, or any combination thereof. Although processor 101 is shown as including a single execution unit 116, in other embodiments, the processor includes multiple execution units and is configured to operate according to a very long instruction word (VLIW) configuration, a superscalar configuration, one or more other configurations, or any combination thereof.
[0031] Figure 2 Describes the use Figure 1 172 of the vector register 172. Three data vectors are shown as being stored in consecutive locations in the memory 102, including a first vector having elements A, B, C, and D, a second vector having elements E, F, G, and H, and a third vector having elements I, J, K, and L. Each element of the elements AL corresponds to a multi-byte value, such as a 32-byte value. In the illustrative example, each element of the elements AL corresponds to a value (e.g., a pixel) of a convolutional layer of a neural network, such as in a "bread slice" data arrangement associated with the convolutional layer. For example, a neural network configured to perform a machine vision application on input image data may include one or more convolutional layers having a bread slice data arrangement.
[0032] The first stage 202 shows loading a first vector (having elements A, B, C, and D) by executing a vector memory "vmem" instruction (dedicated load instruction 170) to load the first vector broadside into a vector register ("Z-buffer") 172. Pointer 203 indicates the location of the convolution filtering operation to be performed. The first vector loaded into the vector register 172 corresponds to a "window" into memory 102. Once loaded into the vector register 172, sub-vector values of the first vector are selected, copied, and used in the convolution filtering operation, as described below.
[0033] The second level 212 shows the Figure 1 Execution of an instruction such as vector instruction 184 of 184 processes elements A, B, C, and D. As illustrated, the instruction corresponds to a vector reduce-multiply Z-buffer instruction ("vrmpyz") executed to operate on a first vector. A loop parameter (e.g., stored in scalar register 126) for the convolution filtering operation indicates the location of the selected sub-vector value in vector register 172, e.g., starting at the first 4-byte word of element "D" and advancing to the next 4-byte word of element "D" with each loop iteration. In parallel, multiples of the 32-byte offset are applied to the location of the selected sub-vector to determine the location of the second sub-vector value, the third sub-vector value, and the fourth sub-vector value.
[0034] To illustrate, in a first loop iteration, the first four-byte value of A, the first four-byte value of B, the first four-byte value of C, and the first four-byte value of D are selected at vector register 172, copied, and provided to Figure 1 The second four-byte value of A, the second four-byte value of B, the second four-byte value of C, and the second four-byte value of D are selected, copied, and provided to Figure 1 174 or loaded into memory. The results of the multiplications are accumulated in vector register 180.
[0035] Also in the second stage 212 , the next portion of the vector register 172 is loaded into the next “window” of the memory 102 via execution of the dedicated load instruction 170 to load elements E, F, G, and H broadside into the vector register 172 .
[0036] In the third stage 222, pointer 203 is advanced by one element (i.e., stride = 1), and elements B, C, D, and E are processed in a manner similar to that described with respect to elements A, B, C, and D in the second stage 212 via execution of a vector reduce multiply Z-buffer instruction ("vrmpyz").
[0037] Processing continues with each subsequent stage which advances pointer 203 by one element and executes a vector reduce multiply Z-buffer instruction ("vrmpyz") on the four elements of the corresponding shift group.
[0038] At the sixth stage 232, the convolution filtering operation has advanced to element I, and the next "window" of memory 102 is copied to vector register 172 before starting the next stage operating on element I. In some embodiments, elements I, J, K, and L overwrite elements A, B, C, and D in vector register 172, and vector register 172 operates as a circular buffer.
[0039] By using a broadside load operation to load vector register 172 with a continuous "window" of memory 102, and splashing from each element of vector register 172 a selected value to be multiplied by a corresponding set of convolution filter weights, convolution filtering processing can be performed at a higher speed and with a reduced number of data transfers through a general register file. As a result, operations such as neural network-based image recognition can be performed more efficiently than a processor that does not include vector register 172.
[0040] Although the convolution filtering operation is described as multiplying each selected sub-vector value from vector register 172 by a common set of weights, multiple sets of weights may be used in other embodiments. As an illustrative example, the second stage 212 may include multiplying the sub-vector values from A by a first set of weights, and in parallel, the sub-vector values from B by a second set of weights, the sub-vector values from C by a third set of weights, and the sub-vector values from D by a fourth set of weights. Although Figure 2 The example shows pointer 203 advancing one element per level (stride = 1), but in other embodiments pointer 203 advances two elements per level, three elements per level, or more (i.e., the stride has any positive integer value). Figure 2 An embodiment with improved efficiency is depicted for applying convolutional filters associated with a convolutional layer of a neural network, but in other embodiments, vector registers 172 are used to provide improved efficiency for other applications such as matrix multiplication.
[0041] Figure 3 Depicts operating processors, e.g. Figure 1The method 300 includes, at 302, loading a vector register in response to a dedicated load instruction. In the illustrative example, loading the vector register includes loading multiple scalar values into the vector register in parallel. For example, Figure 1 The processor 101 executes a dedicated load instruction 170 to implement a broadside load operation 171 for loading the vector of scalar elements 118 into a vector register 172 .
[0042] Method 300 includes, at 304, copying a selected sub-vector value from a vector register. For example, processor 101 executes vector multiply-accumulate instruction 184 to cause copy circuit 176 to copy the selected sub-vector value from vector register 172, and causes vector multiply-accumulate circuit 178 to operate using the copied sub-vector value as input. In some embodiments, the selected sub-vector value is identified via a parameter of the instruction, such as a byte offset parameter provided in conjunction with vector multiply-accumulate instruction 184 and indicating the location of the selected sub-vector value in the vector register. In other embodiments, method 300 includes accessing a scalar value indicating the selected sub-vector value from a scalar register. For example, scalar register 126 may store a value of a loop variable (e.g., a byte offset value) indicating a location in vector register 172, and vector multiply-accumulate instruction 184 may include a parameter identifying scalar register 126 as the location to store the selected sub-vector value.
[0043] In some embodiments, method 300 includes performing a vector operation using the replicated sub-vector value and using the sub-vector value in the second vector register. To illustrate, vector multiply-accumulate instruction 184 is executed to cause vector multiply-accumulate circuit 178 to perform a vector multiplication of the value in vector register 174 with the replicated sub-vector value from replica circuit 176. The result of the vector operation is stored in a third vector register, such as vector register 180.
[0044] In some embodiments, method 300 includes copying a second sub-vector value from the vector register in parallel with copying the selected sub-vector value. In an illustrative example, copy circuit 176 selects four four-byte values from vector register 172 and outputs 32 instances of each of the four-byte values. In some embodiments, the second sub-vector value is explicitly selected, such as via an instruction parameter. In other embodiments, the second sub-vector value is implicitly selected, such as by copy circuitry applying an offset (e.g., a 32-byte offset) to the position of the selected sub-vector value in the vector register to select the position of the second sub-vector value in the vector register. As an illustrative example, the position of the selected sub-vector value corresponds to a position such as reference 1 to 1. Figure 2 The loop parameters for the described convolution filtering operation, and the offset corresponds to a 32-byte offset.
[0045] In some embodiments, method 300 further includes performing a second vector operation using the copied second sub-vector value in parallel with performing the vector operation. As in the illustrative example, vector multiply-accumulate circuitry 178 performs a first set of multiply-accumulate operations using the value of vector register 174 and the copied first 4-byte word from vector register 172, while also performing a second set of multiply-accumulate operations using the value of vector register 174 and the copied second 4-byte word from vector register 172.
[0046] By loading a vector register in response to a dedicated load instruction and copying a selected sub-vector value from the vector register, method 300 enables values to be loaded into a vector register that bypasses loading the value via a scalar register file. For example, vector 118 is loaded from L2 cache 104 into vector register 172 for copying and is not transferred to L1 cache and scalar register 126 for copying. Thus, potential performance bottlenecks associated with loading data into a scalar register file are avoided. In addition, multiple values may be loaded into a vector register in response to a dedicated load instruction, such as in Figure 1 171 during a single instance of a broadside load operation 171. Loading multiple values in response to a single load instruction reduces the number of load operations to be performed compared to a processor that loads a single value per load instruction. Thus, processor performance is improved due to avoiding a processor bottleneck, reducing the number of load instructions executed, or a combination thereof.
[0047] refer to Figure 4 A block diagram of a particular illustrative embodiment of an electronic device including a processor 410 is depicted and generally designated 400. Figure 1 172 of the vector buffer. As an illustrative example, the electronic device 400 may correspond to a mobile device (e.g., a cellular telephone). In other embodiments, the electronic device 400 may correspond to a computer (e.g., a server, a laptop, a tablet computer, or a desktop computer), a wearable electronic device (e.g., a personal camera, a head-mounted display, or a watch), a vehicle control system or console, a home appliance, a set-top box, an entertainment unit, a navigation device, a television, a monitor, a tuner, a radio (e.g., a satellite radio), a music player (e.g., a digital music player or a portable music player), a video player (e.g., a digital video player such as a digital video disc (DVD) player or a portable digital video player), a robot, a healthcare device, another electronic device, or a combination thereof.
[0048] The device 400 includes a processor 410, such as a digital signal processor (DSP), coupled to a memory 432. The processor 410 includes a vector buffer 172 and is configured to execute Figure 1 170 to perform a broadside load into a vector register 172. The processor 410 is also configured to execute Figure 1 The vector multiply-accumulate instruction 184 includes copying one or more sub-vector values in the vector register 172. In some embodiments, the processor 410 corresponds to Figure 1 Processor 101.
[0049] The memory 432 may be coupled to or integrated within the processor 410. The memory 432 may include a random access memory (RAM), a magnetoresistive random access memory (MRAM), a flash memory, a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), one or more registers, a hard disk, a removable disk, a compact disk read-only memory (CD-ROM), another storage device, or a combination thereof. The memory 432 stores one or more instructions that can be executed by the processor 410 to perform operations, such as the special purpose load instruction 170 and the vector multiply-accumulate instruction 184.
[0050] Figure 4 Also shown is a display controller 426 coupled to the digital signal processor 410 and to a display 428. A coder / decoder (CODEC) 434 may also be coupled to the digital signal processor 410. A speaker 436 and a microphone 438 may be coupled to the CODEC 434.
[0051] Figure 4 It is also indicated that a wireless controller 440 may be coupled to the processor 410 and to an antenna 442. In certain embodiments, the processor 410, the display controller 426, the memory 432, the CODEC 434, and the wireless controller 440 are included in a system-in-package or system-on-chip device 422. In certain embodiments, an input device 430 and a power supply 444 are coupled to the system-on-chip device 422. Furthermore, in certain embodiments, as shown in FIG. Figure 4 4, the display 428, input device 430, speaker 436, microphone 438, antenna 442, and power supply 444 are external to the system-on-chip device 422. However, each of the display 428, input device 430, speaker 436, microphone 438, antenna 442, and power supply 444 may be coupled to a component of the system-on-chip device 422, such as an interface or controller.
[0052] For example, as referenced Figures 1 to 4As described in any one or more of the figures, the aforementioned disclosed devices and functions can be designed and configured into computer files (e.g., RTL, GDSII, GERBER, etc.) stored on computer readable media. Some or all of these files can be provided to a manufacturing manager who manufactures devices based on these files. The resulting products include semiconductor wafers, which are then cut into semiconductor dies and packaged into semiconductor chips. The chips are then used in the above-mentioned devices.
[0053] In conjunction with the disclosed examples, a non-transitory computer-readable medium (e.g., memory 102 or memory 432) stores instructions (e.g., dedicated load instructions 170 and vector multiply-accumulate instructions 184) that can be executed by a processor to cause the processor to load a vector register, such as vector register 172, in response to the dedicated load instruction and copy the selected sub-vector value from the vector register. For example, in certain aspects, memory 102 stores instructions to cause processor 101 to execute Figure 3 Method 300.
[0054] In conjunction with the disclosed examples, an apparatus includes a device for storing data loaded in response to a dedicated load instruction. For example, the device for storing data may correspond to Figure 1 or Figure 4 The vector register 172 of the loader, one or more other circuits or devices that store data in response to a dedicated load instruction, or any combination thereof.
[0055] The apparatus also includes means for copying the selected sub-vector value from the means for storing data. For example, the means for copying may correspond to Figure 1 replication circuit 176, one or more other circuits or devices for replicating the selected sub-vector value, or any combination thereof.
[0056] In some embodiments, the apparatus further comprises a second device for storing data (e.g., Figure 1 vector register 174), a third device for storing data (e.g., Figure 1 ), and a device for performing a vector operation using the copied sub-vector value and using the sub-vector value in the second device for storing data and for storing the result of the vector operation in the third device for storing data (e.g., Figure 1 Vector multiplication and accumulation circuit 178).
[0057] Those skilled in the art will further appreciate that the various illustrative logic blocks, configurations, modules, circuits, and algorithm steps described in conjunction with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or a combination of both. Various illustrative components, blocks, configurations, modules, circuits, and steps have been generally described above in terms of functionality. Whether this functionality is implemented as hardware or software depends on the specific application and the design constraints imposed on the overall system. Those skilled in the art may implement the described functionality in different ways for each specific application, but such implementation decisions should not be interpreted as resulting in a departure from the scope of the present disclosure.
[0058] Parts of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented directly in hardware, in software modules executed by a processor, or in a combination of the two. The software module may reside in a random access memory (RAM), a flash memory, a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a register, a hard disk, a removable disk, a compact disk read-only memory (CD-ROM), or any other form of storage medium known in the art. An exemplary non-temporary (e.g., tangible) storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. In an alternative, the storage medium may be integrated with the processor. The processor and the storage medium may reside in an application specific integrated circuit (ASIC). The ASIC may reside in a computing device or a user terminal. In an alternative, the processor and the storage medium may reside in a computing device or a user terminal as discrete components.
[0059] The previous description of the disclosed embodiments is provided to enable those skilled in the art to make or use the disclosed embodiments. Various modifications to these embodiments will be apparent to those skilled in the art, and the principles defined herein may be applied to other embodiments without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the embodiments shown herein, but should be given the widest possible scope consistent with the principles and novel features as defined in the appended claims.
Claims
1. A processor, comprising: a vector register configured to be loaded with data in response to a dedicated load instruction; Vector operation circuit; and A copy circuit is configured to copy a selected sub-vector value from the vector register independently of any vector register in the vector operation circuit and input multiple copies of the selected sub-vector value to the vector operation circuit. 2 . The processor of claim 1 , wherein the replica circuit is configured to access a scalar value from a scalar register, the scalar value indicating the selected sub-vector value.
3. The processor of claim 1, wherein the dedicated load instruction is configured to load multiple scalar values into the vector register in parallel.
4. The processor of claim 1 , further comprising: The second vector register, and The vector operation circuit is configured to perform a vector operation using the copied sub-vector value and using the sub-vector value in the second vector register.
5. The processor of claim 4, further comprising a vector register file, the vector register file comprising the second vector register, and wherein the vector register is external to the vector register file.
6. The processor of claim 4, wherein the copy circuit is further configured to copy a second sub-vector value from the vector register in parallel with copying the selected sub-vector value. 7 . The processor of claim 6 , wherein the vector operation circuitry is configured to perform a second vector operation in parallel with performing the vector operation, the second vector operation using the replicated second sub-vector value.
8. The processor of claim 6, wherein the replica circuit is configured to apply an offset to a position of the selected sub-vector value in the vector register to select a position of the second sub-vector value in the vector register.
9. The processor of claim 8, wherein the position of the selected sub-vector value is indicated by a loop parameter of a convolution filtering operation.
10. A method of operating a processor, the method comprising: loading a vector register in response to a dedicated load instruction; Independently of any vector registers in the vector operation circuitry, copying the selected sub-vector value from the vector register; and The selected multiple copies of the sub-vector value are input to the vector operation circuit. 11 . The method of claim 10 , further comprising accessing a scalar value from a scalar register, the scalar value indicating the selected sub-vector value. 12 . The method of claim 10 , wherein the loading of the vector register comprises loading a plurality of scalar values into the vector register in parallel.
13. The method according to claim 10, further comprising: performing a vector operation using the copied sub-vector values and the sub-vector values in the second vector register; as well as The result of the vector operation is stored in a third vector register.
14. The method of claim 13, further comprising copying a second sub-vector value from the vector register in parallel with copying the selected sub-vector value.
15. The method of claim 14, further comprising performing a second vector operation in parallel with performing the vector operation, the second vector operation using the copied second sub-vector value.
16. The method of claim 14, further comprising applying an offset to the position of the selected sub-vector value in the vector register to select the position of the second sub-vector value in the vector register.
17. The method of claim 16, wherein the positions of the selected sub-vector values correspond to loop parameters of a convolution filtering operation.
18. An apparatus comprising: means for storing data loaded in response to a dedicated load instruction; Devices for performing vector operations; and for copying selected sub-vector values from the device for storing data independently of any vector registers in the device for performing vector operations and inputting multiple copies of the selected sub-vector values to the device for performing vector operations.
19. The apparatus according to claim 18, further comprising: a second device for storing data, and The device for performing a vector operation performs the vector operation using the copied sub-vector value and the sub-vector value in the second device for storing data.
20. The apparatus of claim 18, wherein the means for copying is further configured to copy a second sub-vector value from the means for storing data in parallel with copying the selected sub-vector value.
21. A non-transitory computer-readable medium comprising instructions that, when executed by a processor, cause the processor to perform operations comprising: loading a vector register in response to a dedicated load instruction; as well as Independently of any vector register in the vector operation circuit, the selected sub-vector value is copied from the vector register and multiple copies of the selected sub-vector value are input to the vector operation circuit.
22. The non-transitory computer readable medium of claim 21, wherein the operations further comprise: performing a vector operation using the copied sub-vector value and using the sub-vector value in the second vector register; as well as The result of the vector operation is stored in a third vector register.
23. The non-transitory computer readable medium of claim 21, wherein the position of the selected sub-vector value in the vector register is indicated by a loop parameter of a convolution filtering operation.
