Testing bit values ​​in vector elements

The integration of bit testing procedures in data processing devices allows for efficient parallel testing of bit values within vector elements, improving program performance and flexibility in bit test execution.

JP7557000B2Active Publication Date: 2024-09-26ARM LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
JP2023040331
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2017-07-10
Filing Date
2023-03-15
Publication Date
2024-09-26
Estimated Expiration
2038-06-27

AI Technical Summary

Technical Problem

Existing data processing devices lack efficient methods for testing bit values within vector elements, which are crucial for controlling device operations and data processing behaviors.

Method used

The implementation of instruction decode circuitry and data processing circuitry that perform bit testing procedures on elements of a source vector register, generating result bits based on specified bit positions and values, allowing parallel execution of bit tests through bit test instructions like TSTZ and TSTNZ.

Benefits of technology

Enhances the performance of program code by enabling parallel execution of multiple bit tests, providing flexibility in selecting elements and result storage, and supporting various index and predicate bit configurations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007557000000003
    Figure 0007557000000003
  • Figure 0007557000000004
    Figure 0007557000000004
  • Figure 0007557000000007
    Figure 0007557000000007
Patent Text Reader

Abstract

To provide a device, a method and a program, which test a bit value in a vector element when a data processing device is executing data processing.SOLUTION: A method includes responding to a bit test instruction designating a source vector register and an index in order to execute a bit test procedure for a plurality of elements stored in the source vector register for generating a plurality of result bits. The bit test procedure includes for each processed element of the plurality of elements, setting each result bit of the plurality of result bits according to a value of a test bit at a bit position in the processed element of the source vector register indicated by the index.EFFECT: Accordingly, this bit test instruction allows appropriate formulation to a required and vectorized format for executing a plurality of bit tests to improve performance of a program code.SELECTED DRAWING: Figure 5
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present disclosure relates to data processing apparatus, and more particularly to testing bit values ​​within vector elements processed by a data processing apparatus. [Background technology]

[0002] When a data processing apparatus is performing a data processing operation, it may be useful for the data processing apparatus to test whether specified bits in an input value are set or not, so that those bits in the input value can be used by a programmer to control the operation of the data processing apparatus, for example to switch certain features on or off, to modify certain data processing behavior, to include or exclude certain specified input data for processing, etc. Summary of the Invention

[0003] In one exemplary embodiment, there is an apparatus comprising an instruction decode circuit for decoding an instruction and generating control signals in response to the instruction, and a data processing circuit for performing a data processing operation in response to the control signals generated by the instruction decode circuit, wherein the instruction decode circuit is responsive to a bit test instruction specifying a source vector register and an index to cause the data processing circuit to perform a bit test procedure on a plurality of elements stored in the source vector register to generate a plurality of result bits, the bit test procedure including, for each processed element of the plurality of elements, setting a respective result bit of the plurality of result bits in response to a value of a test bit in a bit position in the processed element of the source vector register indicated by the index.

[0004] In another exemplary embodiment, there is a method of operating a data processing apparatus comprising the steps of decoding an instruction and generating control signals responsive to the instruction; performing a data processing operation in response to the generated control signals; and in response to a bit test instruction specifying a source vector register and an index, causing execution of a bit test procedure on a plurality of elements stored in the source vector register to generate a plurality of result bits, the bit test procedure comprising, for each processed element of the plurality of elements, setting a respective result bit of the plurality of result bits in response to a value of a test bit in a bit position in the processed element of the source vector register indicated by the index.

[0005] In another exemplary embodiment, an apparatus includes means for decoding an instruction and generating control signals responsive to the instruction; means for performing a data processing operation responsive to the generated control signals; and means for causing execution of a bit test procedure on a plurality of elements stored in the source vector register to generate a plurality of result bits responsive to a bit test instruction specifying a source vector register and an index, the bit test procedure including, for each processed element of the plurality of elements, setting a respective result bit of the plurality of result bits in response to a value of a test bit in a bit position in the processed element of the source vector register indicated by the index.

