# US 2015/0106593 A1 · Instruction and logic for processing text strings

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2015/0106593 A1
- Document ID: US20150106593A1
- Status: Published application
- Kind: A1
- Application number: 14/576,136
- Filed: 2014-12-18
- Published: 2015-04-16
- Earliest claimed: 2006-09-22
- Assignees: Intel Corporation
- Applicants: Intel Corporation
- Inventors: Michael A. Julier; Jeffrey D. Gray; Srinivas Chennupaty; Sean P. Mirkes; Mark P. Seconi
- Web page: https://patentgrep.com/patent/US20150106593A1

## CPC

- G06F 9/30145: {Instruction analysis, e.g. decoding, instruction word fields}
- G06F 7/06: Arrangements for sorting, selecting, merging, or comparing data on individual record carriers
- G06F 9/30: Arrangements for executing machine instructions, e.g. instruction decode (for executing microinstructions G06F9/22)
- G06F 9/3001: {Arithmetic instructions}
- G06F 9/30021: {Compare instructions, e.g. Greater-Than, Equal-To, MINMAX}
- G06F 9/30029: {Logical and Boolean instructions, e.g. XOR, NOT}
- G06F 9/30036: {Instructions to perform operations on packed data, e.g. vector, tile or matrix operations}
- G06F 9/30038: {using a mask}
- G06F 9/30098: {Register arrangements}
- G06F 9/30109: {having multiple operands in a single register}
- G06F 9/3013: {according to data content, e.g. floating-point registers, address registers}
- G06F 9/30167: {of immediate specifier, e.g. constants}
- G06F 9/3017: {Runtime instruction translation, e.g. macros}
- G06F 9/30185: {according to one or more bits in the instruction, e.g. prefix, sub-opcode}
- G06F 9/30192: {according to data descriptor, e.g. dynamic data typing}
- G06F 9/3802: {Instruction prefetching}
- G06F 9/3853: {of compound instructions}
- G06F 9/3887: {controlled by a single instruction for multiple data lanes [SIMD]}
- G06F 12/0875: with dedicated cache, e.g. instruction or stack
- G06F 9/34: Addressing or accessing the instruction operand or the result {; Formation of operand address; Addressing modes (address translation G06F12/00)}
- G06F 9/3824: {Operand accessing}
- G06F 9/3885: {using a plurality of independent parallel functional units}
- G06F 2212/452: Instruction code
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Method, apparatus, and program means for performing a string comparison operation. In one embodiment, an apparatus includes execution resources to execute a first instruction. In response to the first instruction, said execution resources store a result of a comparison between each data element of a first and second operand corresponding to a first and second text string, respectively.

## Claims

### Claim 1

A processor comprising:
multiple levels of cache, including a Level 1 (L1) cache;
a plurality of registers to store 128-bit packed data operands;
a decoder to decode instructions including a packed comparison instruction, wherein the packed comparison instruction is to identify a first 128-bit source packed data operand in the plurality of registers, and a second 128-bit source packed data operand in memory or the plurality of registers, wherein valid data elements in the first and second source packed data operands are to be implicitly indicated by null elements in the first and second source packed data operands, and wherein the packed comparison instruction is to have an immediate that is to include:
a first two bits, wherein the first two bits being equal to 00B is to indicate that data elements of the first and second 128-bit source packed data operands are unsigned bytes, being equal to 01B is to indicate that the data elements are unsigned words, being equal to 10B is to indicate that the data elements are signed bytes, and being equal to 11B is to indicate that the data elements are signed words;
a second two bits, wherein the second two bits being equal to 00B is to indicate that comparisons to be performed are to determine whether any of the valid data elements of the first and second 128-bit source packed data operands are equal, being equal to 01B is to indicate that the comparisons are to involve ranges, and being equal to 11B is to indicate that the comparisons are to determine whether the first and second 128-bit source packed data operands have an equal ordered plurality of data elements;
a third two bits to control a negation operation, wherein the third two bits being equal to 00B is to indicate that all bits of a result of the comparisons are not to be negated, being equal to 01B is to indicate that said all bits of the result of the comparisons are to be negated, and being equal to 11B is to indicate that only bits of the result of the comparisons that correspond to the valid data elements of one of the first and second 128-bit source packed data operands are to be negated; and
a fourth bit, wherein the fourth bit being equal to 0B is to indicate that a result of the negation operation is to be zero extended to a mask, and being equal to 1B is to indicate that the result of the negation operation is to be expanded to one of a byte mask and word mask; and
an execution unit coupled with the decoder to execute the packed comparison instruction.

### Claim 2 (depends on 1)

The processor of claim 1, further comprising a plurality of flags, wherein the flags are to indicate when a source data element is invalid.

### Claim 3 (depends on 1)

The processor of claim 1, further comprising a plurality of flags, wherein the flags are to indicate a value of a least significant bit of a result of the instruction.

### Claim 4 (depends on 1)

The processor of claim 1, wherein the second two bits being equal to the 01B is to indicate that the comparisons are to determine whether any data elements of one of the 128-bit source packed data operands are within any of a set of ranges defined by data elements of another of the 128-bit source packed data operands.

### Claim 5 (depends on 1)

The processor of claim 1, further comprising a microcode read only memory (ROM) to store microcode for the packed comparison instruction.

### Claim 6 (depends on 1)

The processor of claim 1, wherein the mask indicated by the fourth bit is to be stored in an XMM0 register.

### Claim 7 (depends on 1)

The processor of claim 1, wherein the immediate is an 8-bit immediate (imm8), the first two bits are imm8[1:0], the second two bits are imm8[3:2], and the fourth bit is imm8[6].
