Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2018-10

BMI2 instructions implemented

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

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.

Gareth aka. Kit

Reply by email

Florian Klämpfl
to J. Gareth Moreton
J. Gareth Moreton wrote 9 lines
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).

Reply by email

J. Gareth Moreton

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.

On Sun 07/10/18 11:12 , Florian Klämpfl sent:

J. Gareth Moreton wrote
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

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).

Reply by email

Florian Klämpfl
to J. Gareth Moreton
J. Gareth Moreton wrote
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.

It is a a mess to be honest.

Can you enlighten me so I don't mess up in future?

Well, the operands follow AT&T style, the change info follows however intel couting.

Reply by email