[0006] In another exemplary embodiment, there is a computer program for controlling a host data processing apparatus to provide an instruction execution environment comprising instruction decode program logic for decoding instructions and generating control signals responsive to the instructions, and data processing program logic for performing data processing operations in response to the control signals generated by the instruction decode program logic, wherein the instruction decode program logic is responsive to a bit test instruction specifying a source vector data structure and an index to cause the data processing program logic to perform a bit test procedure on a plurality of elements stored in the source vector data structure to generate a plurality of result bits, the bit test procedure including, for each processed element of the plurality of elements, setting a respective result bit of the plurality of result bits in response to a value of a test bit in a bit position in the processed element of the source vector data structure indicated by the index.

[0007] The present technology will now be further described, by way of example only, with reference to embodiments thereof as illustrated in the accompanying drawings, in which: [Brief description of the drawings]

[0008] [Figure 1] FIG. 1 is a schematic diagram illustrating a data processing apparatus according to an embodiment. [Diagram 2] FIG. 2 illustrates a schematic diagram of a data processing circuit for performing a bit test procedure on elements of a source vector in one embodiment; [Figure 3A] FIG. 2 illustrates a schematic diagram of a data processing circuit for performing a bit test procedure on elements of a source vector with reference to a dominating predicate value in one embodiment; [Figure 3B] 3B illustrates two exemplary bit test instructions corresponding to the embodiment shown in FIG. 3A. [Figure 4A] FIG. 2 illustrates an exemplary bit test instruction and corresponding data processing circuitry for performing a bit test procedure with reference to a scalar index value in one embodiment. [Figure 4B]FIG. 1 illustrates an exemplary bit test instruction and corresponding data processing circuitry for performing a bit test procedure on elements of a source vector with reference to a particular index value for each element provided by an index vector in one embodiment. [Diagram 5] FIG. 2 illustrates a sequence of steps taken when carrying out the method of one embodiment. [Figure 6] FIG. 1 illustrates a schematic diagram of components of a system for providing a simulator implementation of one embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0009] At least some embodiments provide an apparatus comprising an instruction decode circuit for decoding instructions and generating control signals in response to the instructions, and a data processing circuit for performing a data processing operation in response to the control signals generated by the instruction decode circuit, wherein the instruction decode circuit is responsive to a bit test instruction specifying a source vector register and an index to cause the data processing circuit to perform a bit test procedure on a plurality of elements stored in the source vector register to generate a plurality of result bits, the bit test procedure including, for each processed element of the plurality of elements, setting a respective result bit of the plurality of result bits in response to a value of a test bit in a bit position in the processed element of the source vector register indicated by the index.

[0010] Thus, the bit test instruction, and the corresponding support circuitry for executing it, provides the programmer with the ability to perform bit tests on multiple bits in parallel, with an approach in which each bit to be tested is found within a respective element of a source vector. The source vector, specified by reference to the vector register holding it, thus forms one input to the bit test procedure, and the index specified in the bit test instruction allows the programmer to define which bits of the elements in the source vector are to be subjected to the bit test. The result of the bit test procedure performed in response to the bit test instruction is a set of result bits (one result bit corresponding to each processed element of the multiple elements of the source vector that are subjected to the bit test procedure), each result bit of the multiple result bits being set according to the value of the corresponding test bit. It will thus be understood that in the context of bit testing, the result bit can be set to match the test bit, or conversely, the result bit can be set to be the complement (reciprocal) of the test bit, which is essentially an implementation choice. The provision of this bit test instruction can thus improve the performance of any program code that is required to perform multiple bit tests and that can be suitably formulated into a vectorized form. Essentially, a parallelized approach is provided instead of a linear approach.

[0011] Depending on the capabilities and configuration of the data processing circuitry, not all of the elements of the source vector register may be subjected to the bit test procedure. In other words, only a strict subset of the elements of the source vector register may be subjected to the bit test procedure. However, in some embodiments, the plurality of elements subjected to the bit test procedure includes all elements of the source vector register.

[0012] A programmer may be provided with the ability to specify which elements of the source vector register are to be subjected to the bit test procedure. Thus, in some embodiments of the bit test procedure, when a respective predicate bit of a set of dominating predicate bit values ​​has a first predetermined value, an element of the plurality of elements is subjected to the bit test procedure as a processed element. In other words, the programmer sets the corresponding predicate bit to a first predetermined value (e.g., 1) to cause the bit test procedure to be performed on the corresponding element of the source vector.

[0013] Depending on the configuration and capabilities of the data processing circuit, the set of dominating predicate bit values ​​may vary in length relative to the number of elements in the source vector register, e.g., corresponding to only a strict subset of the elements of the source vector register, although in some embodiments some values ​​in the set of dominating predicate bit values ​​match some elements in the source vector register.

