This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:multiasm:papc:chapter_6_3 [2025/12/22 11:34] – [x86 registers] ktokarz | en:multiasm:papc:chapter_6_3 [2026/04/01 14:03] (current) – [ZMM registers] ktokarz | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Register Set ====== | ====== Register Set ====== | ||
| + | As x86 processors evolved, the set of available registers and their size expanded. Newer processors added more general-purpose registers, and new registers related to the FPU and vector extensions were added. In this chapter, we discuss the registers available to the programmer, from the 8086 up to modern 64-bit processors. | ||
| ===== x86 registers ===== | ===== x86 registers ===== | ||
| The 8086 processor has seven general-purpose registers for data storage, data manipulation and indirect addressing. Four registers: AX, BX, CX and DX can be accessed in two 8-bit halves. The lower half has the " | The 8086 processor has seven general-purpose registers for data storage, data manipulation and indirect addressing. Four registers: AX, BX, CX and DX can be accessed in two 8-bit halves. The lower half has the " | ||
| Line 139: | Line 140: | ||
| </ | </ | ||
| ===== XMM registers ===== | ===== XMM registers ===== | ||
| - | SSE instructions are executed with the use of 128-bit packed data. To perform calculations, | + | SSE instructions are executed with the use of 128-bit packed data. To perform calculations, |
| - | + | ||
| - | <figure xmmregs> | + | |
| - | {{ : | + | |
| - | < | + | |
| - | </ | + | |
| To control the behaviour and to provide information about the status of the SSE unit, the MXCSR register is implemented (figure {{ref> | To control the behaviour and to provide information about the status of the SSE unit, the MXCSR register is implemented (figure {{ref> | ||
| Line 153: | Line 149: | ||
| </ | </ | ||
| ===== YMM registers ===== | ===== YMM registers ===== | ||
| - | The YMM registers are the 256-bit extension to the XMM registers. They are introduced to implement the AVX set of instructions. Additionally, | + | The YMM registers are the 256-bit extension to the XMM registers. They are introduced to implement the AVX set of instructions. Additionally, |
| - | + | ||
| - | <figure ymmregs> | + | |
| - | {{ : | + | |
| - | < | + | |
| - | </ | + | |
| ===== ZMM registers ===== | ===== ZMM registers ===== | ||
| - | ZMM registers are the further extension of XMM registers to 512 bits. In 64-bit machines, 32 of such registers are available | + | ZMM registers are the further extension of XMM registers to 512 bits. In 64-bit machines, 32 of such registers are available. |
| - | + | ||
| - | <figure zmmregs> | + | |
| - | {{ : | + | |
| - | < | + | |
| - | </ | + | |
| XMM are the physical lower halves of YMM, which are the lower halves of ZMM. Anything written to the XMM register appears in part of the YMM and ZMM registers as presented in figure {{ref> | XMM are the physical lower halves of YMM, which are the lower halves of ZMM. Anything written to the XMM register appears in part of the YMM and ZMM registers as presented in figure {{ref> | ||
| Line 172: | Line 158: | ||
| < | < | ||
| </ | </ | ||
| - | Together with AVX extension and ZMM registers, eight 16-bit opmask registers were introduced to x64 processors | + | Together with AVX extension and ZMM registers, eight 16-bit opmask registers were introduced to x64 processors. They can be used, e.g. to provide conditional execution or mask several elements of vectors in AVX instructions. |
| - | + | ||
| - | <figure opmaskregs> | + | |
| - | {{ : | + | |
| - | < | + | |
| - | </ | + | |