Terraspace / UASM

UASM - Macro Assembler
http://www.terraspace.co.uk/uasm.html
Other
221 stars 49 forks source link

Mixing VEX and EVEX instructions in same procedure #150

Closed Leaeaxedx closed 2 years ago

Leaeaxedx commented 3 years ago

What options must be set for UASM to allow mixing VEX and EVEX instructions? With OPTION: EVEX: 1 only AVX512 instructions set is allowed (??), while AVX

vpand xmm0,xmm1,xmm2 is an error (but not AVX 512 vpandd/q xmm0,xmm1,xmm2).

This produces unnecessary size overhead.

Any help appreciated.

john-terraspace commented 3 years ago

Can you send me a small test-case example of this and I will investigate, option evex:1 shouldn’t prohibit the use of AVX/SSE instructions at all.

From: Leaeaxedx @.> Sent: Saturday, May 29, 2021 12:26 PM To: Terraspace/UASM @.> Cc: Subscribed @.***> Subject: [Terraspace/UASM] Mixing VEX and EVEX instructions in same procedure (#150)

What options must be set for UASM to allow mixing VEX and EVEX instructions? With OPTION: EVEX: 1 only AVX512 instructions set is allowed (??), while AVX

vpand xmm0,xmm1,xmm2 is an error (but not AVX 512 vpandd/q xmm0,xmm1,xmm2).

This produces unnecessary size overhead.

Any help appreciated.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Terraspace/UASM/issues/150 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AEAZAVGIZXVH7TH6A7ZCU5LTQDFLPANCNFSM45YGQQDQ .

Leaeaxedx commented 3 years ago

Dear John,

thank you for your quick reply. I put a simple sample on my Dropbox

https://www.dropbox.com/sh/9xe3i8akru8j2k7/AAA3nkegl1m2glZgPi-q5VPOa?dl=0

where VEX instruction is an error even when EVEX option is set to 1.

I also noticed that the ktestb/w/d/q k,k instruction is not recognized by Uasm.

Btw, can you tell me where to get the detailed documentation (with samples) on how to build OBJ file (I believe it is the COFF file format)?

Have a nice day,

Igor

V V ned., 30. maj 2021 ob 14:10 je oseba John Hankinson < @.***> napisala:

Can you send me a small test-case example of this and I will investigate, option evex:1 shouldn’t prohibit the use of AVX/SSE instructions at all.

From: Leaeaxedx @.> Sent: Saturday, May 29, 2021 12:26 PM To: Terraspace/UASM @.> Cc: Subscribed @.***> Subject: [Terraspace/UASM] Mixing VEX and EVEX instructions in same procedure (#150)

What options must be set for UASM to allow mixing VEX and EVEX instructions? With OPTION: EVEX: 1 only AVX512 instructions set is allowed (??), while AVX

vpand xmm0,xmm1,xmm2 is an error (but not AVX 512 vpandd/q xmm0,xmm1,xmm2).

This produces unnecessary size overhead.

Any help appreciated.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub < https://github.com/Terraspace/UASM/issues/150> , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AEAZAVGIZXVH7TH6A7ZCU5LTQDFLPANCNFSM45YGQQDQ> .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Terraspace/UASM/issues/150#issuecomment-850989943, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIKLMMHIQNZKWI4W2XG77OLTQITL3ANCNFSM45YGQQDQ .

Leaeaxedx commented 3 years ago

I forgot - You will have to edit the BAT file to set the Uasm compiler as well as the project path name.

Regards,

Igor

V V ned., 30. maj 2021 ob 14:10 je oseba John Hankinson < @.***> napisala:

Can you send me a small test-case example of this and I will investigate, option evex:1 shouldn’t prohibit the use of AVX/SSE instructions at all.

From: Leaeaxedx @.> Sent: Saturday, May 29, 2021 12:26 PM To: Terraspace/UASM @.> Cc: Subscribed @.***> Subject: [Terraspace/UASM] Mixing VEX and EVEX instructions in same procedure (#150)

What options must be set for UASM to allow mixing VEX and EVEX instructions? With OPTION: EVEX: 1 only AVX512 instructions set is allowed (??), while AVX

vpand xmm0,xmm1,xmm2 is an error (but not AVX 512 vpandd/q xmm0,xmm1,xmm2).

This produces unnecessary size overhead.

Any help appreciated.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub < https://github.com/Terraspace/UASM/issues/150> , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AEAZAVGIZXVH7TH6A7ZCU5LTQDFLPANCNFSM45YGQQDQ> .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Terraspace/UASM/issues/150#issuecomment-850989943, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIKLMMHIQNZKWI4W2XG77OLTQITL3ANCNFSM45YGQQDQ .

john-terraspace commented 3 years ago

Hi,

Ok so first issue is this:

vpand xmm1,xmm1,xmm10 ;<-- this is AVX

vpand xmm1,xmm1,xmm20 ;<-- this is not possible, as VPAND is AVX only.. you might be using a very old version of UASM?

Recall, AVX only has registers up to XMM/YMM15 , so no ZMM or XMM/YMM >= 16.

Also, vpunpckhqdq is a 3-operand instruction ,the current form generates bad output.

If you want to create an object file, ie. So you can statically link the modules together you don’t need to do anything special

Just -c -win64 (any other options) and this will produce a .OBJ file you can link.

You are correct about ktest, it’s part of AVX512-BW/DQ set and we’ve only done AVX512-F.

I’ll put these on the list to add to the code-gen.

In the meantime I quickly added KTEST(b/w/d/q) to v2.53.

From: Leaeaxedx @.> Sent: Monday, May 31, 2021 6:32 PM To: Terraspace/UASM @.> Cc: John Hankinson @.>; Comment @.> Subject: Re: [Terraspace/UASM] Mixing VEX and EVEX instructions in same procedure (#150)

Dear John,

thank you for your quick reply. I put a simple sample on my Dropbox

https://www.dropbox.com/sh/9xe3i8akru8j2k7/AAA3nkegl1m2glZgPi-q5VPOa?dl=0

where VEX instruction is an error even when EVEX option is set to 1.

I also noticed that the ktestb/w/d/q k,k instruction is not recognized by Uasm.

Btw, can you tell me where to get the detailed documentation (with samples) on how to build OBJ file (I believe it is the COFF file format)?

Have a nice day,

Igor

V V ned., 30. maj 2021 ob 14:10 je oseba John Hankinson < @.***> napisala:

Can you send me a small test-case example of this and I will investigate, option evex:1 shouldn’t prohibit the use of AVX/SSE instructions at all.

From: Leaeaxedx @.> Sent: Saturday, May 29, 2021 12:26 PM To: Terraspace/UASM @.> Cc: Subscribed @.***> Subject: [Terraspace/UASM] Mixing VEX and EVEX instructions in same procedure (#150)

What options must be set for UASM to allow mixing VEX and EVEX instructions? With OPTION: EVEX: 1 only AVX512 instructions set is allowed (??), while AVX

vpand xmm0,xmm1,xmm2 is an error (but not AVX 512 vpandd/q xmm0,xmm1,xmm2).

This produces unnecessary size overhead.

Any help appreciated.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub < https://github.com/Terraspace/UASM/issues/150> , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AEAZAVGIZXVH7TH6A7ZCU5LTQDFLPANCNFSM45YGQQDQ> .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Terraspace/UASM/issues/150#issuecomment-850989943, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIKLMMHIQNZKWI4W2XG77OLTQITL3ANCNFSM45YGQQDQ .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Terraspace/UASM/issues/150#issuecomment-851609897 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AEAZAVF3APMQU3JMDCS3VFLTQPBZ5ANCNFSM45YGQQDQ .

Leaeaxedx commented 3 years ago

Silly me. You are right, I didn't spot reg number >15 in the vpand instruction, nor only two arguments in the unpack instruction. And I use the Intel Software Developer’s Manual 1-4 on a daily basis.

Regarding OBJ file format I mean how does your code build it? Simply put - how the assembler instructions after being parsed and translated into numbers are written into the OBJ file so that linker can create the exe/dll file? And data from data segment, proc addresses, pdata, etc...

Sorry to waste your time with the false AVX instruction.

Thank you for your effort.

Have a nice day,

Igor

V V tor., 1. jun. 2021 ob 11:15 je oseba John Hankinson < @.***> napisala:

Hi,

Ok so first issue is this:

vpand xmm1,xmm1,xmm10 ;<-- this is AVX

vpand xmm1,xmm1,xmm20 ;<-- this is not possible, as VPAND is AVX only.. you might be using a very old version of UASM?

Recall, AVX only has registers up to XMM/YMM15 , so no ZMM or XMM/YMM >= 16.

Also, vpunpckhqdq is a 3-operand instruction ,the current form generates bad output.

If you want to create an object file, ie. So you can statically link the modules together you don’t need to do anything special

Just -c -win64 (any other options) and this will produce a .OBJ file you can link.

You are correct about ktest, it’s part of AVX512-BW/DQ set and we’ve only done AVX512-F.

I’ll put these on the list to add to the code-gen.

In the meantime I quickly added KTEST(b/w/d/q) to v2.53.

From: Leaeaxedx @.> Sent: Monday, May 31, 2021 6:32 PM To: Terraspace/UASM @.> Cc: John Hankinson @.>; Comment @.> Subject: Re: [Terraspace/UASM] Mixing VEX and EVEX instructions in same procedure (#150)

Dear John,

thank you for your quick reply. I put a simple sample on my Dropbox

https://www.dropbox.com/sh/9xe3i8akru8j2k7/AAA3nkegl1m2glZgPi-q5VPOa?dl=0

where VEX instruction is an error even when EVEX option is set to 1.

I also noticed that the ktestb/w/d/q k,k instruction is not recognized by Uasm.

Btw, can you tell me where to get the detailed documentation (with samples) on how to build OBJ file (I believe it is the COFF file format)?

Have a nice day,

Igor

V V ned., 30. maj 2021 ob 14:10 je oseba John Hankinson < @.***> napisala:

Can you send me a small test-case example of this and I will investigate, option evex:1 shouldn’t prohibit the use of AVX/SSE instructions at all.

From: Leaeaxedx @.> Sent: Saturday, May 29, 2021 12:26 PM To: Terraspace/UASM @.> Cc: Subscribed @.***> Subject: [Terraspace/UASM] Mixing VEX and EVEX instructions in same procedure (#150)

What options must be set for UASM to allow mixing VEX and EVEX instructions? With OPTION: EVEX: 1 only AVX512 instructions set is allowed (??), while AVX

vpand xmm0,xmm1,xmm2 is an error (but not AVX 512 vpandd/q xmm0,xmm1,xmm2).

This produces unnecessary size overhead.

Any help appreciated.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub < https://github.com/Terraspace/UASM/issues/150> , or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AEAZAVGIZXVH7TH6A7ZCU5LTQDFLPANCNFSM45YGQQDQ

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Terraspace/UASM/issues/150#issuecomment-850989943, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AIKLMMHIQNZKWI4W2XG77OLTQITL3ANCNFSM45YGQQDQ

.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/Terraspace/UASM/issues/150#issuecomment-851609897> , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AEAZAVF3APMQU3JMDCS3VFLTQPBZ5ANCNFSM45YGQQDQ> .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Terraspace/UASM/issues/150#issuecomment-851968261, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIKLMMCQ52FXMIKSQC7FRBTTQSQJ3ANCNFSM45YGQQDQ .

Leaeaxedx commented 3 years ago

Dear John,

I was busy on other projects, so I haven't been able to check out the 2,53 version. But now I can not find it on http://www.terraspace.co.uk/uasm.html .

Unfortunately, I can not build it from Git (unresolved errors).

Can the 2.53 version be added to Uasm site please?

Have a nice day,

Igor

V V tor., 1. jun. 2021 ob 21:47 je oseba Igor Fujs @.***> napisala:

Silly me. You are right, I didn't spot reg number >15 in the vpand instruction, nor only two arguments in the unpack instruction. And I use the Intel Software Developer’s Manual 1-4 on a daily basis.

Regarding OBJ file format I mean how does your code build it? Simply put - how the assembler instructions after being parsed and translated into numbers are written into the OBJ file so that linker can create the exe/dll file? And data from data segment, proc addresses, pdata, etc...

Sorry to waste your time with the false AVX instruction.

Thank you for your effort.

Have a nice day,

Igor

V V tor., 1. jun. 2021 ob 11:15 je oseba John Hankinson < @.***> napisala:

Hi,

Ok so first issue is this:

vpand xmm1,xmm1,xmm10 ;<-- this is AVX

vpand xmm1,xmm1,xmm20 ;<-- this is not possible, as VPAND is AVX only.. you might be using a very old version of UASM?

Recall, AVX only has registers up to XMM/YMM15 , so no ZMM or XMM/YMM >= 16.

Also, vpunpckhqdq is a 3-operand instruction ,the current form generates bad output.

If you want to create an object file, ie. So you can statically link the modules together you don’t need to do anything special

Just -c -win64 (any other options) and this will produce a .OBJ file you can link.

You are correct about ktest, it’s part of AVX512-BW/DQ set and we’ve only done AVX512-F.

I’ll put these on the list to add to the code-gen.

In the meantime I quickly added KTEST(b/w/d/q) to v2.53.

From: Leaeaxedx @.> Sent: Monday, May 31, 2021 6:32 PM To: Terraspace/UASM @.> Cc: John Hankinson @.>; Comment @.> Subject: Re: [Terraspace/UASM] Mixing VEX and EVEX instructions in same procedure (#150)

Dear John,

thank you for your quick reply. I put a simple sample on my Dropbox

https://www.dropbox.com/sh/9xe3i8akru8j2k7/AAA3nkegl1m2glZgPi-q5VPOa?dl=0

where VEX instruction is an error even when EVEX option is set to 1.

I also noticed that the ktestb/w/d/q k,k instruction is not recognized by Uasm.

Btw, can you tell me where to get the detailed documentation (with samples) on how to build OBJ file (I believe it is the COFF file format)?

Have a nice day,

Igor

V V ned., 30. maj 2021 ob 14:10 je oseba John Hankinson < @.***> napisala:

Can you send me a small test-case example of this and I will investigate, option evex:1 shouldn’t prohibit the use of AVX/SSE instructions at all.

From: Leaeaxedx @.> Sent: Saturday, May 29, 2021 12:26 PM To: Terraspace/UASM @.> Cc: Subscribed @.***> Subject: [Terraspace/UASM] Mixing VEX and EVEX instructions in same procedure (#150)

What options must be set for UASM to allow mixing VEX and EVEX instructions? With OPTION: EVEX: 1 only AVX512 instructions set is allowed (??), while AVX

vpand xmm0,xmm1,xmm2 is an error (but not AVX 512 vpandd/q xmm0,xmm1,xmm2).

This produces unnecessary size overhead.

Any help appreciated.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub < https://github.com/Terraspace/UASM/issues/150> , or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AEAZAVGIZXVH7TH6A7ZCU5LTQDFLPANCNFSM45YGQQDQ

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Terraspace/UASM/issues/150#issuecomment-850989943, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AIKLMMHIQNZKWI4W2XG77OLTQITL3ANCNFSM45YGQQDQ

.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/Terraspace/UASM/issues/150#issuecomment-851609897> , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AEAZAVF3APMQU3JMDCS3VFLTQPBZ5ANCNFSM45YGQQDQ> .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Terraspace/UASM/issues/150#issuecomment-851968261, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIKLMMCQ52FXMIKSQC7FRBTTQSQJ3ANCNFSM45YGQQDQ .

john-terraspace commented 2 years ago

Due to life, 2.53 never made a build. I found a number of other issues and landed up with a dodgy 2.54, I believe I've now resolved all the issues and this will be a public 2.55 release due shortly.

Leaeaxedx commented 2 years ago

Thank you for the update.

Have a nice day.

Igor

V V čet., 17. mar. 2022 ob 00:55 je oseba John Hankinson < @.***> napisala:

Due to life, 2.53 never made a build. I found a number of other issues and landed up with a dodgy 2.54, I believe I've now resolved all the issues and this will be a public 2.55 release due shortly.

— Reply to this email directly, view it on GitHub https://github.com/Terraspace/UASM/issues/150#issuecomment-1069756072, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIKLMMBAOCVFGZCGYSLNVFLVAJYGRANCNFSM45YGQQDQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>