[0014] While the set of dominating predicate bit values ​​may be provided in a variety of ways, in some embodiments the bit test instruction specifies the set of dominating predicate bit values, and in further embodiments the bit test instruction specifies a register that holds the set of dominating predicate bit values. Thus, for example, by setting the dominating predicate bit values ​​in a specified register, a programmer can determine which of the elements of the source vector are to be subjected to the bit test procedure.

[0015] Although the bit test procedure may be variously configured when such a set of dominating predicate bit values ​​is provided, in some embodiments of the bit test procedure, when a respective predicate bit of the set of dominating predicate bit values ​​does not have a first predetermined value, a respective result bit of the plurality of result bits is set to a second predetermined value. While it is clearly understood that the selection of the first and second predetermined values ​​is an arbitrary implementation choice, in some embodiments, when a dominating predicate bit value is 0, the corresponding respective result bit is also set to 0. Thus, conversely, when a predicate bit is set to 1, the corresponding element of the source vector register is processed as part of the bit test procedure, and the test bit of the processed element at the bit position indicated by the index determines the corresponding result bit.

[0016] Although the data processing circuitry may utilize the multiple result bits in a variety of ways, in some embodiments the data processing circuitry is arranged to store the multiple result bits in a result register, which may be known by default or in some embodiments the result register is specified in the bit test instruction, thus providing the programmer with the ability to specify a register in which the multiple result bits should be stored.

[0017] In general, the number of result bits associated with the elements of the source vector may vary depending, for example, on the capabilities and configuration of the data processing circuitry, and the number of result bits may be less than the number of elements in the source vector register, although in some embodiments the count of the result bits matches the count of the elements stored in the source vector register.

[0018] It will be appreciated that the respective result bits of the plurality of result bits are set according to the value of the test bit at the bit position in the processed element of the source vector register indicated by the index, and the device may be set to perform this setting in a complementary manner. In other words, in some embodiments of the bit test procedure, the respective result bit of the plurality of result bits is set to match the value of the test bit. Conversely, in other embodiments of the bit test procedure, the respective result bit of the plurality of result bits is set to not match the value of the test bit. In fact, these two variations may be provided as two different bit test instructions, which are referred to herein as TSTZ ("test zero") and TSTNZ ("test non-zero").

[0019] Apparatus in accordance with the present technique may also be provided that is responsive to both types of bit test instructions, thus giving the programmer the choice of whether to test with zeroed or non-zeroed bits, and thus in some embodiments the instruction decode circuitry is responsive to a further bit test instruction which causes the data processing circuitry to perform a further bit test procedure including setting a further respective result bit of a further plurality of result bits not to match the value of the further test bit. In other words, the programmer may use a bit test instruction in which the result bit is set to match the value of the test bit, and then use a further bit test instruction in which the result bit is not set to match the test bit.

[0020] Conversely, in some embodiments, the instruction decode circuitry is responsive to a further bit test instruction that causes the data processing circuitry to perform a further bit test procedure including setting a further respective result bit of a further plurality of result bits to match the value of the further test bit. Thus, a programmer may use a bit test instruction that causes the result bit to be set not to match the value of the test bit, and then use a further bit test instruction that causes the result bit to match the test bit. The language of certain embodiments discussed herein allows a programmer to use both the TSTZ instruction and the TSTNZ instruction in any definition and in either order.

[0021] The index may be defined in various ways, but in some embodiments, the index is an immediate value specified in the bit test instruction. Alternatively, the bit test instruction may specify a scalar index register, and in such embodiments, the index is a scalar value stored in the scalar index register specified in the bit test instruction. In yet another embodiment, the bit test instruction may specify a vector index register that holds multiple index values, and in the bit test procedure, for each processed element of the multiple elements, the index is given by a respective index value of the multiple index values. This means that, unlike the scalar example, a programmer can use a different index value for each processed element of the multiple elements of a source vector, thus bit testing any bit of a given element.

[0022] At least some embodiments provide a method of decoding an instruction to generate control signals responsive to the instruction, performing a data processing operation in response to the generated control signals, and in response to a bit test instruction specifying a source vector register and an index, causing execution of a bit test procedure on a plurality of elements stored in the source vector register to generate a plurality of result bits, the bit test procedure comprising, for each processed element of the plurality of elements, setting a respective result bit of the plurality of result bits in response to a value of a test bit in a bit position in the processed element of the source vector register indicated by the index.

