In the Intel x64 manual it says that there's XMM registers 0-7 in 32-bit SSE2 mode. Why then do 95% of the instructions that use these registers skip 0 and use 1-4?
Asked
Active
Viewed 144 times
0
-
The numbering in Intel's manuals are placeholders, like first xmm operand, not register numbers. Look at blendvps for one case where XMM0 is the only choice for one operand, not a placeholder, for the non-AVX version: https://www.felixcloutier.com/x86/blendvps. **Or read the earlier chapter of vol.2 that tells you how to read the entries.** The operand-encoding table has the details of exactly how an instruction specifies registers. [How to read the Intel Opcode notation](https://stackoverflow.com/q/15017659) has an answer quoting some of it, but the actual PDF has examples and stuff. – Peter Cordes May 29 '22 at 09:15
1 Answers
8
You are misunderstanding something, probably the placeholders in the manual. When an instruction description says xmm1 or xmm2 it usually means any xmm register, the number just indicates operand numbering.
For example, ADDPS xmm1, xmm2/m128 can add two arbitrary xmm registers or add a memory operand to an arbitrary xmm register.
Jester
- 54,538
- 4
- 72
- 115