0

I want to load 128bit data to ymm register.
I need 256bit data like this in ymm register.

0000000000000000-0000000000000000-08AE038400570064-0005000A1E810BB8

So I did like below;

vmovdqa ymm0, xmmword ptr[eax]

But I got build error. How can I do this?
Thank you.

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
  • 1
    Just use `xmm0` instead. – Jester Feb 24 '23 at 01:15
  • Do you mean vmovdqa xmm0, xmmword ptr[eax]? But I just want to use ymm register, I need to use data like 0000-0000-xxxx-xxxx(256bit). – HappyLuck99 Feb 24 '23 at 01:19
  • 1
    That is what you will get. Did you try it? Did you consult the instruction set reference? – Jester Feb 24 '23 at 01:25
  • I tried to find correct mov instruction, but I couldn't find correct one. I could load 64bit data to xmm register(like 0000000000000000-08AE038400570064). vmovsd xmm0, real8 ptr[ebp+8]. But I failed to use ymm registers. – HappyLuck99 Feb 24 '23 at 01:30
  • 3
    `vmovdqa xmm0, [eax]` does implicitly zero-extend into YMM0, unlike `movdqa xmm0, [eax]`. Note the `DEST[MAXVL-1:128] := 0` in the pseudo-code for that form: https://www.felixcloutier.com/x86/movdqa:vmovdqa32:vmovdqa64#vmovdqa--vex-128-encoded-version- The next section with `DEST[MAXVL-1:128] (Unmodified)` is incorrectly labeled "VMOVDQA legacy SSE version", the legacy SSE form doesn't have a V in the mnemonic. Also related: [Why do SSE instructions preserve the upper 128-bit of the YMM registers?](https://stackoverflow.com/q/41819514) – Peter Cordes Feb 24 '23 at 01:43
  • You do know `xmm0` is the same register as `ymm0`, right? – Jester Feb 24 '23 at 01:43
  • @Jester, xmm is 128bit register, ymm is 256bit register, right? – HappyLuck99 Feb 24 '23 at 01:46
  • 2
    xmm is the low 128 bits of the corresponding ymm. It's the same register. – Jester Feb 24 '23 at 01:47
  • 1
    @Jester, Thank you for your kind explains, I am now clear about xmm and ymm – HappyLuck99 Feb 24 '23 at 01:50

1 Answers1

1

I did resolve like this;

vmovdqa xmm0, xmmword ptr[eax]

So if I debug, I could see xmm,ymm registers like this.

XMM0 = 0457FCEF00EAFC74-62CC03110038001E
... ...
YMM0 = 0000000000000000-0000000000000000-0457FCEF00EAFC74-62CC03110038001E

So, this is that I want. Thanks for your helps.