IP Library Granted Patent US 11,972,259
Granted Patent B2
US 11,972,259 · App. 16/503,136 · Granted Apr 30, 2024

Instructions to count a number of contiguous register elements having specific values in a selected location

Inventors: Michael K. Gschwind (Chappaqua, NY); Markus Kaltenbach (Holzgerlingen, DE); Jentje Leenstra (Bondorf, DE); Brett Olsson (Cary, NC)
Assignee: INTERNATIONAL BUSINESS MACHINES CORPORATION
G06F9/30021G06F9/30018G06F9/30036
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,972,259
App. No.
16/503,136
Granted
Apr 30, 2024
Kind
B2
Abstract

A machine instruction to find a condition location within registers, such as vector registers. The machine instruction has associated therewith a register to be examined and a result location. The register includes a plurality of elements. In execution, the machine instruction counts a number of contiguous elements of the plurality of elements of the register having a particular value in a selected location within the contiguous elements. Other locations within the contiguous elements are ignored for the counting. The counting provides a count placed in the result location.

Claims (32)

1. A computer program product comprising:

a non-transitory computer readable storage medium readable by a processor and storing various instructions for execution by the processor for performing a method comprising:

obtaining, by the processor, a particular instruction to be executed, the particular instruction having associated therewith a register to be examined, a specific location within the register having a specific condition, and a result location to be used for the particular instruction for the register, the register comprising a plurality of elements; and

executing, by the processor, the particular instruction, the executing the particular instruction comprising:

generating a count by counting a number of contiguous elements of the plurality of elements of the register having a particular value in a selected location within the contiguous elements, wherein the specific location identifies the selected location, wherein the selected location does not comprise all locations within the contiguous elements, wherein all other locations within the contiguous elements, other than the selected location of each element within the contiguous elements, are ignored for the counting, wherein a size of an element of the plurality of elements is indicated by a field of the particular instruction, the size to be used in identifying the selected location; and

determining if the count is less than a number of elements in the register;

based on determining that the count is not less than the number of elements in the register, setting the result location to a first value to indicate no miscompare in the register; and

based on determining that the count is less than the number of elements in the register, storing the count for the register in the result location as an index in the register for the miscompare.

2. The computer program product of claim 1 , wherein the executing further comprises determining whether leading elements of the register or trailing elements of the register are to be counted, and wherein the counting comprises counting the number of contiguous leading elements of the register or the number of contiguous trailing elements of the register based on the determining.

3. The computer program product of claim 2 , wherein the particular instruction includes an operation code to define an operation to be performed in executing the particular instruction, and wherein the determining is based on the operation code or another field of the particular instruction.

4. The computer program product of claim 1 , wherein the field of the particular instruction comprises an operation code of the particular instruction used to define an operation to be performed in executing the particular instruction or another field of the particular instruction.

5. The computer program product of claim 4 , wherein the other field of the particular instruction comprises a mask field, the mask field configured to indicate a plurality of selectable sizes for the plurality of elements of the register.

6. The computer program product of claim 1 , wherein the selected location consists of a least significant bit of an element.

7. The computer program product of claim 1 , wherein the particular value comprises zero.

8. The computer program product of claim 1 , wherein the register comprises a vector register having a wide layout.

9. The computer program product of claim 8 , wherein the wide layout of the vector register comprises 128 bits, the vector register has sixteen elements, each element of the sixteen elements of the vector register having eight bits, and the selected location of each element of the vector register is a least significant bit of the eight bits of that element of the vector register.

10. A system comprising:

a memory; and

a processor in communications with the memory, wherein the system is configured to perform a method, the method comprising:

obtaining, by the processor, a particular instruction to be executed, the particular instruction having associated therewith a register to be examined, a specific location within the register having a specific condition, and a result location to be used for the particular instruction for the register, the register comprising a plurality of elements; and

executing, by the processor, the particular instruction, the executing the particular instruction comprising:

generating a count by counting a number of contiguous elements of the plurality of elements of the register having a particular value in a selected location within the contiguous elements, wherein the specific location identifies the selected location, wherein the selected location does not comprise all locations within the contiguous elements, wherein all other locations within the contiguous elements, other than the selected location of each element within the contiguous elements, are ignored for the counting, wherein a size of an element of the plurality of elements is indicated by a field of the particular instruction, the size to be used in identifying the selected location; and

determining if the count is less than a number of elements in the register;

based on determining that the count is not less than the number of elements in the register, setting the result location to a first value to indicate no miscompare in the register; and

based on determining that the count is less than the number of elements in the register, storing the count for the register in the result location as an index in the register for the miscompare.

11. The system of claim 10 , wherein the executing further comprises determining whether leading elements of the register or trailing elements of the register are to be counted, and wherein the counting comprises counting the number of contiguous leading elements of the register or the number of contiguous trailing elements of the register based on the determining.

12. The system of claim 11 , wherein the instruction includes an operation code to define an operation to be performed in executing the instruction, and wherein the determining is based on the operation code or another field of the instruction.

13. The system of claim 10 , wherein the field of the instruction comprises an operation code of the instruction used to define an operation to be performed in executing the instruction or another field of the instruction.

14. The system of claim 13 , wherein the other field of the instruction comprises a mask field, the mask field configured to indicate a plurality of selectable sizes for the plurality of elements of the register.

15. The system of claim 10 , wherein the selected location consists of a least significant bit of an element.

16. The system of claim 10 , wherein the particular value comprises zero.

17. The system of claim 10 , wherein the register comprises a vector register having a wide layout.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jul 3, 2019
From: GSCHWIND, MICHAEL K.; KALTENBACH, MARKUS; LEENSTRA, JENTJE; OLSSON, BRETT
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 049666/0957 →
Continuity (2)
Continuation 14748550 · Jun 24, 2015
Related Publication 20190324749A1 · Oct 24, 2019