Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |
| en:multiasm:papc:chapter_6_11 [2026/02/19 10:39] – [SSE4] ktokarz | en:multiasm:papc:chapter_6_11 [2026/02/19 10:51] (current) – [SSE4] ktokarz |
|---|
| <caption>The illustration of an example of an advanced shuffle instruction</caption> | <caption>The illustration of an example of an advanced shuffle instruction</caption> |
| </figure> | </figure> |
| In SSE4.2, the set of string compare instructions was added. As the XMM registers can contain sixteen bytes, it is much more efficient to implement string processing algorithms with bigger XMM registers than with registers in the main processor with the use of strong instructions. There are four string compare instructions (see table {{ref>sse4stringtable}}), but each of them can be configured to achieve different functionalities. The length of strings can be explicit or implicit. Explicit length means that the length of the first operand is specified with the RAX register, and the length of the second operand is specified with the RDX register. Implicit length means that both operands contain null-terminated strings. Instructions can produce two kinds of results. Index means that the index of the first or last result is returned. Mask means that the bit mask is returned (one bit for each two elements compared) or a mask of the size of the elements (similarly to MMX compare). | In SSE4.2, the set of string compare instructions was added. As the XMM registers can contain sixteen bytes, it is much more efficient to implement string processing algorithms with bigger XMM registers than with registers in the main processor with the use of string instructions. There are four string compare instructions (see table {{ref>sse4stringtable}}), but each of them can be configured to achieve different functionalities. The length of strings can be explicit or implicit. Explicit length means that the length of the first operand is specified with the RAX register, and the length of the second operand is specified with the RDX register. Implicit length means that both operands contain null-terminated strings. Instructions can produce two kinds of results. Index means that the index of the first or last result is returned. Mask means that the bit mask is returned (one bit for each two elements compared) or a mask of the size of the elements (similarly to MMX compare). |
| <table sse4stringtable> | <table sse4stringtable> |
| <caption>SSE4.2 string compare instructions</caption> | <caption>SSE4.2 string compare instructions</caption> |