[0023] At least some embodiments provide an apparatus comprising: means for decoding an instruction and generating control signals in response to the instruction; means for performing a data processing operation in response to the generated control signals; and means for causing execution of a bit test procedure on a plurality of elements stored in the source vector register to generate a plurality of result bits in response to a bit test instruction specifying a source vector register and an index, the bit test procedure comprising, for each processed element of the plurality of elements, setting a respective result bit of the plurality of result bits in response to a value of a test bit in a bit position in the processed element of the source vector register indicated by the index.

[0024] In another exemplary embodiment, there is a computer program for controlling a host data processing apparatus to provide an instruction execution environment comprising instruction decode program logic for decoding instructions and generating control signals responsive to the instructions, and data processing program logic for performing data processing operations in response to the control signals generated by the instruction decode program logic, wherein the instruction decode program logic is responsive to a bit test instruction specifying a source vector data structure and an index to cause the data processing program logic to perform a bit test procedure on a plurality of elements stored in the source vector data structure to generate a plurality of result bits, the bit test procedure including, for each processed element of the plurality of elements, setting a respective result bit of the plurality of result bits in response to a value of a test bit in a bit position in the processed element of the source vector data structure indicated by the index.

[0025] At least some embodiments provide a computer-readable storage medium storing a computer program according to the above-described embodiments. The program may be stored non-transitory.

[0026] Some specific embodiments will now be described with reference to the drawings.

[0027] FIG. 1 illustrates a schematic diagram of a data processing apparatus according to an embodiment. The general configuration of a data processing apparatus 10 is well known to those skilled in the art, and detailed descriptions of components not specifically related to the present technology are omitted herein for the sake of brevity. In general, as shown in FIG. 1, the data processing apparatus 10 comprises an execution circuit 12 having associated system registers 14, general purpose registers 16, and vector registers 18. The execution circuit 12 utilizes these registers in performing its data processing operations. The data processing operations performed by the execution circuit 12 are defined by a set of instructions retrieved from the memory 20 by operation of a fetch circuit 22. In retrieving the instructions from the memory 20, the instructions may be temporarily cached in one or both of a level 1 instruction cache 24 and a unified level 2 cache 26. The instructions thus fetched by the fetch circuit 22 are passed to a decode circuit 28, which generates control signals for the execution circuit 12 based on the retrieved instructions and the specific instruction parameters they carry. Execution circuitry 12 performs data processing operations, as described above, with respect to registers 14, 16, and 18, and, as necessary, by retrieving data items from memory 20 and writing processed data items back to memory 20. As with instructions, data items accessed in memory 20 by execution circuitry 12 are similarly accessed by the cache hierarchy, namely, level 1 data cache 30 and unified level 2 cache 26. Further details of execution circuitry 12 are now provided in connection with various embodiments with reference to the following drawings.

[0028] FIG. 2 shows a schematic of a portion of the execution circuitry 12 in one embodiment provided for executing a bit test procedure initiated by a bit test instruction. The bit test instructions are shown at the top of FIG. 2 in two variants, namely TSTZ and TSTNZ. As shown, these instructions specify a source vector (register) and an index value. In this example, the index value is an immediate value. The index value, which has an immediate value of 2 in the illustrated example, allows the data processing circuitry to access the respective bit at bit position 2 in each element of the source vector. Thus, in the illustrated example, where the source vector comprises four elements each containing 8 bits, this allows the data processing circuitry to access the third bit of each element (at bit position 2). These bits are passed to comparators 40, 42, 44, and 46. Each of these comparators has a second input, which is a binary input indicating whether the bit test instruction is TSTZ or TSTNZ. This binary input causes the TSTZ instruction to cause the comparators to generate the complement of the test bit at the indexed bit position in the corresponding element of the source vector, while the instruction is TSTNZ, causing each comparator to invert the bit test performed by the comparator such that the result bit matches the test bit at the indexed bit position in the corresponding element of the source vector. The example value shown in Figure 2 receives the TSTZ instruction, and thus causes the comparators to invert a set of four test bits from the source vector to create a set of result bits.

