Vmovdqa not working in virtualbox?

I am using the latest i7 cpu model that supports avx and avx2, and presumably the virtual box supports avx and avx2, so if so, then why does this code freeze?

vmovdqa    ymm0, qqword[testmem]

testmem is defined elsewhere as

align 32
testmem:   rb   128

If i use

movdqa    xmm0, dqword[testmem]

It works great.

FASM 1.72, windows 10, i7-7700hq, virtualbox 5.2.6

EDIT: This is a UEFI application (obviously running in 64 bit mode) that works great except when the above instruction is displayed.

EDIT

Tried to add

  mov     rcx, 0
  xgetbv
  or      rax, 0007h
  xsetbv  

At the beginning of the code, but did not help.

+4
source share
1 answer

Well found the answer. I know this is a rather esoteric question, but just in case, it helps someone else in how to enable AVX

mov rax, cr4
or eax, 0x40000              ; bit 18 for oxsave bit
mov cr4, rax

xor     rcx, rcx
xgetbv
or      rax, 6
xsetbv    

, , 18 CR4, OSXSAVE, AVX.

+4

Source: https://habr.com/ru/post/1693172/


All Articles