Recent

Author Topic: [SOLVED] Unrecognized Opcodes  (Read 5405 times)

MathMan

  • Full Member
  • ***
  • Posts: 164
[SOLVED] Unrecognized Opcodes
« on: July 31, 2014, 10:08:32 am »
Hi all,

I am using Lazarus 1.2.4 with FPC 2.6.4 under Windows 7/64bit on a Core i5 430M @2,27GHz.

There are the very nifty ADCX / ADOX opcodes which the internal assmbler does not seem to know.

Code: [Select]
  @Loop1:

    align   4
    mov     RAX, qword ptr [RSI+8*RDX];   // Get next limb
    adcx    RAX, qword ptr [RBX+8*RDX];   // Add and only affect CF
    mov     qword ptr [RDI+8*RDX], RAX;   // Store the result

The above throws

Code: [Select]
main.pas(480,5) Error: Unrecognized opcode ADCX

Is anybody around here who can comment on the following

* is it planned to integrate ADCX / ADOX opcode support to the internal assembler
* as I am aware that potentially nobody beside me wants to use these opcodes how are the chances if I raise a corresponding feature request for FPC

Thanks in advance
« Last Edit: July 31, 2014, 10:30:13 am by MathMan »

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Unrecognized Opcodes
« Reply #1 on: July 31, 2014, 10:12:02 am »
Regarding the seoncd issue: if these are valid opcodes, IMO there is no reason NOT to raise the bugtracker issue.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

MathMan

  • Full Member
  • ***
  • Posts: 164
Re: Unrecognized Opcodes
« Reply #2 on: July 31, 2014, 10:17:30 am »
Regarding the seoncd issue: if these are valid opcodes, IMO there is no reason NOT to raise the bugtracker issue.

All I can say is that they are documented in 64-ia-32-architectures-software-developer-manual-325462 and belong to the category general purpose instructions ...

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Unrecognized Opcodes
« Reply #3 on: July 31, 2014, 10:26:13 am »
Don't post here, post on the bugtracker ;) <smiles> (& thanks!)
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

engkin

  • Hero Member
  • *****
  • Posts: 2513
Re: [SOLVED] Unrecognized Opcodes
« Reply #4 on: July 31, 2014, 11:10:19 pm »
For limited usage of these missing opcodes, you might be able to do your tests with something like:
Code: [Select]
     //adcx    RAX, [RBX+8*RDX];   // Add and only affect CF
     db 066H db 048H db 00FH db 038H db 0F6H db 004H db 0D3H
I used Flat Assembler to get these numbers.

If you do write a bug report, please post a link to it here.

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7350
Re: [SOLVED] Unrecognized Opcodes
« Reply #5 on: August 01, 2014, 11:56:19 am »
Stock Lazarus is 32-bit, are you sure you installed the 64-bit crosscompiler and selected it a 64-bit target, since that is 64-bit assembler?

The FASM hex looks strange, using the db66 escape prefix, which means that that instruction is not in native 64-bit mdoe?

engkin

  • Hero Member
  • *****
  • Posts: 2513
Re: [SOLVED] Unrecognized Opcodes
« Reply #6 on: August 01, 2014, 02:29:46 pm »
The same instruction 32bit:
Code: [Select]
  //adcx    EAX, [EBX+8*EDX]
  db 066h db 00Fh db 038h db 0F6h db 004h db 0D3

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7350
Re: [SOLVED] Unrecognized Opcodes
« Reply #7 on: August 01, 2014, 02:35:34 pm »
Hmm, if I google a bit, seems that these are Broadwell instructions. These chips are only sampling at the moment, so this is very bleeding edge.

Seems trunk hasn't got them yet either.