[0029] FIG. 3A shows in a schematic manner relevant components of a data processing circuit in a further exemplary embodiment, where the bit test procedure is performed further according to the contents of a set of dominating predicate bit values. A corresponding pair of bit test instructions, also called TSTZ and TSTNZ, is shown in FIG. 3B. Each bit of the set of dominating predicate bit values, shown as item 60 in FIG. 3A, determines whether a particular element of the source vector is subjected to the bit test of the bit test procedure. In the illustrated example, only elements of the source vector for which the corresponding bit of the set of dominating predicate bit values ​​is set to 1 are subjected to this bit test. To implement this, a bit test control circuit 62 receives the set of dominating predicate bit values ​​60 and generates a set of override signals that control the operation of bit test comparators 64, 66, 68, and 70. As in the example of FIG. 2, these comparators receive corresponding test target bits identified by index values ​​from each element of the source vector and are also controlled by binary TSTZ / TSTNZ inputs. A set of result bits 72 is thus generated by the comparators. Thus, in the example of FIG. 3A where only the two least significant bits of the dominating predicate 60 are set, the two most significant bits of the set of result bits are automatically set to 0, while the two least significant bits of the set of result bits 72 are set by comparators 68 and 70 according to the respective bits they test. This is the TSTZ instruction being executed in the example of FIG. 3A, and thus the test bits are inverted to generate the two least significant bits of the set of result bits 72 as "0" and "1". As can be seen in the example shown in FIG. 3B, the TSTZ and TSTNZ instructions in this example specify as source vector registers and index immediate values ​​as in the example of FIG. 2, but now further specify a dominating predicate register and a destination register. Thus, the set of dominating predicate bit values ​​60 are obtained from the specified dominating predicate register, while the set of result bits 72 are written to the specified destination register.It will be appreciated that the fact that the instruction of FIG. 3B additionally specifies both a destination register and a dominating predicate register with respect to the example of FIG. 2 is not significant, and in another exemplary embodiment, the bit test instruction may specify only one of these in addition to the source register and index.

[0030] FIG. 4A shows an example where a TSTZ instruction specifies a destination register, a dominating predicate register, a source vector register, and an index (scalar) register. Thus, a data processing circuit performing a corresponding bit test procedure obtains a set of dominating predicate bit values ​​80 from a specified register Pg and an index value 82 from a specified index register (in this example, the index value is 7). Thus, in each element of the source vector Zs, if the corresponding bit of the dominating predicate 80 is set, the eighth bit of each (i=7) is accessed and tested. For ease of illustration, a simplified configuration is shown in FIG. 4A, with arrows extending directly from the test bits of the source vector Zs to the respective result bits of the destination predicate 84. In reality, these arrows are implemented via a set of comparators such as those shown in the example of FIG. 3A, which are controlled by the respective sets of dominating predicates 80, as well as by a binary value indicating whether the instruction is a TSTZ or a TSTNZ. In the example of FIG. 4A where the instruction is TSTZ, the test bits are inverted to provide the corresponding bits of the destination predicate 84 (this is shown in FIG. 4A by the notation: source bits (0 / 1) to result bits (1 / 0)).

[0031] 4B, an example of a TSTNZ instruction is shown, which also specifies a destination result register, a dominating predicate register, and a source vector register, and in this example also an index vector register. Thus, the dominating predicate 86 again selects the elements of the source vector Zs that are to undergo the bit testing procedure, while which bit of each tested element is to be tested is individually specified by the index given in the corresponding element of the index vector 88. Thus, in the example given in FIG. 4B, it can be seen that bit position 4 is tested in element 0, bit position 2 is tested in element 2, bit position 7 is tested in element 4, and bit position 0 is tested in element 6. No bits are tested in elements 1, 3, 5, and 7, since the corresponding bits of the dominating predicate 86 are set to 0, and therefore the corresponding bits of the destination of the predicate 90 are also set to 0.

[0032] The example shown in Figure 4B is that of a TSTNZ instruction, so that the test bits of the source vector are effectively replicated into the corresponding bits of the destination predicate 90 (this is indicated in Figure 4B by the notation: source bit (0 / 1) to result bit (0 / 1)). As in the case of Figure 4A, the illustration of Figure 4B is shown in simplified form for ease of illustration with just arrows extending from the test bits of each element of the source vector Zs to the corresponding bit position in the destination predicate 90. As before, in practice these are implemented via a set of comparators that receive the input bit to be tested and are controlled by a binary input indicating whether the instruction is TSTZ or TSTNZ.

