WO2009120981A2 - Vector instructions to enable efficient synchronization and parallel reduction operations - Google Patents

Vector instructions to enable efficient synchronization and parallel reduction operations Download PDF

Info

Publication number
WO2009120981A2
WO2009120981A2 PCT/US2009/038596 US2009038596W WO2009120981A2 WO 2009120981 A2 WO2009120981 A2 WO 2009120981A2 US 2009038596 W US2009038596 W US 2009038596W WO 2009120981 A2 WO2009120981 A2 WO 2009120981A2
Authority
WO
WIPO (PCT)
Prior art keywords
simd
mask
data elements
vector
instruction
Prior art date
Application number
PCT/US2009/038596
Other languages
French (fr)
Other versions
WO2009120981A3 (en
Inventor
Mikhail Smelyanskiy
Sanjeev Kumar
Daehyun Kim
Victor W. Lee
Anthony D. Nguyen
Yen-Kuang Chen
Christopher Hughes
Changkyu Kim
Jatin Chhugani
Original Assignee
Intel Corporation
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Intel Corporation filed Critical Intel Corporation
Priority to DE112009000741.4T priority Critical patent/DE112009000741B4/en
Priority to JP2010548946A priority patent/JP5455936B2/en
Priority to CN200980110598.7A priority patent/CN101978350B/en
Publication of WO2009120981A2 publication Critical patent/WO2009120981A2/en
Publication of WO2009120981A3 publication Critical patent/WO2009120981A3/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/30007Arrangements for executing specific machine instructions to perform operations on data operands
    • G06F9/30036Instructions to perform operations on packed data, e.g. vector, tile or matrix operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/30007Arrangements for executing specific machine instructions to perform operations on data operands
    • G06F9/3001Arithmetic instructions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/30007Arrangements for executing specific machine instructions to perform operations on data operands
    • G06F9/30018Bit or string instructions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/30007Arrangements for executing specific machine instructions to perform operations on data operands
    • G06F9/30021Compare instructions, e.g. Greater-Than, Equal-To, MINMAX
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/30007Arrangements for executing specific machine instructions to perform operations on data operands
    • G06F9/30032Movement instructions, e.g. MOVE, SHIFT, ROTATE, SHUFFLE
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/3004Arrangements for executing specific machine instructions to perform operations on memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/3004Arrangements for executing specific machine instructions to perform operations on memory
    • G06F9/30043LOAD or STORE instructions; Clear instruction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/30076Arrangements for executing specific machine instructions to perform miscellaneous control operations, e.g. NOP
    • G06F9/30087Synchronisation or serialisation instructions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline or look ahead
    • G06F9/3824Operand accessing
    • G06F9/3834Maintaining memory consistency
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline or look ahead
    • G06F9/3885Concurrent instruction execution, e.g. pipeline or look ahead using a plurality of independent parallel functional units
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/40Image enhancement or restoration using histogram techniques
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N1/00Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
    • H04N1/40Picture signal circuits
    • H04N1/407Control or modification of tonal gradation or of extreme levels, e.g. background level
    • H04N1/4072Control or modification of tonal gradation or of extreme levels, e.g. background level dependent on the contents of the original
    • H04N1/4074Control or modification of tonal gradation or of extreme levels, e.g. background level dependent on the contents of the original using histograms

Definitions

  • SIMD single-instruction multiple-data
  • Synchronization primitives and parallel reduction operations are often performed in multiprocessor systems. Synchronization primitives ensure a program executes in a correct order when multiple threads work cooperatively. These primitives are often implemented using an atomic read-modify-write operation. A reduction is a common operation found in many scientific applications. When multiple threads perform reductions in parallel, atomic read-modify-write sequences are typically used to ensure correctness in race conditions. Modern parallel architectures come equipped with SIMD units to improve the performance of many applications with data-level parallelism. To maintain SIMD efficiency, such architectures allow not only SIMD arithmetic operations but also SIMD memory reads and writes (through gather-scatter units). However, none of these architectures support SIMD atomic operations.
  • Scatter reductions are common operations in many applications. For example, a scatter-add operation can be used to enable multiple values of a first array to be reduced into (i.e., added to) selected elements of a second array according to a distribution of indices, which can often be random. Because of this, it is difficult to efficiently process multiple elements concurrently (i.e., in SIMD mode).
  • Histogram calculations are common operations in many image processing applications. For example, a histogram is used to track the distribution of color values of pixels in an image. However, updates to the histogram array may be random, depending on input data to an array. In particular, indices of neighboring elements may point to the same histogram bin. This condition makes it very difficult to process multiple data concurrently (i.e., in SIMD mode).
  • FIG. IA is a block diagram of a processor core in accordance with one embodiment of the present invention.
  • FIG. IB is an example representation of a gather/scatter unit in accordance with an embodiment of the present invention.
  • FIG. 2 is a flow diagram for performing atomic vector operations in accordance with one embodiment of the present invention.
  • FIG. 3 is a block diagram of a system in accordance with an embodiment of the present invention.
  • Embodiments may extend memory scatter-gather functionality to provide support for atomic vector operations.
  • SIMD instructions may be provided to enable atomic operations.
  • a so-called vector gather-linked instruction and a vector scatter-conditional instruction may be provided to efficiently support atomic operations to multiple non-contiguous memory locations in SIMD fashion.
  • vector and SIMD are used interchangeably to describe multiple data elements that are acted upon by a single instruction. In this way, these instructions may enable SIMD atomic operations to more efficiently implement synchronization primitives and parallel reduction operations.
  • other vector instructions may provide processor assistance for in-processor reduction operations and histogram calculations.
  • a gather-scatter unit can be configured to allow atomic SIMD memory operations. Efficiently utilizing SIMD in applications in which data structures have elements that are accessed indirectly (e.g., A[B[i]]) rather than contiguously often requires rearranging data, which can result in substantial overhead. To address this overhead, hardware support to enable loading and storing non-contiguous data elements in a SIMD fashion can be provided to perform gather/scatter operations. Namely, a gather operation reads (gathers) multiple data elements from indirectly addressed locations, based on addresses contained in the source SIMD register, and packs them into a single SIMD register.
  • a scatter operation unpacks the elements in a SIMD register and writes (scatters) them into a set of indirectly addressed locations.
  • a gather-linked instruction in accordance with one embodiment of the present invention contains reservations for the locations being gathered, and a scatter- conditional instruction in accordance with an embodiment of the present invention will only scatter values to elements whose corresponding reservations are still held. Since a scatter-conditional may only succeed for a subset of the elements (or for none at all), the instruction has an output mask which indicates success or failure, analogous to the output of a store-conditional. An output mask for the gather-linked instruction may allow more flexibility in hardware implementations.
  • Embodiments may extend scalar atomic memory operations, namely a pair of scalar instructions called load-linked (LL) and store- conditional (SC).
  • LL returns the value stored at a shared location and sets a reservation indicator associated with the location.
  • SC checks the reservation indicator. If it is valid, a new value is written to the location and the operation returns success, otherwise the value is not written and the operation returns a flag indicating failure.
  • LL and SC is in implementing higher level synchronization primitives, such as lock and unlock.
  • Locks are used to assure atomicity of accesses to shared data by multiple threads. However these instructions operate only on a single element at a time. Embodiments may be used to overcome this limitation of these instructions.
  • VLEN SIMD vector length
  • VLEN SIMD vector length
  • VLEN iterations of a loop to detect, acquire, update VLEN data elements and release the locks are executed, and various overheads are associated with such operations.
  • a reduction operation Another common operation in many applications is a reduction operation.
  • a reduction can be performed by multiple threads to improve performance.
  • atomic access to a shared data structure is used to ensure correctness, when multiple threads simultaneously update the same memory location.
  • a reduction operation may use scalar load-linked and store- conditional instructions to assure atomicity of simultaneous updates; however, such operations cannot be executed in SIMD fashion without an embodiment of the present invention.
  • Efficient SIMD-friendly implementation of synchronization primitives and parallel reduction can be realized in various embodiments, by providing SIMD support for LL and SC instructions. More specifically, to improve SIMD efficiency of synchronization primitives and parallel reductions, two instructions, a gather-linked (vgatherlink) instruction and a scatter-conditional (vscattercond) instruction, may provide for load- linked and store-conditional operations for SIMD architectures. In addition, a vector- gather instruction (vgather) and a vector-scatter (vscatter) instruction available on a SIMD architecture can be leveraged.
  • the vector-gather instruction may be as follows: vgather base, Addr, Dst which causes VLEN data elements to be gathered from VLEN (not necessarily contiguous, and possibly duplicated) memory locations, whose addresses are computed from base and Addr (base[Addr[O]], ..., base[Addr[VLEN-l]]), and stored contiguously into the destination, Dst. Note that Addr and Dst can be either in memory or a SIMD register.
  • the vector-scatter instruction may be as follows: vscatter base, Addr, Src
  • This instruction scatters VLEN contiguous data elements from a source, Src, into VLEN (not necessarily contiguous, but unique) memory locations whose addresses are stored in an address operand, Addr.
  • Addr and Src can either be either in memory or in a SIMD register.
  • vgatherlink a vector gather-linked instruction, vgatherlink
  • This instruction acts to gather and link multiple data elements, and also reserve the memory locations of the gathered data elements to be used by a later scatter-conditional instruction.
  • the instruction thus attempts to gather and link up to VLEN memory locations, memory [Addr [O]], memory [Addr [VLEN- 1]], into a destination, Dst, under mask. It may fail in gathering and linking some of the data elements. If so, it only gathers and links a subset of VLEN memory locations and sets the corresponding bits of the mask F to a valid state, e.g., a "1" state. The failed elements will have their corresponding mask F set to an invalid state, e.g., a "0" state.
  • vscattercond may be defined as follows:
  • This instruction acts to conditionally scatter multiple data elements to memory, and more specifically, only to the memory locations that are reserved by the vgatherlink instruction and whose reservations are still valid (i.e., no writes to the location have happened since the vgatherlink).
  • the instruction thus conditionally scatters up to VLEN data elements from a source, Src, into VLEN memory locations, memory[Addr[0]], ..., memory [Addr [VLEN- 1]], under mask, F.
  • the corresponding elements of the mask F are set to an invalid state, e.g., "0" state.
  • a subset of VLEN atomic operations e.g., acquiring a subset of FZHV locks
  • This mask can be used to safely execute in the SIMD region, because only the subset of SIMD elements under mask corresponding to the successful atomic operations will be enabled.
  • Table 1 shown is an example code segment using vgatherlink and vscattercond to acquire and release a subset of VLEN locks.
  • Vind SIMD_glb_index(i:i+FZ£N, F); // index computation using SIMD // iterate until all SIMD elements have been computed do ⁇
  • Fl F; // save mask // gather-linked up to VLEN values; set corresponding F element to 0 on failure vgatherlink Vl, lockloc, Vind, F;
  • the above code updates a subset of FZHV SIMD elements under mask in each iteration of the while loop, until all VLEN elements are updated.
  • the SIMD elements under mask are updated atomically. Note that it is possible that due to lock contention with other threads, no locks will be acquired in a given iteration of the while loop. This will result in the SIMD update region executing under mask where all elements are in 'invalid' state, acting as a no operation (NOP). Since only a subset of locks under mask are acquired, no sorting of locks is required. Lock sorting would typically be used in the corresponding serial implementation of the critical section to avoid deadlock. Lock sorting can be avoided in the serial implementation at the expense of more complicated and inefficient code. In the above code, a deadlock can be prevented by only acquiring non-contended locks and proceeding with the execution. An example implementation of this code is described below with regard to FIG. 2.
  • vgatherlink and vscattercond instructions are flexible and can enable different usage scenarios. For example, in the above code, we could instead first iterate to acquire the locks until all VLEN locks have been acquired, and then perform all VLEN updates simultaneously.
  • a vgatherlink instruction in accordance with an embodiment of the present invention is allowed to fail on a subset of addresses. Failure can happen for a number of reasons, for example: (1) other threads have the subset of addresses linked; (2) a conflict in the cache: if the only way to bring a new line is to evict another linked line (e.g., due to limited associativity); and (3) the line is at a remote location or in memory and will take a long latency to be fetched (e.g., a cache miss occurs).
  • a designer can choose to allow a vgatherlink instruction to fail. Allowing failure can potentially reduce the amount of contention while improving efficiency. Namely, waiting for a vgatherlink instruction to succeed for VLEN addresses may increase contention, while immediately issuing vscattercond instructions only to the subset of successfully linked addresses reduces the amount of contention.
  • vgatherlink and vscattercond have at least one other usage scenario: parallel reductions.
  • the SIMD update instruction does not entail accessing other objects in shared memory. Therefore, such objects do not need to have a lock obtained to guarantee atomicity for the update.
  • Vind SIMD_glb_index(i:i+FZ£N, F); do ⁇
  • the vgatherlink instruction gathers data elements from the global data structure (glb_data) to the vector register V. It also sets the bits of the mask register F to 0 corresponding to the failed gathered elements.
  • the SIMD update instruction updates the vector register V.
  • the vscattercond instruction scatters the vector register V to the global data structure, and also sets the bits of the mask register F to 0 corresponding to the failed scattered elements.
  • the mask register F contains a 1 for each element that was successfully updated in this iteration.
  • the vector instructions described herein can be implemented in many ways. Such instructions can leverage various SIMD hardware resources, including a reservation location for each element in the vgatherlink and vscattercond operations. In one embodiment, a granularity of one reservation location per 32-bit element may be used.
  • vgatherlink instruction gathers and vscattercond scatters in a single iteration can be a design parameter, as allowing larger number of elements to be gathered and scattered provides better performance, it requires more resources.
  • the vgatherlink and vscattercond instructions may have the external behavior shown in Appendix I and II, respectively.
  • Embodiments thus may provide efficient support for atomic operations in a SIMD architecture. In this way, the need to serialize atomic accesses to multiple memory locations can be avoided using the instructions described herein, to enable access to such multiple locations using an efficient loop construction, e.g., a do-while loop.
  • Embodiments of the instructions may be used in various applications.
  • the described instructions may be used to perform operations in varying applications such as physical simulation applications.
  • the described instructions can be used in connection with various applications, for example, image processing applications and applications utilizing sparse linear algebra primitives.
  • the scope of the present invention is not limited in this regard and the instructions described herein can be used in other applications.
  • processor core 10 may be a single core of a multicore processor including a plurality of cores configured similar to that of core 10.
  • core 10 may be of an architecture that supports SIMD operation.
  • various components of a pipeline/functional units 20 may be extended to provide for vector support, e.g., via extended registers and functional units such as ALUs and so forth.
  • pipeline/function units 20 may be coupled to a load/store unit (LSU) 30 and a gather/scatter unit (GSU) 40.
  • LSU 30 may handle execution of load and store instructions with a cache memory 50 which in one embodiment may be a level 1 (Ll) cache.
  • GSU 40 may handle execution of gather and scatter instructions, such as the vector gather-linked and vector scatter- conditional instructions described herein.
  • GSU 40 may include control logic 42, which may include various hardware, firmware, and software or combinations thereof to handle execution of various vector instructions, such as the instructions described herein.
  • control logic 42 may be in communication with a mask storage 44, which may include one or more storage locations to provide storage of mask information, e.g., in the form of a vector mask that can be used as input and/or output masks for the different instructions described herein.
  • control logic 42 may be in communication with a vector storage 46, which may be a vector register file or other temporary storage to provide storage of vector data elements that are used as operands for the various instructions described herein.
  • a shuffle logic 48 may be provided to enable shuffling of various data elements according to vector shuffle instructions such as described herein that may be implemented by control logic 42.
  • control logic 42 may in turn communicate with upstream portions of a core, e.g., the pipeline/functional units 20 of FIG. IA and a downstream portion of the core, e.g., cache memory 50. While shown with this particular implementation in the embodiment of FIG. IB, understand the scope of the present invention is not limited in this regard.
  • GSU 40 may handle a vector gather-linked operation the same as a gather operation, except that it generates and sends load-linked requests to memory 50. Similarly, GSU 40 may send store-conditional requests to the Ll cache instead of normal stores. In addition, GSU 40 assembles and stores the output mask for these operations based on success or failure of the individual requests.
  • a cache tag structure of cache memory 50 may include a so-called gather load control store (GLSC) entry per cache line.
  • a GLSC entry may contain two fields: a valid bit and a hardware thread identifier (ID) (to distinguish among the simultaneous multithreaded (SMT) threads on the same core).
  • GSU 40 For gather-linked operations, as GSU 40 sends load- linked requests to cache memory 50, some of the requests may fail, while other requests will succeed. For each request that succeeds, the cache updates the corresponding GLSC entry (e.g., the valid bit is set and requester's thread ID is filled), GSU 40 sets the corresponding bit in the output mask, and GSU 40 places the data in the destination register. For scatter-conditional operations, GSU 40 sends a set of store-conditional requests to the cache memory 50. An individual store-conditional request succeeds if the corresponding GLSC entry valid bit is set and the GLSC entry thread ID matches the requester's thread ID.
  • FIG. 2 shown is a flow diagram for performing atomic vector operations in accordance with one embodiment of the present invention.
  • method 100 may use vector gather-linked instructions and vector scatter- conditional instructions to enable atomic updates to vector data elements. Note that while shown with this particular implementation in the embodiment of FIG. 2, the scope of the present invention is not limited in this regard. As shown in FIG.
  • method 100 may begin at block 110, where a vector mask may be set to a valid state and vector index information may be obtained. Such operations may be performed to thus set an input mask to a valid state and to compute index indices for (i.e., obtain addresses) for SIMD data elements.
  • This loop may begin by performing a vector gather-linked instruction to obtain vector lock information. Specifically, this gather-linked may thus be used to obtain up to VLEN lock values. If unsuccessful for a given data element, as determined at diamond 125, indicating that a lock for a given data element is not available, control passes to block 130, where a corresponding vector mask indicator for the unavailable lock may be set to an invalid state. If instead given lock is available, a vector scatter-conditional instruction may be executed to attempt to lock such available data elements (block 140).
  • an output mask associated with the vector scatter-conditional instruction may remain set, while for any such locks that were not able to be obtained, the mask may be instead set to an invalid state.
  • Control then passes to block 150, where a SIMD update may be performed on a subset of the data elements. More specifically, for any data elements for which the lock was obtained at block 140, the SIMD update may be performed.
  • Control then passes to block 160, where a vector scatter instruction may be executed to unlock the updated data elements. Then it may be determined at diamond 170 whether additional vector data elements remain to be updated. If so, control passes back to block 120. Otherwise, method 100 may conclude. While shown with this particular implementation in the embodiment of FIG. 2, the scope of the present invention is not limited in this regard.
  • Embodiments may further be used to enable scatter reductions in SIMD mode.
  • Embodiments conceptually divide a scatter reduction operation into three operations.
  • partition a first array into chunks of length equal to the SIMD width.
  • This array may be an array of integer or floating-point values of given lengths, e.g., a first array, a so- called C array having values of length N.
  • a further array referred to as a so-called B array, may be an integer index array of length N whose elements are in the range [1...M] and defines the mapping of each element of the C array onto another array, A, of length M. Note that the distribution of indices (i.e., the contents of array B) is often random.
  • multiple entries of the B array may have the same value, that can cause multiple values of the C array to be reduced into the same element of the A array.
  • Embodiments may provide yet another vector instruction to assist in performing SIMD reductions in registers. More specifically, the instruction may be used to find the unique items in a first SIMD register, and generate a shuffle control for the duplicated items. After such operations, the shuffle control can be used to produce a second SIMD register from the first SIMD register, such that pairs of duplicate elements are in corresponding locations in their respective SIMD register. Further, an accumulation of these two vector registers is performed to "reduce" corresponding duplicate elements from each pair into a destination vector register. The entire sequence is repeated until the elements remaining all map to distinct elements of A. This sequence accumulates as many pairs of duplicate elements as possible in each iteration to minimize the number of iterations. Alternative embodiments may only accumulate a subset of the pairs of duplicates in order to reduce the implementation cost.
  • arrays B and C can be split into various chunks (as in the first operation).
  • the chunks are loaded into two SIMD registers (for convenience, we will call these registers Vb and Vc).
  • the second operation combines elements of Vc that have the same value in the corresponding elements of Vb.
  • a sequence of instructions can be used to serially check each element of Vb against other elements in Vb to determine if there is any match. If matches are found, the corresponding elements in Vc are reduced.
  • Table 3 is the pseudo code of this second operation:
  • embodiments of the present invention may provide a vector instruction, referred to herein as a vector shuffle-to-reduce instruction, vshuf2reduce, to reduce the complexity of this operation to O(logN).
  • This Vshuf2reduce instruction takes one source Vb and an input mask (indicating which elements are valid), and produces a shuffle control (in a scalar register) and updates the mask register.
  • the instruction has the following format:
  • this vshuf2reduce instruction performs all-to-all comparisons of elements in Vb against other elements in Vb to create a shuffle control for Vc.
  • the shuffle control is used as an input to a shuffle instruction to line up in pairwise fashion elements in Vc with other elements in Vc that have the same index value in Vb.
  • the mask F is returned, in which an elements corresponding to one of the two items from each pair is set to invalid.
  • the third operation above is to combine the output of the second operation,
  • Voutput with the current contents of C. This involves reading the elements of C that correspond to Voutput, accumulating those values with Voutput, and then storing the newly accumulated values back to their corresponding locations in C.
  • Table 4 is pseudo code of performing a scatter reduction using this instruction.
  • L4 Vshuffle of Vc to Vtmp with control in SC
  • L5 Vadd Vtmp to Vc with mask F
  • the vshuf2reduce instruction generates shuffle controls for a tree reduction. That is, the while loop is expected to complete within O(log(VLEN))) steps in the worst case (when all elements are the same and hence reduce into a single element), significantly improving the performance of the second operation of the scatter reduction operation described above. If all elements of Vc have unique values of Vb, the loop may complete in a single iteration.
  • the vshuf2reduce instruction can be implemented based on the following pseudo code of Table 5 :
  • the all-to-all element-wise compare can be implemented in stages, and the shuffle- control can be generated by using a pre-programmed lookup table, in one embodiment.
  • Appendix III shows use of this instruction for the second operation of a scalar reduction.
  • Embodiments may provide a further instruction to enable efficient SIMD execution of histogram calculations through efficient handling of the case where multiple indices in a SIMD register are the same.
  • Such instruction may compute the population count of unique integer values in a source SIMD register.
  • the outputs are a SIMD register holding the population count of unique elements and a mask register indicating which elements are unique.
  • this instruction referred to as vitemcount, may have the following format:
  • Vs[i] of Vs The population count of each element Vs[i] of Vs is stored in Vd[i].
  • the unique indices in Vs have their corresponding writemask set in Fmask.
  • Vhist Vhist + Vcount; // accumulate histogram values vscatter(Vind, Vhist, histogram, F); // scatter updated unique histogram // values under mask
  • this computation executes in four stages.
  • the source register Vs and the mask F are read from a vector register file (VRF) and a mask register file (RF), respectively.
  • VRF vector register file
  • RF mask register file
  • an all-to-all comparison is performed to identify unique elements in Vs.
  • the result of the second stage is a 4-bit tag associated with each element Vs[i] of Vs, such that a group of two or more identical elements have the same tag.
  • the third pipeline stage uses the 4-bit tags to count the number of elements in each group of identical elements.
  • the count vector and mask are written into Vd and F, respectively.
  • this instruction will enable histogram computation in parallel, and can provide a speedup over a serial implementation.
  • multiprocessor system 500 is a point-to-point interconnect system, and includes a first processor 570 and a second processor 580 coupled via a point-to-point interconnect 550.
  • processors 570 and 580 may be multicore processors, including first and second processor cores (i.e., processor cores 574a and 574b and processor cores 584a and 584b).
  • Each processor core may include logic such as shown in FIGS. IA and IB to enable execution of single instruction vector operations in accordance with an embodiment of the present invention. In this way atomic vector operations may be performed, and various code may be executed to leverage the vector instructions described herein.
  • first processor 570 further includes a memory controller hub (MCH) 572 and point-to-point (P-P) interfaces 576 and 578.
  • second processor 580 includes a MCH 582 and P-P interfaces 586 and 588.
  • MCH's 572 and 582 couple the processors to respective memories, namely a memory 532 and a memory 534, which may be portions of main memory (e.g., a dynamic random access memory (DRAM)) locally attached to the respective processors.
  • First processor 570 and second processor 580 may be coupled to a chipset 590 via P-P interconnects 552 and 554, respectively.
  • chipset 590 includes P-P interfaces 594 and 598.
  • chipset 590 includes an interface 592 to couple chipset 590 with a high performance graphics engine 538.
  • chipset 590 may be coupled to a first bus 516 via an interface 596.
  • various I/O devices 514 may be coupled to first bus 516, along with a bus bridge 518 which couples first bus 516 to a second bus 520.
  • Various devices may be coupled to second bus 520 including, for example, a keyboard/mouse 522, communication devices 526 and a data storage unit 528 such as a disk drive or other mass storage device which may include code 530, in one embodiment.
  • an audio I/O 524 may be coupled to second bus 520.
  • Embodiments may be implemented in code and may be stored on a storage medium having stored thereon instructions which can be used to program a system to perform the instructions.
  • the storage medium may include, but is not limited to, any type of disk including floppy disks, optical disks, compact disk read-only memories (CD- ROMs), compact disk rewritables (CD-RWs), and magneto-optical disks, semiconductor devices such as read-only memories (ROMs), random access memories (RAMs) such as dynamic random access memories (DRAMs), static random access memories (SRAMs), erasable programmable read-only memories (EPROMs), flash memories, electrically erasable programmable read-only memories (EEPROMs), magnetic or optical cards, or any other type of media suitable for storing electronic instructions.
  • ROMs read-only memories
  • RAMs random access memories
  • DRAMs dynamic random access memories
  • SRAMs static random access memories
  • EPROMs erasable programmable read-only memories
  • EEPROMs
  • SIMD_WIDTH is the number of elements in a SIMD register // kl is the input mask // mvt is a vector memory operand
  • SIMD_WIDTH is the number of elements in a SIMD register // kl is the input mask // mvt is a vector memory operand

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Advance Control (AREA)
  • Complex Calculations (AREA)
  • Executing Machine-Instructions (AREA)

Abstract

In one embodiment, a processor may include a vector unit to perform operations on multiple data elements responsive to a single instruction, and a control unit coupled to the vector unit to provide the data elements to the vector unit, where the control unit is to enable an atomic vector operation to be performed on at least some of the data elements responsive to a first vector instruction to be executed under a first mask and a second vector instruction to be executed under a second mask. Other embodiments are described and claimed.

Description

VECTOR INSTRUCTIONS TO ENABLE EFFICIENT SYNCHRONIZATION AND PARALLEL REDUCTION OPERATIONS
Background Many applications have large amounts of data-level parallelism and should be able to benefit from single-instruction multiple-data (SIMD) support. In SIMD execution, a single instruction operates on multiple data elements simultaneously. This is typically implemented by extending the width of various resources such as registers and arithmetic logic units (ALUs), allowing them to hold or operate on multiple data elements, respectively. However, many such applications spend a significant amount of time in atomic operations on a set of sparse locations and thus see limited benefit from SIMD, as current architectures do not support atomic vector operations.
In many applications, synchronization primitives and parallel reduction operations are often performed in multiprocessor systems. Synchronization primitives ensure a program executes in a correct order when multiple threads work cooperatively. These primitives are often implemented using an atomic read-modify-write operation. A reduction is a common operation found in many scientific applications. When multiple threads perform reductions in parallel, atomic read-modify-write sequences are typically used to ensure correctness in race conditions. Modern parallel architectures come equipped with SIMD units to improve the performance of many applications with data-level parallelism. To maintain SIMD efficiency, such architectures allow not only SIMD arithmetic operations but also SIMD memory reads and writes (through gather-scatter units). However, none of these architectures support SIMD atomic operations. The result is that these atomic operations cannot be vectorized and therefore must be implemented using scalar code. This can degrade the SIMD efficiency considerably, especially when the SIMD width, i.e., the number of simultaneously processed elements, is large (e.g., 16).
Scatter reductions are common operations in many applications. For example, a scatter-add operation can be used to enable multiple values of a first array to be reduced into (i.e., added to) selected elements of a second array according to a distribution of indices, which can often be random. Because of this, it is difficult to efficiently process multiple elements concurrently (i.e., in SIMD mode).
Histogram calculations are common operations in many image processing applications. For example, a histogram is used to track the distribution of color values of pixels in an image. However, updates to the histogram array may be random, depending on input data to an array. In particular, indices of neighboring elements may point to the same histogram bin. This condition makes it very difficult to process multiple data concurrently (i.e., in SIMD mode).
Brief Description of the Drawings
FIG. IA is a block diagram of a processor core in accordance with one embodiment of the present invention.
FIG. IB is an example representation of a gather/scatter unit in accordance with an embodiment of the present invention.
FIG. 2 is a flow diagram for performing atomic vector operations in accordance with one embodiment of the present invention.
FIG. 3 is a block diagram of a system in accordance with an embodiment of the present invention.
Detailed Description
Embodiments may extend memory scatter-gather functionality to provide support for atomic vector operations. In various embodiments, SIMD instructions may be provided to enable atomic operations. Specifically, a so-called vector gather-linked instruction and a vector scatter-conditional instruction may be provided to efficiently support atomic operations to multiple non-contiguous memory locations in SIMD fashion. Note as used herein, the terms "vector" and "SIMD" are used interchangeably to describe multiple data elements that are acted upon by a single instruction. In this way, these instructions may enable SIMD atomic operations to more efficiently implement synchronization primitives and parallel reduction operations. Still further, other vector instructions may provide processor assistance for in-processor reduction operations and histogram calculations.
In one embodiment, a gather-scatter unit can be configured to allow atomic SIMD memory operations. Efficiently utilizing SIMD in applications in which data structures have elements that are accessed indirectly (e.g., A[B[i]]) rather than contiguously often requires rearranging data, which can result in substantial overhead. To address this overhead, hardware support to enable loading and storing non-contiguous data elements in a SIMD fashion can be provided to perform gather/scatter operations. Namely, a gather operation reads (gathers) multiple data elements from indirectly addressed locations, based on addresses contained in the source SIMD register, and packs them into a single SIMD register. Conversely, a scatter operation unpacks the elements in a SIMD register and writes (scatters) them into a set of indirectly addressed locations. Specifically, a gather-linked instruction in accordance with one embodiment of the present invention contains reservations for the locations being gathered, and a scatter- conditional instruction in accordance with an embodiment of the present invention will only scatter values to elements whose corresponding reservations are still held. Since a scatter-conditional may only succeed for a subset of the elements (or for none at all), the instruction has an output mask which indicates success or failure, analogous to the output of a store-conditional. An output mask for the gather-linked instruction may allow more flexibility in hardware implementations. Embodiments may extend scalar atomic memory operations, namely a pair of scalar instructions called load-linked (LL) and store- conditional (SC). LL returns the value stored at a shared location and sets a reservation indicator associated with the location. SC checks the reservation indicator. If it is valid, a new value is written to the location and the operation returns success, otherwise the value is not written and the operation returns a flag indicating failure. Conceptually, for each shared memory location, for each hardware context, there is a reservation bit; the reservation bits associated with a shared memory location are cleared when that location is written by any hardware context. One use of LL and SC is in implementing higher level synchronization primitives, such as lock and unlock. Locks are used to assure atomicity of accesses to shared data by multiple threads. However these instructions operate only on a single element at a time. Embodiments may be used to overcome this limitation of these instructions. On a SIMD architecture, up to VLEN (SIMD vector length) updates to VLEN locations can be executed in parallel using SIMD if they are known to update distinct memory locations. However, guaranteeing the atomicity of VLEN simultaneous updates requires acquiring and releasing FZHV locks. If scalar instructions are used, VLEN iterations of a loop to detect, acquire, update VLEN data elements and release the locks are executed, and various overheads are associated with such operations.
Another common operation in many applications is a reduction operation. In multiprocessor systems, a reduction can be performed by multiple threads to improve performance. However, in a parallel implementation, atomic access to a shared data structure is used to ensure correctness, when multiple threads simultaneously update the same memory location. Thus, a reduction operation may use scalar load-linked and store- conditional instructions to assure atomicity of simultaneous updates; however, such operations cannot be executed in SIMD fashion without an embodiment of the present invention.
Efficient SIMD-friendly implementation of synchronization primitives and parallel reduction can be realized in various embodiments, by providing SIMD support for LL and SC instructions. More specifically, to improve SIMD efficiency of synchronization primitives and parallel reductions, two instructions, a gather-linked (vgatherlink) instruction and a scatter-conditional (vscattercond) instruction, may provide for load- linked and store-conditional operations for SIMD architectures. In addition, a vector- gather instruction (vgather) and a vector-scatter (vscatter) instruction available on a SIMD architecture can be leveraged. The vector-gather instruction may be as follows: vgather base, Addr, Dst which causes VLEN data elements to be gathered from VLEN (not necessarily contiguous, and possibly duplicated) memory locations, whose addresses are computed from base and Addr (base[Addr[O]], ..., base[Addr[VLEN-l]]), and stored contiguously into the destination, Dst. Note that Addr and Dst can be either in memory or a SIMD register. The vector-scatter instruction may be as follows: vscatter base, Addr, Src
This instruction scatters VLEN contiguous data elements from a source, Src, into VLEN (not necessarily contiguous, but unique) memory locations whose addresses are stored in an address operand, Addr. As in the case with the vgather instruction, Addr and Src can either be either in memory or in a SIMD register.
Thus, based on these two vector instructions and scalar LL and SC instructions, a vector gather-linked instruction, vgatherlink, may be defined as follows:
Figure imgf000005_0001
This instruction acts to gather and link multiple data elements, and also reserve the memory locations of the gathered data elements to be used by a later scatter-conditional instruction. The instruction thus attempts to gather and link up to VLEN memory locations, memory [Addr [O]], memory [Addr [VLEN- 1]], into a destination, Dst, under mask. It may fail in gathering and linking some of the data elements. If so, it only gathers and links a subset of VLEN memory locations and sets the corresponding bits of the mask F to a valid state, e.g., a "1" state. The failed elements will have their corresponding mask F set to an invalid state, e.g., a "0" state.
Similarly, vscattercond may be defined as follows:
Figure imgf000006_0001
This instruction acts to conditionally scatter multiple data elements to memory, and more specifically, only to the memory locations that are reserved by the vgatherlink instruction and whose reservations are still valid (i.e., no writes to the location have happened since the vgatherlink). The instruction thus conditionally scatters up to VLEN data elements from a source, Src, into VLEN memory locations, memory[Addr[0]], ..., memory [Addr [VLEN- 1]], under mask, F. For all elements under mask, for which the individual scatter conditional operation failed, the corresponding elements of the mask F are set to an invalid state, e.g., "0" state.
Using a combination of vgatherlink and vscattercond instructions, and mask manipulations (see below), a subset of VLEN atomic operations (e.g., acquiring a subset of FZHV locks) can be performed, and the corresponding mask elements be set to 1. This mask can be used to safely execute in the SIMD region, because only the subset of SIMD elements under mask corresponding to the successful atomic operations will be enabled. Referring now to Table 1, shown is an example code segment using vgatherlink and vscattercond to acquire and release a subset of VLEN locks.
Table 1
VO = O;
V2 = l; for(i=0; i < nupdates; i += VLEN) { F = Oxffff; // set all mask elements to 1
Vind = SIMD_glb_index(i:i+FZ£N, F); // index computation using SIMD // iterate until all SIMD elements have been computed do {
Fl = F; // save mask // gather-linked up to VLEN values; set corresponding F element to 0 on failure vgatherlink Vl, lockloc, Vind, F;
// set bit in F to O when corresponding lock (Vl) is not free (i.e., F &= !Vl) vcmppi F{F}, VO5 Vl, eq // attempt to obtain the free locks; set corresponding F element to 0 on failure vscattercond V2, lockloc, Vind, F; SIMD_update(&glb_data, Vind, F); // unlock FZHV locations V3=0; vscatter V3, lockloc, Vind, F;
// subset of SIMD work is done: set F to 1 for remaining elements F Λ= F1; } while (F != 0); }
The above code updates a subset of FZHV SIMD elements under mask in each iteration of the while loop, until all VLEN elements are updated. The SIMD elements under mask are updated atomically. Note that it is possible that due to lock contention with other threads, no locks will be acquired in a given iteration of the while loop. This will result in the SIMD update region executing under mask where all elements are in 'invalid' state, acting as a no operation (NOP). Since only a subset of locks under mask are acquired, no sorting of locks is required. Lock sorting would typically be used in the corresponding serial implementation of the critical section to avoid deadlock. Lock sorting can be avoided in the serial implementation at the expense of more complicated and inefficient code. In the above code, a deadlock can be prevented by only acquiring non-contended locks and proceeding with the execution. An example implementation of this code is described below with regard to FIG. 2.
Note that the definition of the vgatherlink and vscattercond instructions is flexible and can enable different usage scenarios. For example, in the above code, we could instead first iterate to acquire the locks until all VLEN locks have been acquired, and then perform all VLEN updates simultaneously.
Note that while a scalar load-linked instruction always succeeds, a vgatherlink instruction in accordance with an embodiment of the present invention is allowed to fail on a subset of addresses. Failure can happen for a number of reasons, for example: (1) other threads have the subset of addresses linked; (2) a conflict in the cache: if the only way to bring a new line is to evict another linked line (e.g., due to limited associativity); and (3) the line is at a remote location or in memory and will take a long latency to be fetched (e.g., a cache miss occurs). There are many other situations in which a designer can choose to allow a vgatherlink instruction to fail. Allowing failure can potentially reduce the amount of contention while improving efficiency. Namely, waiting for a vgatherlink instruction to succeed for VLEN addresses may increase contention, while immediately issuing vscattercond instructions only to the subset of successfully linked addresses reduces the amount of contention.
In the above discussion it is assumed that all lock locations are unique. This constraint forces a programmer to partition the locks into subsets of unique locks prior to entering the while loop, which is a potentially expensive computation. For example, when FZHV elements are simultaneously inserted into a tree, the programmer may have no way of knowing at compile time which elements are unique.
Partitioning locks into unique subsets in software is expensive. However, the semantics of vgatherlink and vscattercond instructions are such that partitioning is not required. These instructions differ from scatter-conditional and conventional scatter operations in their handling of element aliasing, where a single SIMD operation attempts to write multiple values to the same location. One and only one of the aliased element updates will succeed, indicated by the output mask. In various embodiments, since both gather-linked and scatter-conditional instructions have output masks, a hardware designer can choose to implement the alias detection and resolution as part of either instruction. Since vgatherlink or vscattercond instructions only process a subset of unique addresses in Addr, this guarantees that only unique locks will be acquired in a given iteration of the while loop, and the SIMD update instruction will only be performed on the unique elements within the group of VLEN elements.
While the above discussion has focused on lock acquires, vgatherlink and vscattercond have at least one other usage scenario: parallel reductions. In many applications, the SIMD update instruction does not entail accessing other objects in shared memory. Therefore, such objects do not need to have a lock obtained to guarantee atomicity for the update. Instead, the vgatherlink and vscattercond instructions can be used on the data being updated, as follows in Table 2: Table 2 for(i=0; i < nupdates; i += VLEN) { F = all valid;
Vind = SIMD_glb_index(i:i+FZ£N, F); do {
Fl = F; vgatherlink V, glb_data, Vind, F; SIMD_update(V, F); vscattercond V, glb_data, Vind, F; F A= F1;
} while (F != 0); }
In this code, the vgatherlink instruction gathers data elements from the global data structure (glb_data) to the vector register V. It also sets the bits of the mask register F to 0 corresponding to the failed gathered elements. The SIMD update instruction updates the vector register V. Then, the vscattercond instruction scatters the vector register V to the global data structure, and also sets the bits of the mask register F to 0 corresponding to the failed scattered elements. After the vscattercond instruction, the mask register F contains a 1 for each element that was successfully updated in this iteration. An exclusive-OR
(XOR) operation with Fl clears those mask bits and sets to 1 the bits in the mask corresponding to the elements that have not yet been updated.
Applying vgatherlink and vscattercond instructions directly to perform parallel reductions may provide several benefits. First, the code is more efficient because there is no need to grab and release locks (i.e., the code in Table 2 is much shorter than the code in
Table 1). Second, the memory behavior is better because there is no need to access memory for the lock variables.
The vector instructions described herein can be implemented in many ways. Such instructions can leverage various SIMD hardware resources, including a reservation location for each element in the vgatherlink and vscattercond operations. In one embodiment, a granularity of one reservation location per 32-bit element may be used.
However other embodiments may have a smaller or larger granularity. The number of elements that a vgatherlink instruction gathers and vscattercond scatters in a single iteration can be a design parameter, as allowing larger number of elements to be gathered and scattered provides better performance, it requires more resources.
In one embodiment, the vgatherlink and vscattercond instructions may have the external behavior shown in Appendix I and II, respectively. Embodiments thus may provide efficient support for atomic operations in a SIMD architecture. In this way, the need to serialize atomic accesses to multiple memory locations can be avoided using the instructions described herein, to enable access to such multiple locations using an efficient loop construction, e.g., a do-while loop.
Embodiments of the instructions may be used in various applications. For example, for the use of locks, the described instructions may be used to perform operations in varying applications such as physical simulation applications. Similarly, for reduction operations, the described instructions can be used in connection with various applications, for example, image processing applications and applications utilizing sparse linear algebra primitives. Of course, the scope of the present invention is not limited in this regard and the instructions described herein can be used in other applications.
Referring now to FIG. IA, shown is a block diagram of a processor core in accordance with one embodiment of the present invention. As shown in FIG. IA, processor core 10 may be a single core of a multicore processor including a plurality of cores configured similar to that of core 10. As shown in FIG. IA, core 10 may be of an architecture that supports SIMD operation. For example, various components of a pipeline/functional units 20 may be extended to provide for vector support, e.g., via extended registers and functional units such as ALUs and so forth.
Referring still to FIG. IA, pipeline/function units 20 may be coupled to a load/store unit (LSU) 30 and a gather/scatter unit (GSU) 40. LSU 30 may handle execution of load and store instructions with a cache memory 50 which in one embodiment may be a level 1 (Ll) cache. Similarly, GSU 40 may handle execution of gather and scatter instructions, such as the vector gather-linked and vector scatter- conditional instructions described herein.
While these units may be configured in many different manners, referring now to FIG. IB, shown is an example representation of a gather/scatter unit in accordance with an embodiment of the present invention. As shown in FIG. IB, GSU 40 may include control logic 42, which may include various hardware, firmware, and software or combinations thereof to handle execution of various vector instructions, such as the instructions described herein. To effect such operations, control logic 42 may be in communication with a mask storage 44, which may include one or more storage locations to provide storage of mask information, e.g., in the form of a vector mask that can be used as input and/or output masks for the different instructions described herein. Still further, control logic 42 may be in communication with a vector storage 46, which may be a vector register file or other temporary storage to provide storage of vector data elements that are used as operands for the various instructions described herein. Still further, a shuffle logic 48 may be provided to enable shuffling of various data elements according to vector shuffle instructions such as described herein that may be implemented by control logic 42. As still further shown in FIG. IB, control logic 42 may in turn communicate with upstream portions of a core, e.g., the pipeline/functional units 20 of FIG. IA and a downstream portion of the core, e.g., cache memory 50. While shown with this particular implementation in the embodiment of FIG. IB, understand the scope of the present invention is not limited in this regard. In one embodiment GSU 40 may handle a vector gather-linked operation the same as a gather operation, except that it generates and sends load-linked requests to memory 50. Similarly, GSU 40 may send store-conditional requests to the Ll cache instead of normal stores. In addition, GSU 40 assembles and stores the output mask for these operations based on success or failure of the individual requests. In one embodiment, to support gather-linked and scatter-conditional instructions, a cache tag structure of cache memory 50 may include a so-called gather load control store (GLSC) entry per cache line. A GLSC entry may contain two fields: a valid bit and a hardware thread identifier (ID) (to distinguish among the simultaneous multithreaded (SMT) threads on the same core). For gather-linked operations, as GSU 40 sends load- linked requests to cache memory 50, some of the requests may fail, while other requests will succeed. For each request that succeeds, the cache updates the corresponding GLSC entry (e.g., the valid bit is set and requester's thread ID is filled), GSU 40 sets the corresponding bit in the output mask, and GSU 40 places the data in the destination register. For scatter-conditional operations, GSU 40 sends a set of store-conditional requests to the cache memory 50. An individual store-conditional request succeeds if the corresponding GLSC entry valid bit is set and the GLSC entry thread ID matches the requester's thread ID. In one embodiment, this will be true if the corresponding cache line has not been modified by an intervening write or evicted since it has been successfully linked by a matching load-linked request from a gather-linked operation. When an individual store-conditional request succeeds, the cache clears the GLSC valid flag, modifies the data in the cache line, and GSU 40 sets the corresponding bit in the output mask. Referring now to FIG. 2, shown is a flow diagram for performing atomic vector operations in accordance with one embodiment of the present invention. As shown in FIG. 2, method 100 may use vector gather-linked instructions and vector scatter- conditional instructions to enable atomic updates to vector data elements. Note that while shown with this particular implementation in the embodiment of FIG. 2, the scope of the present invention is not limited in this regard. As shown in FIG. 2, method 100 may begin at block 110, where a vector mask may be set to a valid state and vector index information may be obtained. Such operations may be performed to thus set an input mask to a valid state and to compute index indices for (i.e., obtain addresses) for SIMD data elements.
Control then passes to block 120, where a loop may be initiated that is iterated until all SIMD elements have been updated. This loop may begin by performing a vector gather-linked instruction to obtain vector lock information. Specifically, this gather-linked may thus be used to obtain up to VLEN lock values. If unsuccessful for a given data element, as determined at diamond 125, indicating that a lock for a given data element is not available, control passes to block 130, where a corresponding vector mask indicator for the unavailable lock may be set to an invalid state. If instead given lock is available, a vector scatter-conditional instruction may be executed to attempt to lock such available data elements (block 140). For any successful operations that obtain a lock, an output mask associated with the vector scatter-conditional instruction may remain set, while for any such locks that were not able to be obtained, the mask may be instead set to an invalid state. Control then passes to block 150, where a SIMD update may be performed on a subset of the data elements. More specifically, for any data elements for which the lock was obtained at block 140, the SIMD update may be performed. Control then passes to block 160, where a vector scatter instruction may be executed to unlock the updated data elements. Then it may be determined at diamond 170 whether additional vector data elements remain to be updated. If so, control passes back to block 120. Otherwise, method 100 may conclude. While shown with this particular implementation in the embodiment of FIG. 2, the scope of the present invention is not limited in this regard.
Embodiments may further be used to enable scatter reductions in SIMD mode. Embodiments conceptually divide a scatter reduction operation into three operations. First, partition a first array into chunks of length equal to the SIMD width. This array may be an array of integer or floating-point values of given lengths, e.g., a first array, a so- called C array having values of length N. Note a further array, referred to as a so-called B array, may be an integer index array of length N whose elements are in the range [1...M] and defines the mapping of each element of the C array onto another array, A, of length M. Note that the distribution of indices (i.e., the contents of array B) is often random. Moreover, multiple entries of the B array may have the same value, that can cause multiple values of the C array to be reduced into the same element of the A array. Second, perform a local reduction within each chunk (assumed to be in SIMD registers); at the end of each of these operations, a SIMD register will hold values corresponding to unique elements of A within the chunk (i.e., no two values within the register need to be reduced to the same element of the array), and all the duplicate values have been reduced into this unique element. Third, perform a gather-update-scatter memory operation for each chunk to complete the reduction for the chunk.
Embodiments may provide yet another vector instruction to assist in performing SIMD reductions in registers. More specifically, the instruction may be used to find the unique items in a first SIMD register, and generate a shuffle control for the duplicated items. After such operations, the shuffle control can be used to produce a second SIMD register from the first SIMD register, such that pairs of duplicate elements are in corresponding locations in their respective SIMD register. Further, an accumulation of these two vector registers is performed to "reduce" corresponding duplicate elements from each pair into a destination vector register. The entire sequence is repeated until the elements remaining all map to distinct elements of A. This sequence accumulates as many pairs of duplicate elements as possible in each iteration to minimize the number of iterations. Alternative embodiments may only accumulate a subset of the pairs of duplicates in order to reduce the implementation cost.
Prior to the start of the second operation above, arrays B and C can be split into various chunks (as in the first operation). The chunks are loaded into two SIMD registers (for convenience, we will call these registers Vb and Vc). The second operation combines elements of Vc that have the same value in the corresponding elements of Vb. To perform this third operation, a sequence of instructions can be used to serially check each element of Vb against other elements in Vb to determine if there is any match. If matches are found, the corresponding elements in Vc are reduced. The following Table 3 is the pseudo code of this second operation:
Table 3
Load Vb; Load Vc;
F = all valid; // for valid elements in Vb and Vc For (i=0; i<SIMD_WIDTH; i++) { If (F[i] is valid) {
For (j=i+l ; j<SIMD_WIDTH; j++) {
If ((F[J] is valid) and (Vb[i] == Vb[J])) { Vc[i] += Vc[J]; F[j] = invalid; } } }
However, this serial implementation has a complexity of 0(N2). Accordingly, embodiments of the present invention may provide a vector instruction, referred to herein as a vector shuffle-to-reduce instruction, vshuf2reduce, to reduce the complexity of this operation to O(logN). This Vshuf2reduce instruction takes one source Vb and an input mask (indicating which elements are valid), and produces a shuffle control (in a scalar register) and updates the mask register. In one embodiment, the instruction has the following format:
Opcode Pest S ource Mask Description
Compares elements in Vb (all to all) and creates a shuffle control for combining vshuf2reduce Dst Vb elements that have the same value in Vb in tree fashion.
Thus, this vshuf2reduce instruction performs all-to-all comparisons of elements in Vb against other elements in Vb to create a shuffle control for Vc. The shuffle control is used as an input to a shuffle instruction to line up in pairwise fashion elements in Vc with other elements in Vc that have the same index value in Vb. In addition, the mask F is returned, in which an elements corresponding to one of the two items from each pair is set to invalid. The third operation above is to combine the output of the second operation,
Voutput, with the current contents of C. This involves reading the elements of C that correspond to Voutput, accumulating those values with Voutput, and then storing the newly accumulated values back to their corresponding locations in C. The following Table 4 is pseudo code of performing a scatter reduction using this instruction.
Table 4
Ll : F = F 1 = all valid; SC = identity
L2: VshuGreduce SC, Vb, F; // SC=shuffle_control
L3: WMIe (F != F1) {
L4: Vshuffle of Vc to Vtmp with control in SC; L5 : Vadd Vtmp to Vc with mask F; L6: Fl = F;
L7: VshuGreduce SC, Vb, F;
L8: }
The vshuf2reduce instruction generates shuffle controls for a tree reduction. That is, the while loop is expected to complete within O(log(VLEN))) steps in the worst case (when all elements are the same and hence reduce into a single element), significantly improving the performance of the second operation of the scatter reduction operation described above. If all elements of Vc have unique values of Vb, the loop may complete in a single iteration.
In one embodiment, the vshuf2reduce instruction can be implemented based on the following pseudo code of Table 5 :
Table 5
Inputs:
Shuffle control = identity; F = masks for valid elements in Vb
Operations:
For (i=0; i<SIMD_WIDTH; i++) {
If (F[i] is valid) { For (j=i+l ; j<SIMD_WIDTH; j++) {
If ((F[J] is valid) and (Vb[i] == Vb[J])) { Set shuffle control for j->i shuffle; F[j] = invalid; Break; }
} } }
The all-to-all element-wise compare can be implemented in stages, and the shuffle- control can be generated by using a pre-programmed lookup table, in one embodiment.
Appendix III shows use of this instruction for the second operation of a scalar reduction.
Embodiments may provide a further instruction to enable efficient SIMD execution of histogram calculations through efficient handling of the case where multiple indices in a SIMD register are the same. Such instruction may compute the population count of unique integer values in a source SIMD register. The outputs are a SIMD register holding the population count of unique elements and a mask register indicating which elements are unique. In one embodiment, this instruction, referred to as vitemcount, may have the following format:
Figure imgf000016_0001
As an example of operation, assume an initial state as follows (where '-' signifies don't care values):
Figure imgf000016_0002
After the vitemcount instructions, the state is as follows:
Figure imgf000016_0003
The population count of each element Vs[i] of Vs is stored in Vd[i]. The unique indices in Vs have their corresponding writemask set in Fmask.
With this vitemcount instruction, a SIMD histogram computation can be provided as follows in Table 6:
Table 6 for(i=0; i < N; i+=SIMD_WIDTH) // N - input size
Vind = compute_bin_index_SIMD(I,i); // computes vector of indices F = all valid; // initialize F to all 1 vitemcount Vcount, Vind, F; // perform vector population count
// and set mask F for unique elements Vhist = vgather(Vind, histogram, F); // gather unique histogram values
// under mask
Vhist= Vhist + Vcount; // accumulate histogram values vscatter(Vind, Vhist, histogram, F); // scatter updated unique histogram // values under mask
}
As shown in Table 6, this computation executes in four stages. In the first stage, the source register Vs and the mask F are read from a vector register file (VRF) and a mask register file (RF), respectively. In the second stage, an all-to-all comparison is performed to identify unique elements in Vs. The result of the second stage is a 4-bit tag associated with each element Vs[i] of Vs, such that a group of two or more identical elements have the same tag. The third pipeline stage uses the 4-bit tags to count the number of elements in each group of identical elements. In the fourth and final stage, the count vector and mask are written into Vd and F, respectively. In some implementations, this instruction will enable histogram computation in parallel, and can provide a speedup over a serial implementation.
Embodiments may be implemented in many different system types. Referring now to FIG. 3, shown is a block diagram of a system in accordance with an embodiment of the present invention. As shown in FIG. 3, multiprocessor system 500 is a point-to-point interconnect system, and includes a first processor 570 and a second processor 580 coupled via a point-to-point interconnect 550. As shown in FIG. 3, each of processors 570 and 580 may be multicore processors, including first and second processor cores (i.e., processor cores 574a and 574b and processor cores 584a and 584b). Each processor core may include logic such as shown in FIGS. IA and IB to enable execution of single instruction vector operations in accordance with an embodiment of the present invention. In this way atomic vector operations may be performed, and various code may be executed to leverage the vector instructions described herein.
Still referring to FIG. 3, first processor 570 further includes a memory controller hub (MCH) 572 and point-to-point (P-P) interfaces 576 and 578. Similarly, second processor 580 includes a MCH 582 and P-P interfaces 586 and 588. As shown in FIG. 4, MCH's 572 and 582 couple the processors to respective memories, namely a memory 532 and a memory 534, which may be portions of main memory (e.g., a dynamic random access memory (DRAM)) locally attached to the respective processors. First processor 570 and second processor 580 may be coupled to a chipset 590 via P-P interconnects 552 and 554, respectively. As shown in FIG. 3, chipset 590 includes P-P interfaces 594 and 598.
Furthermore, chipset 590 includes an interface 592 to couple chipset 590 with a high performance graphics engine 538. In turn, chipset 590 may be coupled to a first bus 516 via an interface 596. As shown in FIG. 3, various I/O devices 514 may be coupled to first bus 516, along with a bus bridge 518 which couples first bus 516 to a second bus 520. Various devices may be coupled to second bus 520 including, for example, a keyboard/mouse 522, communication devices 526 and a data storage unit 528 such as a disk drive or other mass storage device which may include code 530, in one embodiment. Further, an audio I/O 524 may be coupled to second bus 520.
Embodiments may be implemented in code and may be stored on a storage medium having stored thereon instructions which can be used to program a system to perform the instructions. The storage medium may include, but is not limited to, any type of disk including floppy disks, optical disks, compact disk read-only memories (CD- ROMs), compact disk rewritables (CD-RWs), and magneto-optical disks, semiconductor devices such as read-only memories (ROMs), random access memories (RAMs) such as dynamic random access memories (DRAMs), static random access memories (SRAMs), erasable programmable read-only memories (EPROMs), flash memories, electrically erasable programmable read-only memories (EEPROMs), magnetic or optical cards, or any other type of media suitable for storing electronic instructions.
While the present invention has been described with respect to a limited number of embodiments, those skilled in the art will appreciate numerous modifications and variations therefrom. It is intended that the appended claims cover all such modifications and variations as fall within the true spirit and scope of this present invention.
Appendix 1
// SIMD_WIDTH is the number of elements in a SIMD register // kl is the input mask // mvt is a vector memory operand
// instruction works over a subset of the write mask klemp - SELECT_SUBSET(kl ) kl - SET TO ALL OfKl)
// Use nrvt as vector memory operand (VSlBj for (ii - 0; n < STMD_WTDTH; n++) { if (ktcmp[nj != 0) { i - 32*n // mvt[nj = BASE ADDR + SignExtcnd(VINDEX[i+31 :ij * SCALE) ρointer[63:0] = mvt[n]
/7 Set Reservation Location push pointer into a content addressable memory (CAM) structure used latter for look up
Set Reservation Location(pointer) :i] = FulJUpConvLoad32(pointerj
Figure imgf000019_0001
}
Appendix II the vscattercond should have the following external behavior.
// SIMD_WIDTH is the number of elements in a SIMD register // kl is the input mask // mvt is a vector memory operand
// instruction works over a subset of the write mask klemp - SELECT_SUBSET(kl ) kl - SET TO ALL OfKl)
// Use nrvt as vector memory operand (VSlBj for (ii - 0; n < SIMD WIDTH; n+-+) { if (ktcmp[nj != 0) { i = 32*n // mvt[n] = BASE ADDR + SignExtend(VJjNDEX[i+3 Li] * SCALE) pointer[63:0] = mvt[n]
//' Check_Reservation compare the pointer to CAM structure to sec if the reservation // is still good. If so, it returns true. Otherwise, it returns fails. if (Check Reservatiυn(pointer)) { tmp = DuwnConv32(y2[i+3 \ :i], downconv) if(DυwnCυnvSize32(downconv) ===== 4) <
MernStorefpointcr) = tmp[31 :0] } else if(DownConvSize32(downcunv) ===== 2) {
McmStorc(pointer) = tmp[15:0] } else ifTDuwnCυnvSize32(downconv) ====== 1) {
MernStorefpointcr) = tmp[7:0]
} kl [nj = l
}
// If Check _Reservation fails, it means some other threads have touched this location
// while it i^ under reservation in this thread else { kl [n] - 0;
} >
} Appendix HI
Initial state ('-' signifies don't care values), SC = Shuffle_Control is a scalar operand, but represented here as a vector for ease of understanding.
Figure imgf000021_0001
At this point, if the initial values of Vb are all unique, the F masks will still be all Is. It effectively will be the same as Fl mask and the while loop (L4 to L9) would have not be executed and Operation 2 would complete. In this example, the F mask is not the same as the Fl mask because some elements of Vb are identical. Thus, we will execute the loop (L4 to L9)
L4: V shuffle, updates Vtmp.
Figure imgf000021_0002
In the loop between L4 and L9, the vshuβreduce, vshuffle and vadd are repeatedly called until the mask no longer changes. That signifies the end of the reduction operation. L6: Fl = F updates Fl
Figure imgf000022_0001
L9 loops back to L4. Since F and Fl are still different, we would need to execute the loop for one more iteration.
L4: Vshuffle, updates Vtmp.
Figure imgf000022_0002
L7: vshuf2reduce SC, , Vb, F does not find any more elements of Vb vector that are the same. Thus, it does not update F nor SC.
Figure imgf000023_0001
Figure imgf000023_0002

Claims

What is claimed is:
1. A processor comprising: logic to receive a first vector instruction, a plurality of addresses each to a storage location having a corresponding data element of a vector having a plurality of data elements, and mask information associated with the vector, and to load a data element obtained from the storage location corresponding to each of the plurality of addresses, as indicated by the mask information, and to reserve the storage locations for a subsequent operation.
2. The processor of claim 1, wherein the logic is to update the mask information with an invalid indicator corresponding to each of the data elements that was not successfully obtained.
3. The processor of claim 2, wherein the logic is to load and reserve a subset of the plurality of data elements corresponding to the data elements that were successfully obtained.
4. The processor of claim 1, wherein the logic is to receive a second vector instruction, a second plurality of addresses each to a storage location having a corresponding data element of the vector, and second mask information, and to conditionally write a data element from a source storage to the storage location corresponding to each of the second plurality of addresses, as indicated by the second mask information, if the corresponding storage location is still reserved.
5. The processor of claim 4, wherein the logic is to generate an output mask from the second mask information with an invalid indicator corresponding to each of the storage locations that were no longer reserved.
6. An apparatus comprising: a single instruction multiple data (SIMD) unit to perform operations on a plurality of data elements responsive to a single instruction; and a control unit coupled to the SIMD unit to provide the plurality of data elements to the SIMD unit, wherein the control unit is to enable an atomic SIMD operation to be performed on at least some of the plurality of data elements responsive to a first SIMD instruction to be executed under a first mask and a second SIMD instruction to be executed under a second mask.
7. The apparatus of claim 6, wherein the first SIMD instruction is to obtain the plurality of data elements from first memory locations and reserve the first memory locations, pursuant to an input mask corresponding to the first mask.
8. The apparatus of claim 7, wherein the second SIMD instruction is to store a second plurality of data elements from a source location to the first memory locations that are reserved, pursuant to an input mask corresponding to the second mask, and wherein the first SIMD instruction is to cause generation of the second mask.
9. The apparatus of claim 6, wherein the control unit is to enable the SIMD unit to perform a third SIMD instruction to compare a second vector having a second plurality of data elements and to output a shuffle control to indicate groups of the data elements having the same value, and to set indicators of a third mask to indicate the non- unique data elements.
10. The apparatus of claim 6, wherein the control unit is to enable the SIMD unit to perform a fourth SIMD instruction to generate a count of identical elements of a third vector having a third plurality of data elements and to store the count for each unique element in a destination storage, and to further write an indicator of a fourth mask to indicate each unique element.
11. A system comprising: a processor including logic to execute a first single instruction multiple data (SIMD) instruction pursuant to a first mask to obtain at least a subset of data elements of a vector from a corresponding plurality of possibly non-contiguous source locations and to reserve the possibly non-contiguous source locations of the subset for a subsequent operation, perform an atomic SIMD operation using the subset of data elements, and execute a second SIMD instruction pursuant to a second mask to write at least a second subset of data elements to the corresponding plurality of possibly non-contiguous source locations; and a dynamic random access memory (DRAM) coupled to the processor.
12. The system of claim 11, wherein the processor is to execute the second SIMD instruction to write the second subset of data elements to the corresponding possibly non-contiguous source locations that are still reserved.
13. The system of claim 11 , wherein the processor is to update the first mask with an invalid indicator corresponding to each of the data elements that was not successfully obtained.
14. The system of claim 11, wherein the processor is to execute a third SIMD instruction to analyze a second vector having a second plurality of data elements and to output a shuffle control to indicate groups of the second plurality of data elements having the same value, and to set indicators of a third mask to indicate the non-unique data elements.
15. The system of claim 11, wherein the processor is to execute a fourth SIMD instruction to generate a count of identical elements of a third vector having a third plurality of data elements and to store the count for each unique element in a destination storage.
PCT/US2009/038596 2008-03-28 2009-03-27 Vector instructions to enable efficient synchronization and parallel reduction operations WO2009120981A2 (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
DE112009000741.4T DE112009000741B4 (en) 2008-03-28 2009-03-27 Vector instructions for enabling efficient synchronization and parallel reduction operations
JP2010548946A JP5455936B2 (en) 2008-03-28 2009-03-27 Vector instructions that enable efficient synchronous and parallel reduction operations
CN200980110598.7A CN101978350B (en) 2008-03-28 2009-03-27 Vector instructions to enable efficient synchronization and parallel reduction operations

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US12/079,774 US9513905B2 (en) 2008-03-28 2008-03-28 Vector instructions to enable efficient synchronization and parallel reduction operations
US12/079,774 2008-03-28

Publications (2)

Publication Number Publication Date
WO2009120981A2 true WO2009120981A2 (en) 2009-10-01
WO2009120981A3 WO2009120981A3 (en) 2009-12-17

Family

ID=41114780

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/US2009/038596 WO2009120981A2 (en) 2008-03-28 2009-03-27 Vector instructions to enable efficient synchronization and parallel reduction operations

Country Status (5)

Country Link
US (2) US9513905B2 (en)
JP (2) JP5455936B2 (en)
CN (2) CN101978350B (en)
DE (1) DE112009000741B4 (en)
WO (1) WO2009120981A2 (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015021151A1 (en) 2013-08-06 2015-02-12 Intel Corporation Methods, apparatus, instructions and logic to provide vector population count functionality
WO2016014213A1 (en) * 2014-07-25 2016-01-28 Qualcomm Incorporated Parallelization of scalar operations by vector processors using data-indexed accumulators in vector register files, and related circuits, methods, and computer-readable media
CN105359129A (en) * 2013-08-06 2016-02-24 英特尔公司 Methods, apparatus, instructions and logic to provide population count functionality for genome sequencing and alignment
EP2798465A4 (en) * 2011-12-30 2016-07-06 Intel Corp Unique packed data element identification processors, methods, systems, and instructions
EP2656229A4 (en) * 2010-12-21 2018-04-04 Intel Corporation Mechanism for conflict detection using simd
WO2019025754A1 (en) * 2017-08-01 2019-02-07 Arm Limited Counting elements in data items in a data processing apparatus
WO2019118271A1 (en) * 2017-12-12 2019-06-20 Google Llc Parallel multivalue reductions

Families Citing this family (87)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007143278A2 (en) 2006-04-12 2007-12-13 Soft Machines, Inc. Apparatus and method for processing an instruction matrix specifying parallel and dependent operations
CN101627365B (en) 2006-11-14 2017-03-29 索夫特机械公司 Multi-threaded architecture
US20090138680A1 (en) * 2007-11-28 2009-05-28 Johnson Timothy J Vector atomic memory operations
US9513905B2 (en) * 2008-03-28 2016-12-06 Intel Corporation Vector instructions to enable efficient synchronization and parallel reduction operations
US8904153B2 (en) 2010-09-07 2014-12-02 International Business Machines Corporation Vector loads with multiple vector elements from a same cache line in a scattered load operation
WO2012037491A2 (en) 2010-09-17 2012-03-22 Soft Machines, Inc. Single cycle multi-branch prediction including shadow cache for early far branch prediction
CN102004672B (en) * 2010-11-25 2012-12-05 中国人民解放军国防科学技术大学 Reduction device capable of configuring auto-increment interval of reduction target
US8972698B2 (en) 2010-12-22 2015-03-03 Intel Corporation Vector conflict instructions
KR101620676B1 (en) 2011-03-25 2016-05-23 소프트 머신즈, 인크. Register file segments for supporting code block execution by using virtual cores instantiated by partitionable engines
EP2689327B1 (en) 2011-03-25 2021-07-28 Intel Corporation Executing instruction sequence code blocks by using virtual cores instantiated by partitionable engines
CN103635875B (en) 2011-03-25 2018-02-16 英特尔公司 For by using by can subregion engine instance the memory segment that is performed come support code block of virtual core
EP2691849B1 (en) * 2011-03-30 2014-12-03 Intel Corporation Simd integer addition including mathematical operation on masks
US20120254591A1 (en) * 2011-04-01 2012-10-04 Hughes Christopher J Systems, apparatuses, and methods for stride pattern gathering of data elements and stride pattern scattering of data elements
CN102156637A (en) * 2011-05-04 2011-08-17 中国人民解放军国防科学技术大学 Vector crossing multithread processing method and vector crossing multithread microprocessor
WO2012162189A1 (en) 2011-05-20 2012-11-29 Soft Machines, Inc. An interconnect structure to support the execution of instruction sequences by a plurality of engines
TWI666551B (en) 2011-05-20 2019-07-21 美商英特爾股份有限公司 Decentralized allocation of resources and interconnect structures to support the execution of instruction sequences by a plurality of engines
US8521705B2 (en) * 2011-07-11 2013-08-27 Dell Products L.P. Accelerated deduplication
US20130080738A1 (en) * 2011-09-23 2013-03-28 Qualcomm Incorporated Processor configured to perform transactional memory operations
CN106293631B (en) * 2011-09-26 2020-04-10 英特尔公司 Instruction and logic to provide vector scatter-op and gather-op functionality
GB2508312B (en) * 2011-09-26 2020-04-22 Intel Corp Instruction and logic to provide vector load-op/store-op with stride functionality
CN103827813B (en) * 2011-09-26 2016-09-21 英特尔公司 For providing vector scatter operation and the instruction of aggregation operator function and logic
CN104040491B (en) 2011-11-22 2018-06-12 英特尔公司 The code optimizer that microprocessor accelerates
CN104040492B (en) * 2011-11-22 2017-02-15 索夫特机械公司 Microprocessor accelerated code optimizer and dependency reordering method
EP2783280B1 (en) 2011-11-22 2019-09-11 Intel Corporation An accelerated code optimizer for a multiengine microprocessor
US10318291B2 (en) 2011-11-30 2019-06-11 Intel Corporation Providing vector horizontal compare functionality within a vector register
CN103959237B (en) * 2011-11-30 2016-09-28 英特尔公司 For providing instruction and the logic of vector lateral comparison function
WO2013089749A1 (en) * 2011-12-15 2013-06-20 Intel Corporation Methods to optimize a program loop via vector instructions using a shuffle table and a mask store table
CN104011657B (en) * 2011-12-22 2016-10-12 英特尔公司 Calculate for vector and accumulative apparatus and method
WO2013095669A1 (en) * 2011-12-23 2013-06-27 Intel Corporation Multi-register scatter instruction
US9268626B2 (en) * 2011-12-23 2016-02-23 Intel Corporation Apparatus and method for vectorization with speculation support
US9766887B2 (en) * 2011-12-23 2017-09-19 Intel Corporation Multi-register gather instruction
WO2013095661A1 (en) * 2011-12-23 2013-06-27 Intel Corporation Systems, apparatuses, and methods for performing conversion of a list of index values into a mask value
CN104025067B (en) * 2011-12-29 2017-12-26 英特尔公司 With the processor for being instructed by vector conflict and being replaced the shared full connection interconnection of instruction
US9575753B2 (en) 2012-03-15 2017-02-21 International Business Machines Corporation SIMD compare instruction using permute logic for distributed register files
US9298456B2 (en) * 2012-08-21 2016-03-29 Apple Inc. Mechanism for performing speculative predicated instructions
US9400650B2 (en) * 2012-09-28 2016-07-26 Intel Corporation Read and write masks update instruction for vectorization of recursive computations over interdependent data
JP6020091B2 (en) 2012-11-27 2016-11-02 富士通株式会社 Arithmetic processing device control program, arithmetic processing device control method, and arithmetic processing device
US9804839B2 (en) * 2012-12-28 2017-10-31 Intel Corporation Instruction for determining histograms
US10545757B2 (en) * 2012-12-28 2020-01-28 Intel Corporation Instruction for determining equality of all packed data elements in a source operand
US9411584B2 (en) * 2012-12-29 2016-08-09 Intel Corporation Methods, apparatus, instructions, and logic to provide vector address conflict detection functionality
US9411592B2 (en) * 2012-12-29 2016-08-09 Intel Corporation Vector address conflict resolution with vector population count functionality
US9372692B2 (en) 2012-12-29 2016-06-21 Intel Corporation Methods, apparatus, instructions, and logic to provide permute controls with leading zero count functionality
US10140138B2 (en) 2013-03-15 2018-11-27 Intel Corporation Methods, systems and apparatus for supporting wide and efficient front-end operation with guest-architecture emulation
US9891924B2 (en) 2013-03-15 2018-02-13 Intel Corporation Method for implementing a reduced size register view data structure in a microprocessor
WO2014150991A1 (en) 2013-03-15 2014-09-25 Soft Machines, Inc. A method for implementing a reduced size register view data structure in a microprocessor
WO2014150806A1 (en) 2013-03-15 2014-09-25 Soft Machines, Inc. A method for populating register view data structure by using register template snapshots
US9639503B2 (en) * 2013-03-15 2017-05-02 Qualcomm Incorporated Vector indirect element vertical addressing mode with horizontal permute
KR101708591B1 (en) 2013-03-15 2017-02-20 소프트 머신즈, 인크. A method for executing multithreaded instructions grouped onto blocks
WO2014150971A1 (en) 2013-03-15 2014-09-25 Soft Machines, Inc. A method for dependency broadcasting through a block organized source view data structure
US9904625B2 (en) 2013-03-15 2018-02-27 Intel Corporation Methods, systems and apparatus for predicting the way of a set associative cache
US9886279B2 (en) 2013-03-15 2018-02-06 Intel Corporation Method for populating and instruction view data structure by using register template snapshots
US10275255B2 (en) 2013-03-15 2019-04-30 Intel Corporation Method for dependency broadcasting through a source organized source view data structure
US9569216B2 (en) 2013-03-15 2017-02-14 Soft Machines, Inc. Method for populating a source view data structure by using register template snapshots
KR102083390B1 (en) 2013-03-15 2020-03-02 인텔 코포레이션 A method for emulating a guest centralized flag architecture by using a native distributed flag architecture
US9811342B2 (en) 2013-03-15 2017-11-07 Intel Corporation Method for performing dual dispatch of blocks and half blocks
US9817663B2 (en) 2013-03-19 2017-11-14 Apple Inc. Enhanced Macroscalar predicate operations
US9348589B2 (en) 2013-03-19 2016-05-24 Apple Inc. Enhanced predicate registers having predicates corresponding to element widths
US9552205B2 (en) 2013-09-27 2017-01-24 Intel Corporation Vector indexed memory access plus arithmetic and/or logical operation processors, methods, systems, and instructions
JP6329412B2 (en) * 2014-03-26 2018-05-23 株式会社メガチップス SIMD processor
WO2016136197A1 (en) * 2015-02-25 2016-09-01 日本電気株式会社 Data processing device, data processing method, and recording medium
US20170046156A1 (en) * 2015-08-14 2017-02-16 Qualcomm Incorporated Table lookup using simd instructions
CN105159766B (en) * 2015-08-31 2018-05-25 安一恒通(北京)科技有限公司 Synchronous access method and synchronous access device for data
WO2017087001A1 (en) * 2015-11-20 2017-05-26 Hewlett Packard Enterprise Development Lp Distributed data shuffling
CN105487839A (en) * 2015-11-24 2016-04-13 无锡江南计算技术研究所 Continuous non-alignment vector data access oriented compiling optimization method
US10152321B2 (en) 2015-12-18 2018-12-11 Intel Corporation Instructions and logic for blend and permute operation sequences
GB2546510B (en) * 2016-01-20 2018-09-26 Advanced Risc Mach Ltd Vector atomic memory update instruction
US10248419B2 (en) * 2016-03-09 2019-04-02 International Business Machines Corporation In-memory/register vector radix sort
JP6231155B2 (en) * 2016-05-02 2017-11-15 インテル・コーポレーション Instructions and logic for providing vector scattering calculation function and vector collection calculation function
US20180005059A1 (en) 2016-07-01 2018-01-04 Google Inc. Statistics Operations On Two Dimensional Image Processor
US10564964B2 (en) 2016-08-23 2020-02-18 International Business Machines Corporation Vector cross-compare count and sequence instructions
WO2018049380A1 (en) 2016-09-12 2018-03-15 Oracle International Corporation Efficient evaluation of queries with multiple predicate expressions
GB2554096B (en) * 2016-09-20 2019-03-20 Advanced Risc Mach Ltd Handling of inter-element address hazards for vector instructions
CN107844359A (en) * 2016-09-20 2018-03-27 杭州华为数字技术有限公司 A kind of emulation mode and device
US10474461B2 (en) 2016-09-22 2019-11-12 Qualcomm Incorporated Instruction-based synchronization of operations including at least one SIMD scatter operation
US10268479B2 (en) * 2016-12-30 2019-04-23 Intel Corporation Systems, apparatuses, and methods for broadcast compare addition
CN108416730B (en) * 2017-02-09 2020-11-10 深圳市中兴微电子技术有限公司 Image processing method and device
US10360034B2 (en) 2017-04-18 2019-07-23 Samsung Electronics Co., Ltd. System and method for maintaining data in a low-power structure
US10437593B2 (en) * 2017-04-27 2019-10-08 Nvidia Corporation Techniques for comprehensively synchronizing execution threads
WO2019005165A1 (en) 2017-06-30 2019-01-03 Intel Corporation Method and apparatus for vectorizing indirect update loops
US11675761B2 (en) 2017-09-30 2023-06-13 Oracle International Corporation Performing in-memory columnar analytic queries on externally resident data
US10713046B2 (en) * 2017-12-20 2020-07-14 Exten Technologies, Inc. System memory controller with atomic operations
US10831500B2 (en) 2018-06-10 2020-11-10 International Business Machines Corporation Adaptive locking in elastic threading systems
JP7124608B2 (en) * 2018-09-28 2022-08-24 日本電気株式会社 Calculator and calculation method
US10929145B2 (en) * 2018-12-28 2021-02-23 Intel Corporation Mask generation using reduction operators and scatter use thereof
CN112083954A (en) * 2019-06-13 2020-12-15 华夏芯(北京)通用处理器技术有限公司 Mask operation method of explicit independent mask register in GPU
US20220283947A1 (en) 2020-03-18 2022-09-08 Nec Corporation Information processing device and information processing method
CN112215986A (en) * 2020-09-09 2021-01-12 苏州工业园区凌志软件股份有限公司 Internet of things control system and method of intelligent lock

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040181652A1 (en) * 2002-08-27 2004-09-16 Ashraf Ahmed Apparatus and method for independently schedulable functional units with issue lock mechanism in a processor
JP2007334563A (en) * 2006-06-14 2007-12-27 Nec Corp Vector processing device with mask
EP1873627A1 (en) * 2006-06-28 2008-01-02 STMicroelectronics S.r.l. A clustered SIMD processor architecture

Family Cites Families (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5513353A (en) * 1987-09-30 1996-04-30 Kabushiki Kaisha Toshiba Cache control system which permanently inhibits local but not global parameter data writes to main memory
US4953101A (en) 1987-11-24 1990-08-28 Digital Equipment Corporation Software configurable memory architecture for data processing system having graphics capability
JPH05108699A (en) 1991-10-15 1993-04-30 Hitachi Ltd Vector processing method for shared data
WO1994003860A1 (en) * 1992-08-07 1994-02-17 Thinking Machines Corporation Massively parallel computer including auxiliary vector processor
EP0733233A4 (en) * 1993-12-12 1997-05-14 Asp Solutions Usa Inc Apparatus and method for signal processing
JPH07271764A (en) * 1994-03-24 1995-10-20 Internatl Business Mach Corp <Ibm> Computer processor and system
JP3179290B2 (en) * 1994-07-28 2001-06-25 シャープ株式会社 Digital image forming device
US5818443A (en) * 1996-05-06 1998-10-06 Cognex Corporation Single step coarse registration and inspection of circular objects
JP3869947B2 (en) 1998-08-04 2007-01-17 株式会社日立製作所 Parallel processing processor and parallel processing method
US6865295B2 (en) * 2001-05-11 2005-03-08 Koninklijke Philips Electronics N.V. Palette-based histogram matching with recursive histogram vector generation
US7032082B1 (en) 2001-08-31 2006-04-18 Juniper Networks, Inc. Centralized memory allocation with write pointer drift correction
US20040054877A1 (en) * 2001-10-29 2004-03-18 Macy William W. Method and apparatus for shuffling data
US20040236920A1 (en) 2003-05-20 2004-11-25 Sheaffer Gad S. Methods and apparatus for gathering and scattering data associated with a single-instruction-multiple-data (SIMD) operation
US7421565B1 (en) * 2003-08-18 2008-09-02 Cray Inc. Method and apparatus for indirectly addressed vector load-add -store across multi-processors
CN100502511C (en) 2004-09-14 2009-06-17 华为技术有限公司 Method for organizing interpolation image memory for fractional pixel precision predication
JP2008513903A (en) 2004-09-21 2008-05-01 コーニンクレッカ フィリップス エレクトロニクス エヌ ヴィ Microprocessor device and method for shuffle operations
US7433513B2 (en) * 2005-01-07 2008-10-07 Hewlett-Packard Development Company, L.P. Scaling an array of luminace values
US20080071851A1 (en) * 2006-09-20 2008-03-20 Ronen Zohar Instruction and logic for performing a dot-product operation
US7627723B1 (en) * 2006-09-21 2009-12-01 Nvidia Corporation Atomic memory operators in a parallel processor
US8081823B2 (en) * 2007-11-20 2011-12-20 Seiko Epson Corporation Segmenting a string using similarity values
US9529592B2 (en) * 2007-12-27 2016-12-27 Intel Corporation Vector mask memory access instructions to perform individual and sequential memory access operations if an exception occurs during a full width memory access operation
US9513905B2 (en) * 2008-03-28 2016-12-06 Intel Corporation Vector instructions to enable efficient synchronization and parallel reduction operations

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040181652A1 (en) * 2002-08-27 2004-09-16 Ashraf Ahmed Apparatus and method for independently schedulable functional units with issue lock mechanism in a processor
JP2007334563A (en) * 2006-06-14 2007-12-27 Nec Corp Vector processing device with mask
EP1873627A1 (en) * 2006-06-28 2008-01-02 STMicroelectronics S.r.l. A clustered SIMD processor architecture

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
'IEEE International Conference on ASAP', July 2007 article SHAHBAHRAMI, A. ET AL.: 'SIMD Vectorization of histogram functions.', pages 174 - 179 *
'IEEE International Conference on ISCA', June 2008 article KUMAR, S. ET AL.: 'Atomic Vector Operations on Chip Multiprocessors.', pages 441 - 452 *

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2656229A4 (en) * 2010-12-21 2018-04-04 Intel Corporation Mechanism for conflict detection using simd
EP2798465A4 (en) * 2011-12-30 2016-07-06 Intel Corp Unique packed data element identification processors, methods, systems, and instructions
CN105359129A (en) * 2013-08-06 2016-02-24 英特尔公司 Methods, apparatus, instructions and logic to provide population count functionality for genome sequencing and alignment
WO2015021151A1 (en) 2013-08-06 2015-02-12 Intel Corporation Methods, apparatus, instructions and logic to provide vector population count functionality
EP3030979A4 (en) * 2013-08-06 2017-03-22 Intel Corporation Methods, apparatus, instructions and logic to provide population count functionality for genome sequencing and alignment
EP3030980A4 (en) * 2013-08-06 2017-03-22 Intel Corporation Methods, apparatus, instructions and logic to provide vector population count functionality
US10223120B2 (en) 2013-08-06 2019-03-05 Intel Corporation Methods, apparatus, instructions and logic to provide population count functionality for genome sequencing and alignment
US10678546B2 (en) 2013-08-06 2020-06-09 Intel Corporation Methods, apparatus, instructions and logic to provide population count functionality for genome sequencing and alignment
WO2016014213A1 (en) * 2014-07-25 2016-01-28 Qualcomm Incorporated Parallelization of scalar operations by vector processors using data-indexed accumulators in vector register files, and related circuits, methods, and computer-readable media
WO2019025754A1 (en) * 2017-08-01 2019-02-07 Arm Limited Counting elements in data items in a data processing apparatus
WO2019118271A1 (en) * 2017-12-12 2019-06-20 Google Llc Parallel multivalue reductions
CN111448545A (en) * 2017-12-12 2020-07-24 谷歌有限责任公司 Parallel multi-valued reduction
CN111448545B (en) * 2017-12-12 2021-10-15 谷歌有限责任公司 Parallel processing apparatus and method for parallel multi-value reduction
US11163567B2 (en) 2017-12-12 2021-11-02 Google Llc Multivalue reductions using serial initial reductions in multiple register spaces and parallel subsequent reductions in a single register space

Also Published As

Publication number Publication date
JP2011514598A (en) 2011-05-06
US9678750B2 (en) 2017-06-13
JP2014099194A (en) 2014-05-29
CN103970506B (en) 2017-07-14
JP5902209B2 (en) 2016-04-13
JP5455936B2 (en) 2014-03-26
US20090249026A1 (en) 2009-10-01
CN101978350A (en) 2011-02-16
DE112009000741B4 (en) 2023-11-30
CN101978350B (en) 2014-06-11
US9513905B2 (en) 2016-12-06
DE112009000741T5 (en) 2012-01-26
WO2009120981A3 (en) 2009-12-17
CN103970506A (en) 2014-08-06
US20140068226A1 (en) 2014-03-06

Similar Documents

Publication Publication Date Title
US9678750B2 (en) Vector instructions to enable efficient synchronization and parallel reduction operations
US8375176B2 (en) Lock mechanism to enable atomic updates to shared memory
CN107003837B (en) Lightweight constrained transactional memory for speculative compiler optimization
CN108376097B (en) Register file segments for supporting code block execution by using virtual cores instantiated by partitionable engines
CN108108188B (en) Memory fragments for supporting code block execution by using virtual cores instantiated by partitionable engines
US9639365B2 (en) Indirect function call instructions in a synchronous parallel thread processor
US8583898B2 (en) System and method for managing processor-in-memory (PIM) operations
US7617384B1 (en) Structured programming control flow using a disable mask in a SIMD architecture
US8572359B2 (en) Runtime extraction of data parallelism
US9696995B2 (en) Parallel execution unit that extracts data parallelism at runtime
Xu et al. Lock-based synchronization for GPU architectures
US8572355B2 (en) Support for non-local returns in parallel thread SIMD engine
US8458685B2 (en) Vector atomic memory operation vector update system and method
US8826252B2 (en) Using vector atomic memory operation to handle data of different lengths
Zhang et al. GPU-TLS: An efficient runtime for speculative loop parallelization on gpus
Liu et al. Lightscan: Faster scan primitive on CUDA compatible manycore processors
US20230305844A1 (en) Implementing specialized instructions for accelerating dynamic programming algorithms
Cheramangalath et al. GPU Architecture and Programming Challenges
CN115905786A (en) Techniques for accelerating Smith-Wattman sequence alignment
Ballard et al. GPU Computing for Tensor Eigenvalues.

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 200980110598.7

Country of ref document: CN

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 09724023

Country of ref document: EP

Kind code of ref document: A2

WWE Wipo information: entry into national phase

Ref document number: 2010548946

Country of ref document: JP

122 Ep: pct application non-entry in european phase

Ref document number: 09724023

Country of ref document: EP

Kind code of ref document: A2