Author Topic: UASM32: VMOVD with EVEX disabled?  (Read 401 times)

HSE

  • Member
  • *****
  • Posts: 1148
  • <AMD>< 7-32>
UASM32: VMOVD with EVEX disabled?
« on: June 25, 2019, 11:33:33 PM »
Hi habran and jhonsa!

Using OPTION EVEX:0 still macro LOADSS result in:
Code: [Select]
CPU Disasm
Address   Hex dump          Command                                  Comments
013C132B  |.  A1 AC313C01   MOV EAX,DWORD PTR DS:[13C31AC]
013C1330  |.  C5F9:6EC8     VMOVD XMM1,EAX
013C1334  |.  A1 B0313C01   MOV EAX,DWORD PTR DS:[13C31B0]
013C1339  |.  C5F9:6EC0     VMOVD XMM0,EAX

Regards, HSE

habran

  • Member
  • *****
  • Posts: 1210
    • uasm
Re: UASM32: VMOVD with EVEX disabled?
« Reply #1 on: June 26, 2019, 10:08:51 AM »
Hi HSE,
this is from UASM Extended Manual:
Quote
2.13) OPTION ARCH:{SSE|AVX}
This setting determines which instruction set should be used for any automatically generated code.
This includes prologue, epilogue, invoke as well as the built-in macro library.
For example the LOADSS built-in macro would be coded under SSE as :
mov eax,floatLiteral
movd xmmReg,eax
But under AVX it would use vmovd instead.
This setting is also available through command line switches –archSSE and –archAVX.
The default setting is to use the SSE instruction set.
The currently selected architected is also available through the built-in variable @Arch.
Cod-Father

johnsa

  • Member
  • ****
  • Posts: 791
    • Uasm
Re: UASM32: VMOVD with EVEX disabled?
« Reply #2 on: June 26, 2019, 06:03:47 PM »
If you're not specifying arch AVX, it should be using MOVD by default. That would be a bug in this case, please confirm.

johnsa

  • Member
  • ****
  • Posts: 791
    • Uasm
Re: UASM32: VMOVD with EVEX disabled?
« Reply #3 on: June 26, 2019, 06:28:29 PM »
Just confirmed using AW's test piece, with option ARCH:SSE the correct MOVD is produced. ARCH:AVX is the default so without that option set you will use vmovd/q.