Author Topic: vmovdqu issue  (Read 3217 times)

Biterider

  • Member
  • *****
  • Posts: 1083
  • ObjAsm Developer
    • ObjAsm
vmovdqu issue
« on: February 26, 2020, 03:39:20 AM »
Hi
I'm having some problems with the vmovdqu instruction. It seems that the memory argument is not being encoded correctly or I'm doing something wrong.
The test code is very simple:

Code: [Select]
.data
MyYmm YMMWORD 123456789012345678901234567890

.code
start proc
  vmovdqu ymm0, MyYmm
  ret
start endp

The debug output looks like:
Code: [Select]
00007FF615751000 C5 FE 6F 85 F8 1F 00 00 vmovdqu     ymm0,ymmword ptr [rbp+1FF8h] 
00007FF615751008 C3                   ret 

triggering a GPF.

Regards, Biterider

jj2007

  • Member
  • *****
  • Posts: 13957
  • Assembly is fun ;-)
    • MasmBasic
Re: vmovdqu issue
« Reply #1 on: February 26, 2020, 04:00:16 AM »
Same with 32-bit code. Where does the [?bp... creep in?

ML 14.0 assembles it as follows (but complains about bad data initialiser etc):
0040658A                ³.  C5FE:6F05 00704000      vmovdqu ymm0, [407000]

Biterider

  • Member
  • *****
  • Posts: 1083
  • ObjAsm Developer
    • ObjAsm
Re: vmovdqu issue
« Reply #2 on: February 26, 2020, 06:12:02 AM »
Hi
Playing a bit with this instruction, I've noticed that writing the ymm register back to memory is encoded correctly.


Biterider

habran

  • Member
  • *****
  • Posts: 1228
    • uasm
Re: vmovdqu issue
« Reply #3 on: February 26, 2020, 11:17:19 AM »
Hi Biterider,
good find, this is definitely a bug :thumbsup:
It works fine with a new codegen.c and it will be easy fixed in next release:
Code: [Select]
000000013FF35A3C C5 FE 6F 05 7F 5C 00 00 vmovdqu     ymm0,ymmword ptr [MyYmm (013FF3B6C3h)Thanks :biggrin:
Cod-Father

Biterider

  • Member
  • *****
  • Posts: 1083
  • ObjAsm Developer
    • ObjAsm
Re: vmovdqu issue
« Reply #4 on: February 27, 2020, 01:02:26 AM »
Hi habran
Thank you for addressing this issue. Do you have an idea when do you will get a fix?
In the meantime, I'm going to replace vmovdqu with vlddqu, which does a similar job.

Biterider

habran

  • Member
  • *****
  • Posts: 1228
    • uasm
Re: vmovdqu issue
« Reply #5 on: February 27, 2020, 11:13:12 AM »
Hi Biterider,
I don't know if John is available to upload the fix so I attached InstrTablev2.h for you
replace the one in H folder with this one and build uasm source
that will fix the problem.
Cod-Father

Biterider

  • Member
  • *****
  • Posts: 1083
  • ObjAsm Developer
    • ObjAsm
Re: vmovdqu issue
« Reply #6 on: February 28, 2020, 12:26:29 AM »
Thank you Habran!

johnsa

  • Member
  • ****
  • Posts: 893
    • Uasm
Re: vmovdqu issue
« Reply #7 on: April 17, 2020, 04:42:19 AM »
This fix is now also on 2.50 branch on Git.

Biterider

  • Member
  • *****
  • Posts: 1083
  • ObjAsm Developer
    • ObjAsm
Re: vmovdqu issue
« Reply #8 on: April 18, 2020, 03:18:31 AM »
 :thumbsup: