0

It seems that the mov* instructions that accept an XMM/YMM register as an operand can't accept (non XMM/YMM) full-sized values. The instructions described in the manual(incomplete?), are only able to access the lower quadword.

The question is, is there a mov that can set the high quadword of a XMM register / high octword of a YMM register? (Without accessing memory or shifting)

To clarify, I am asking for an instruction that also sets the high quadword. The mov instructions in the manual only moves from GPR to lower quadword or memory to entire register.

user69874
  • 155
  • 1
  • 10
  • 1
    There are no mov-immediate to xmm instructions. (See [this for generating constants in xmm regs](http://stackoverflow.com/questions/35085059/what-are-the-best-instruction-sequences-to-generate-vector-constants-on-the-fly), and of course [Agner Fog's guides](http://agner.org/optimize/). His Optimizing Asm guide has a nice section on ways to move data around in vector regs. Also other links e.g. to the complete Intel insn set reference guide from the [x86 tag wiki](http://stackoverflow.com/tags/x86/info) – Peter Cordes May 01 '16 at 16:29
  • There is `movlhps xmm1, xmm2` which merges the low half of the source into the high half of the dest. For ymm regs, there's `vinsertf128` to merge a 128b vector into the high or low half of an existing ymm. There are also immediate blend insns, like Please clarify what you're asking: you seem to be asking for mov-immediate, but then you're also asking a separate question about setting the high halves of vectors. (There isn't one answer that covers both :/) – Peter Cordes May 01 '16 at 16:33
  • @PeterCordes clarified the question – user69874 May 01 '16 at 16:58
  • You mean like `movq xmm1, rax` or `movq xmm1, xmm2`? That zeros the upper 64. Or `movddup xmm1, xmm2` to broadcast the low64 of xmm2 to both halves of xmm1? Read Agner Fog's guide, it's excellent, also Intel's insn set reference. The AMD doc you were reading didn't seem to be an insn set reference. Your question still isn't clear on your criteria for source operands. – Peter Cordes May 01 '16 at 17:10

0 Answers0