Discussion:
AVX 512 - Can't compile vaddps zmm1, zmm2, zmm3
(too old to reply)
Joao Schuler
2018-06-17 04:37:13 UTC
Permalink
Raw Message
Hi,
I started testing the AVX512 branch:
https://svn.freepascal.org/svn/fpc/branches/tg74/avx512/

This is the code:

{$ASMMODE intel}
asm
vaddps zmm1, zmm2, zmm3
end;

The error message is: invalid combination of opcode and operands.

The assembly code looks correct to me:
http://citeseerx.ist.psu.edu/viewdoc/download;jsessionid=22E1CA82C5506AA7E639CACEB96C72AB?doi=10.1.1.697.2949&rep=rep1&type=pdf

(look at page 19 above).

I'm I doing something very wrong? Should I submit a bug report?

Kind regards,
JP.
Florian Klämpfl
2018-06-17 08:30:50 UTC
Permalink
Raw Message
Post by Joao Schuler
Hi,
https://svn.freepascal.org/svn/fpc/branches/tg74/avx512/
{$ASMMODE intel}
asm
    vaddps  zmm1, zmm2, zmm3
end;
The error message is: invalid combination of opcode and operands.
http://citeseerx.ist.psu.edu/viewdoc/download;jsessionid=22E1CA82C5506AA7E639CACEB96C72AB?doi=10.1.1.697.2949&rep=rep1&type=pdf
(look at page 19 above).
I'm I doing something very wrong?
No, this is feature branch and work in progress. It is only useful to check out if you want to contribute to it.
Post by Joao Schuler
Should I submit a bug report?
Only if you submit a patch with it :)
_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org
http://li
Joao Schuler
2018-06-17 19:59:24 UTC
Permalink
Raw Message
I can give a try to support vaddps and other instructions I need the most
in AVX512. Where is the code (what file) for the above please?
Post by Florian Klämpfl
Post by Joao Schuler
Hi,
https://svn.freepascal.org/svn/fpc/branches/tg74/avx512/
{$ASMMODE intel}
asm
vaddps zmm1, zmm2, zmm3
end;
The error message is: invalid combination of opcode and operands.
http://citeseerx.ist.psu.edu/viewdoc/download;jsessionid=22E
1CA82C5506AA7E639CACEB96C72AB?doi=10.1.1.697.2949&rep=rep1&type=pdf
(look at page 19 above).
I'm I doing something very wrong?
No, this is feature branch and work in progress. It is only useful to
check out if you want to contribute to it.
Should I submit a bug report?
Post by Joao Schuler
Only if you submit a patch with it :)
_______________________________________________
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
J. Gareth Moreton
2018-06-17 19:26:35 UTC
Permalink
Raw Message
The file you want is compiler/x86/x86ins.dat, which contains the syntax
information for all of the x86-64 assembler commands.
A tool that's run by "make" will then generate a number of .inc files that
are then referenced by the source code.
Gareth aka. Kit

On Sun 17/06/18 20:59 , Joao Schuler ***@schulers.com sent:
I can give a try to support vaddps and other instructions I need the most
in AVX512. Where is the code (what file) for the above please?
On Sun, Jun 17, 2018 at 6:30 PM, Florian KlÀmpfl wrote:
Am 17.06.2018 um 06:37 schrieb Joao Schuler:
Hi,
I started testing the AVX512 branch:
https://svn.freepascal.org/svn/fpc/branches/tg74/avx512/ [2]

This is the code:

{$ASMMODE intel}
asm
     vaddps  zmm1, zmm2, zmm3
end;

The error message is: invalid combination of opcode and operands.

The assembly code looks correct to me:
Should I submit a bug report?

Only if you submit a patch with it :)
_______________________________________________
fpc-devel maillist  -  fpc-***@lists.freepascal.org [3]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel [4]

_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org [5]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
[6]">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel



Links:
------
[1] mailto:***@freepascal.org
[2] https://svn.freepascal.org/svn/fpc/branches/tg74/avx512/
[3] mailto:fpc-***@lists.freepascal.org
[4] http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
[5] mailto:fpc-***@lists.freepascal.org
[6] http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
Joao Schuler
2018-06-17 21:35:40 UTC
Permalink
Raw Message
Thank you Kit.

[VADDPS]
(Ch_Wop3, Ch_Rop2, Ch_Rop1)
xmmreg,xmmreg,xmmrm \362\370\1\x58\75\120
AVX,SANDYBRIDGE
ymmreg,ymmreg,ymmrm \362\364\370\1\x58\75\120
AVX,SANDYBRIDGE

