Discussion:
BMI2 instructions implemented
Add Reply
J. Gareth Moreton
2018-10-07 00:08:57 UTC
Reply
Permalink
Hi everyone,
Sorry I've been away for a while - hope my infectious enthusiasm has still
been contagious!

Anyhow, I've finally managed to implement the BMI2 instructions for i386
and x86-64 over at https://bugs.freepascal.org/view.php?id=33549.  I'm not
certain if everything is truly correct since my CPU doesn't actually
support the instructions.  I did, however, compare the disassembly of a
program written in Visual C++ with that of Free Pascal with the new
instructions, and confirmed that they produced the same machine code.  The
disassembler in Lazarus also now supports these instructions, so that acts
as a second source of comparison too.

Gareth aka. Kit
Florian Klämpfl
2018-10-07 10:12:13 UTC
Reply
Permalink
Post by J. Gareth Moreton
Hi everyone,
Sorry I've been away for a while - hope my infectious enthusiasm has still been contagious!
Anyhow, I've finally managed to implement the BMI2 instructions for i386 and x86-64 over at
https://bugs.freepascal.org/view.php?id=33549.  I'm not certain if everything is truly correct since my CPU doesn't
actually support the instructions.  I did, however, compare the disassembly of a program written in Visual C++ with that
of Free Pascal with the new instructions, and confirmed that they produced the same machine code.  The disassembler in
Lazarus also now supports these instructions, so that acts as a second source of comparison too.
Thanks, applied (with some fixes though, operand order in x86ins.dat is Intel assembler style, except for the operands
in the change information though).
_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/li
J. Gareth Moreton
2018-10-08 21:03:50 UTC
Reply
Permalink
Hi Florian,
Sorry for not quite seeing where my mistake was or what was changed. 
Admittedly the operator order does always catch me out and I'm not certain
of the ordering when there are 3 operands.  Can you enlighten me so I
don't mess up in future?
Gareth aka. Kit
P.S. I thought I got it right when comparing the disassembly to other
sources.
Post by J. Gareth Moreton
Hi everyone,
Sorry I've been away for a while - hope my infectious enthusiasm has
still been contagious!
Post by J. Gareth Moreton
Anyhow, I've finally managed to implement the BMI2 instructions for i386
and x86-64 over at
Post by J. Gareth Moreton
https://bugs.freepascal.org/view.php?id=33549.  [1] I'm not certain if
everything is truly correct since my CPU doesn't
Post by J. Gareth Moreton
actually support the instructions.  I did, however, compare the
disassembly of a program written in Visual C++ with that
Post by J. Gareth Moreton
of Free Pascal with the new instructions, and confirmed that they
produced the same machine code.  The disassembler in
Post by J. Gareth Moreton
Lazarus also now supports these instructions, so that acts as a second
source of comparison too.

Thanks, applied (with some fixes though, operand order in x86ins.dat is
Intel assembler style, except for the operands
in the change information though).
_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org [2]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
[3]">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel



Links:

Loading...