主权项 |
1. A method performed by a computer for determining whether corresponding subfields of corresponding data elements of bit matrices are the same, the computer having an instruction set with a bit matrix compare instruction that performs a bit matrix compare operation, the method comprising:
performing a logical XOR on corresponding bits of the bit matrices to produce an XOR bit matrix with XOR elements; storing a pattern bit matrix into a first register, the pattern bit matrix specifying pattern elements that define the subfields of the data elements, each pattern element of the pattern bit matrix with bits set to one to indicate the bits of the data elements that are in that subfield; storing the XOR bit matrix into a second register; and executing the bit matrix compare instruction on the first register storing the pattern bit matrix and the second register storing the XOR bit matrix to generate a result bit matrix; wherein a one in the result bit matrix indicates that the corresponding subfield of corresponding data elements of the bit matrices are different and a zero in the result bit matrix indicates that the corresponding subfield of the corresponding data elements of the bit matrices are the same. |