[0033] A further variation is applicable to any of the exemplary embodiments described above, namely that the bit test instruction may further modify any of its specified registers with a size specifier indicating the size interpretation of the contents of that register. <pd> . <t> , <pg> . <t> , <zs> . <t>, index, etc. This size specifier can be compactly encoded in the instruction, for example 00 = byte length (B); 01 = halfword length (H); 10 = single length (S); and 11 = double length (D).

[0034] Size Specifier <t>The use of allows the programmer to specify the size of the data value in each element of a respective vector of elements. Thus, in the absence of this size specifier, or in fact if the size specifier has a value that matches the default, a default interpretation of the register's elements may be used, e.g., "S", single length. However, <t>If a value of is specified in the instruction, then the specified size of each vector element is used. Further variations on this functionality are also possible in any of the above exemplary embodiments, where the size specifier itself is provided by a register, and the data processing circuitry accesses the specified size specification register to extract the required size value.

[0035] FIG. 5 illustrates a series of steps performed according to a method of one embodiment. The flow is considered to begin at step 100, where an instruction decode circuit decodes the next instruction in a series of instructions provided to the device. To simplify the diagram, it is assumed that there is always a next instruction to decode. At step 102, it is determined whether this is a bit test instruction, and if not, the instruction is simply executed in step 104 in the normal manner for this instruction, and the flow returns to step 100 (since only new bit test instructions are of interest here). For a bit test instruction, the flow proceeds from step 102 to step 104, where it is determined whether any bits in the dominating predicate are set to 0. This is when the flow proceeds through step 106, where the corresponding bit or bits in the resulting predicate are also set to 0. It is then determined at step 108 whether the bit test instruction specified a vector (as opposed to a defined immediate or scalar register) index. If so, flow proceeds through step 110 where a unique index for each processed element of the source vector, obtained from the corresponding element of the vector index, is used. Otherwise, in step 112, the scalar value of the index (provided in a scalar register or as an immediate value in the instruction) is used for all processed elements of the source vector. Then, in step 114, it is determined whether this is a TSTZ or TSTNZ instruction. If it is a TSTNZ instruction, flow proceeds to step 116 where the index bit of each processed element of the source vector is copied into the respective bit of the result predicate. Alternatively, if this is a TSTZ instruction, flow proceeds through step 118 where the inverted index bit of each processed element of the source vector is copied into the respective bit of the result predicate. Execution of this bit test instruction is then completed and flow returns to step 100.

[0036] FIG. 6 illustrates a simulator implementation that may be used. Although the previously described embodiments have implemented the invention in terms of apparatus and methods for operating specific processing hardware supporting the relevant technology, it is also possible to provide an instruction execution environment according to the embodiments described herein that is implemented through the use of a computer program. Such a computer program is often referred to as a simulator insofar as it provides a software-based implementation of a hardware architecture. Various simulator computer programs include emulators, virtual machines, models, and binary translators, including dynamic binary translators. Typically, a simulator implementation may run on a host processor 730, which optionally runs a host operating system 720 and supports a simulator program 710. In some arrangements, there may be multiple layers of simulation between the hardware and the provided instruction execution environment, and / or between multiple different instruction execution environments provided on the same host processor. Historically, a powerful processor has been required to provide a simulator implementation that runs at a reasonable speed, but such an approach may be justified in certain situations, such as when one wishes to execute code native to another processor for compatibility or reuse reasons. For example, a simulator implementation may provide an instruction execution environment with additional features not supported by the host processor hardware, or may provide an instruction execution environment that is normally associated with a different hardware architecture. An overview of simulation is given in "Some Efficient Architecture Simulation Techniques", Robert Bedichek, Winter 1990 USENIX Conference, pages 53-63.

[0037] To the extent that embodiments have been previously described with reference to particular hardware structures or functions, equivalent functionality may be provided in the simulated embodiments by appropriate software structures or functions. For example, particular circuits may be implemented in the simulated embodiments as computer program logic. Similarly, memory hardware such as registers or caches may be implemented in the simulated embodiments as software data structures. In arrangements in which one or more of the hardware elements referred to in the previously described embodiments are present on host hardware (e.g., host processor 730), some simulated embodiments may utilize the host hardware, where appropriate.