In regards to the opcode, what is the base (doesn't look hexa) for these
numbers? Example:

\362\364\370\ - are these 16 bits numbers (too big for bytes)?

x58 - is this 58 hexa?

As an example,

*vaddps ymm0 ymm1 ymm3*
I was expecting:

*C5F458C3*

On Mon, Jun 18, 2018 at 5:26 AM, J. Gareth Moreton <
Post by J. Gareth Moreton
The file you want is compiler/x86/x86ins.dat, which contains the syntax
information for all of the x86-64 assembler commands.
A tool that's run by "make" will then generate a number of .inc files that
are then referenced by the source code.
Gareth aka. Kit
I can give a try to support vaddps and other instructions I need the most
in AVX512. Where is the code (what file) for the above please?
Post by Florian Klämpfl
Post by Joao Schuler
Hi,
https://svn.freepascal.org/svn/fpc/branches/tg74/avx512/
{$ASMMODE intel}
asm
vaddps zmm1, zmm2, zmm3
end;
The error message is: invalid combination of opcode and operands.
http://citeseerx.ist.psu.edu/viewdoc/download;jsessionid=22E
1CA82C5506AA7E639CACEB96C72AB?doi=10.1.1.697.2949&rep=rep1&type=pdf
(look at page 19 above).
I'm I doing something very wrong?
No, this is feature branch and work in progress. It is only useful to
check out if you want to contribute to it.
Should I submit a bug report?
Post by Joao Schuler
Only if you submit a patch with it :)
_______________________________________________
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
_______________________________________________
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel">
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
J. Gareth Moreton
2018-06-17 23:13:30 UTC
Permalink
Raw Message
The x I can't remember off-hand, but I
think is a placeholder for variable input.
You might have to experiment with viewing
the disassembly of a function such as MOV
or ADD, or look at the source code of the
utility that creates the inc files. As for
the numbers, they are octal (historical
reasons, I think mostly because there were
only 8 general-purpose registers to deal
with).

The only time I personally modified this
file was some time go to reorder the MOV
commands in an attempt to get the
assembler to use a shorter byte sequence
for small negative numbers being stored in
64-bit locations.

Gareth aka. Kit

On Sun 17/06/18 22:35 , Joao Schuler
Post by Joao Schuler
Thank you Kit.
[VADDPS](Ch_Wop3, Ch_Rop2,
Ch_Rop1)xmmreg,xmmreg,xmmrm             
Post by Joao Schuler
    3623701x5875120               
AVX,SANDYBRIDGEymmreg,ymmreg,ymmrm     
           
Post by Joao Schuler
3623643701x5875120           
AVX,SANDYBRIDGE
Post by Joao Schuler
In regards to the opcode, what is the
base (doesn't look hexa) for these
Post by Joao Schuler
362364370  - are these 16 bits numbers
(too big for bytes)?
Post by Joao Schuler
x58 - is this 58 hexa?
As an example, 
C5F458C3
On Mon, Jun 18, 2018 at 5:26 AM, J.
The file you want is
compiler/x86/x86ins.dat, which contains
the syntax
Post by Joao Schuler
information for all of the x86-64
assembler commands.
Post by Joao Schuler
A tool that's run by "make" will then
generate a number of .inc files that
Post by Joao Schuler
are then referenced by the source code.
Gareth aka. Kit
On Sun 17/06/18 20:59 , Joao Schuler
I can give a try to support vaddps and
other instructions I need the most
Post by Joao Schuler
in AVX512. Where is the code (what file)
for the above please?
Post by Joao Schuler
On Sun, Jun 17, 2018 at 6:30 PM, Florian
Am 17.06.2018 um 06:37 schrieb Joao
Hi,
https://svn.freepascal.org/svn/fpc/branche
s/tg74/avx512/ [1]
Post by Joao Schuler
{$ASMMODE intel}
asm
     vaddps  zmm1, zmm2, zmm3
end;
The error message is: invalid
combination of opcode and operands.
Post by Joao Schuler
Should I submit a bug report?
Only if you submit a patch with it :)
__________________________________________
_____
Post by Joao Schuler
fpc-devel maillist  -  fpc-
http://lists.freepascal.org/cgi-
bin/mailman/listinfo/fpc-devel [2]
__________________________________________
_____
Post by Joao Schuler
fpc-devel maillist - fpc-
http://lists.freepascal.org/cgi-
bin/mailman/listinfo/fpc-
devel">http://list
Post by Joao Schuler
s.freepascal.org/cgi-
bin/mailman/listinfo/fpc-devel[3]
Post by Joao Schuler
------
[1]
https://svn.freepascal.org/svn/fpc/branche
s/tg74/avx512/
Post by Joao Schuler
[2] http://lists.freepascal.org/cgi-
bin/mailman/listinfo/fpc-devel
Post by Joao Schuler
[3] http://lists.freepascal.org/cgi-
bin/mailman/listinfo/fpc-devel
_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mail
J. Gareth Moreton
2018-06-17 23:25:28 UTC
Permalink
Raw Message
Ah, I forgot to actually explain what the numbers are.  They encode the
machine code representation of the instruction, but it's not a direct
one-to-one correlation, as they also encode parameter counts and
formatting. I'm not sure where there's good narrative documentation on what
it all means.  Come to think of it, I'm not entirely sure if Free Pascal
knows how to handle the EVEX prefix yet.
Gareth

Loading...