vpbroadcastb from HJWasm causes "illegal instruction" [HJWasm/VirtualBox]

Started by dawnraider, January 25, 2016, 08:31:22 PM

Previous topic - Next topic

dawnraider

Hi,

I am having trouble with AVX2 instructions generated by HJWasm. The following code appears to assemble and execute fine:


00000000                        temp proc
00000000  C4E27918CA            vbroadcastss xmm1, xmm2
00000005                        temp endp


However, the following code causes an "illegal instruction" exception:


00000000                        temp proc
00000000  62F27D0878CA          vpbroadcastb xmm1, xmm2
00000006                        temp endp


Intel's Software Development Manual defines the two instructions as:


VEX.128.66.0F38.W0 18 /r        RM V/V AVX2
VBROADCASTSS xmm1, xmm2

VEX.128.66.0F38.W0 78 /r        RM V/V AVX2
VPBROADCASTB xmm1, xmm2/m8


The encoding for vpbroadcastb appears to be one byte too long. Can anybody confirm if both of the above generated encodings match Intel's definitions?

The execution environment is Windows 7 Ultimate SP1 inside a VirtualBox virtual machine. Specifically, v5.0.0.r101573 on Ubuntu 15.04 which has AVX/AVX2 enabled (see https://www.virtualbox.org/wiki/Changelog). Underlying CPU is Skylake.
Inside the virtual machine, CPUID reports:


CPUID[EAX=01h].ECX  == 018000000h (OSXSAVE and AVX enabled)
CPUID[EAX=07h].EBX  == 000000020h (AVX2 enabled)
XGETBV[ECX=00h].EAX == 000000006h (XMM and YMM state enabled)


Has anybody else checked running AVX2 instructions generated by HJWasm? Either on a real machine or inside a VirtualBox VM?

Thanks in advance.

habran

Hi dawnraider :biggrin:

You are doing a great yob :t
Can you please write the source to include all AVX2 instructions so that we can test at ones all of them
I have Intel AVX2 manual, however it takes time to write a source with all the instructions included

Cod-Father

dawnraider

Ok,

Problem solved. This was a problem with HJWasm, not with VIrtualBox.

After receiving an update to the assembler everything appears to be executing fine within the virtual machine.

Cheers.