[0038] The simulator program 710 may be stored on a computer-readable storage medium (which may be a non-transitory medium) and provides a program interface (an instruction execution environment) to the target code 700 that is the same as the application program interface of the hardware architecture being modeled by the simulator program 710. Thus, the program instructions of the target code 700, including the bit test instructions described above, may be executed from within the instruction execution environment using the simulator program 710 such that a host computer 730 that does not actually have the hardware capabilities of the devices discussed above can emulate those capabilities.

[0039] In a brief overall summary, an apparatus and method of operating the apparatus are provided. The apparatus is responsive to a bit test instruction specifying a source vector register and an index to perform a bit test procedure on a plurality of elements stored in a source vector register to generate a plurality of result bits. The bit test procedure includes setting, for each processed element of the plurality of elements, a respective result bit of the plurality of result bits according to a value of a test bit in a bit position in the processed element of the source vector register indicated by the index. The bit test instruction thus enables improved performance of program code required to perform the multiple bit tests, which may be suitably formulated into a vectorized form.

[0040] In this application, the term "configured to" is used to mean that elements of an apparatus have a configuration that can perform a defined operation. In this context, "configuration" refers to an arrangement or method of interconnection of hardware or software. For example, an apparatus may have dedicated hardware that provides a predetermined operation, or a processor or other processing device may be programmed to perform a function. "Configured" does not imply that the apparatus elements must be modified in any way to provide a predetermined operation.

[0041] Although exemplary embodiments have been described in detail herein with reference to the accompanying drawings, it should be understood that the invention is not limited to these precise embodiments, and that various changes, additions, and modifications may be made by those skilled in the art without departing from the scope and spirit of the invention as defined by the appended claims. For example, various combinations of the features of the dependent claims may be made with the features of the independent claims without departing from the scope of the invention.< / t> < / t> < / t> < / zs> < / t> < / pg> < / t> < / pd>

Claims

1. an instruction decode circuit that decodes an instruction and generates a control signal corresponding to the instruction; a data processing circuit responsive to the control signals generated by the instruction decode circuit to perform data processing operations; An apparatus comprising: The instruction decode circuit includes: in response to a bit test instruction specifying a source vector register and an index, causing the data processing circuit to perform a bit test procedure on a plurality of elements stored in the source vector register to generate a plurality of result bits; wherein the bit testing step includes, for each element of the plurality of elements, setting a respective result bit of the plurality of result bits in response to a value of a test bit at a bit position within the element of the source vector register indicated by the index; In the bit test procedure, elements of the plurality of elements corresponding to a predicate bit having a first predetermined value in a set of dominant predicate bit values ​​are subjected to a bit test in the bit test procedure; the bit testing step setting result bits for elements of the plurality of elements corresponding to predicate bits in the set of dominant predicate bit values ​​that do not have a first predetermined value to a second predetermined value; the instruction decode circuitry is responsive to the bit test instruction specifying an element size different from a default element size to interpret the contents of the source vector register using the specified element size. Device.

2. The apparatus of claim 1 , wherein the plurality of elements subjected to the bit test procedure includes all elements of the source vector register.

3. The apparatus of claim 1 , wherein some values ​​in the set of dominating predicate bit values ​​match some elements in the source vector register.

4. The apparatus of claim 1 or 3, wherein the bit test instruction specifies a set of the dominating predicate bit values.

5. The apparatus of claim 4 , wherein the bit test instruction specifies a register that holds the set of dominating predicate bit values.

6. Apparatus as claimed in any preceding claim, wherein the data processing circuitry is arranged to store the plurality of result bits in a result register.

7. The apparatus of claim 6 , wherein the result register is specified in the bit test instruction.

8. 8. The apparatus of claim 1, wherein a count of the result bits matches a count of the elements stored in the source vector register.

9. 9. Apparatus according to claim 1, wherein in the bit test procedure the respective result bit of the plurality of result bits is set to match the value of the test bit.

10. 9. The apparatus of claim 1, wherein in the bit test procedure, the respective result bit of the plurality of result bits is set to not match the value of the test bit.

11. 10. The apparatus of claim 9, wherein the instruction decode circuitry is responsive to a further bit test instruction whereby the data processing circuitry performs a further bit test procedure, wherein the further bit test procedure includes setting a further respective result bit of a further plurality of result bits not to match a value of a further test bit.

12. 11. The apparatus of claim 10, wherein the instruction decode circuitry is responsive to a further bit test instruction whereby the data processing circuitry performs a further bit test procedure, wherein the further bit test procedure includes setting a further respective result bit of a further plurality of result bits to match a value of a further test bit.

13. The apparatus of claim 1 , wherein the index is an immediate value of the bit test instruction.

14. The apparatus of claim 1 , wherein the index is a scalar value stored in a scalar index register specified in the bit test instruction.

15. 13. The apparatus of claim 1, wherein the bit test instruction specifies a vector index register holding a plurality of index values, and wherein in the bit test procedure, for each element of the plurality of elements, the index is given by a respective index value of the plurality of index values.

16. 1. A method of operating a data processing apparatus, comprising the steps of: decoding an instruction and generating a control signal responsive to said instruction; performing a data processing operation in response to the generated control signal; in response to a bit test instruction specifying a source vector register and an index, causing execution of a bit test procedure on a plurality of elements stored in the source vector register to generate a plurality of result bits; Equipped with The bit test procedure comprises, for each element of the plurality of elements: setting a respective result bit of the plurality of result bits in response to a value of a test bit at a bit position within the element of the source vector register indicated by the index; In the bit test procedure, elements of the plurality of elements corresponding to a predicate bit having a first predetermined value in a set of dominant predicate bit values ​​are subjected to a bit test in the bit test procedure; the bit testing step setting result bits for elements of the plurality of elements corresponding to predicate bits in the set of dominant predicate bit values ​​that do not have a first predetermined value to a second predetermined value; the decoding includes, in response to the bit test instruction specifying an element size different from a default element size, interpreting the contents of the source vector register using the specified element size. method.

17. means for decoding an instruction and generating a control signal in response to said instruction; means for performing a data processing operation in response to said generated control signal; means for causing, in response to a bit test instruction specifying a source vector register and an index, execution of a bit test procedure on a plurality of elements stored in the source vector register to generate a plurality of result bits; An apparatus comprising: The bit test procedure comprises, for each element of the plurality of elements: setting a respective result bit of the plurality of result bits in response to a value of a test bit at a bit position within the element of the source vector register indicated by the index; In the bit test procedure, elements of the plurality of elements corresponding to a predicate bit having a first predetermined value in a set of dominant predicate bit values ​​are subjected to a bit test in the bit test procedure; the bit testing step setting result bits for elements of the plurality of elements corresponding to predicate bits in the set of dominant predicate bit values ​​that do not have a first predetermined value to a second predetermined value; the means for decoding instructions is responsive to the bit test instruction specifying an element size different from a default element size to interpret the contents of the source vector register using the specified element size. Device.

18. instruction decode program logic for decoding instructions and generating control signals responsive to said instructions; data processing program logic for performing data processing operations in response to the control signals produced by the instruction decode program logic; 1. A computer program product for controlling a host data processing apparatus to provide an instruction execution environment comprising: The instruction decode program logic causes the data processing program logic to and a bit test instruction specifying a source vector data structure and an index to cause a bit test procedure to be performed on a plurality of elements stored in the source vector data structure to generate a plurality of result bits, the bit test procedure performing, for each element of the plurality of elements: setting a respective result bit of the plurality of result bits in response to a value of a test bit at a bit position within the element of the source vector data structure indicated by the index; In the bit test procedure, elements of the plurality of elements corresponding to a predicate bit having a first predetermined value in a set of dominant predicate bit values ​​are subjected to a bit test in the bit test procedure; the bit testing step setting result bits for elements of the plurality of elements corresponding to predicate bits in the set of dominant predicate bit values ​​that do not have a first predetermined value to a second predetermined value; the instruction decode program logic is responsive to the bit test instruction specifying an element size different from a default element size to interpret the contents of the source vector data structure using the specified element size. Computer program.

19. A computer-readable storage medium that non-transitoryly stores the computer program of claim 18.

Citation Information

Patent Citations

  • Systems, apparatuses, and methods for vector bit test

    EP2889756A1

  • Program switching device

    JP1978053237A

  • "VECTORxSCALAR" OPERATION

    JP2005174298A

  • Processors, methods, systems, and instructions to consolidate unmasked elements of operation masks

    JP2014182802A

  • Method of decoding entropy-encoded data

    US20080253668A1