Author Topic: A bug in NASM 2.15  (Read 6036 times)

Offline fullofbugs

  • Jr. Member
  • *
  • Posts: 9
A bug in NASM 2.15
« on: February 11, 2021, 02:15:22 PM »
I just updated to NASM 2.15 and am still fighting with the changes. I found a bug and want to share it with you before it is fixed. I already submitted a bug report.

Code: [Select]
%macro Convert  2-3.nolist   
  %[%3]CVTDQ2PD %1, %2
%endmacro

NASM will no generate any code if the last parameter is empty.

Code: [Select]
Convert XMM0, XMM1    Expected code: CVTDQ2PD XMM0, XMM1
    Generated code: empty

Code: [Select]
Convert XMM0, XMM1, {}    Expected code: CVTDQ2PD XMM0, XMM1
    Generated code: empty

Code: [Select]
Convert XMM0, XMM1, V    Expected code: VCVTDQ2PD XMM0, XMM1
    Generated code: VCVTDQ2PD XMM0, XMM1

Offline fullofbugs

  • Jr. Member
  • *
  • Posts: 9
Re: A bug in NASM 2.15
« Reply #1 on: February 11, 2021, 02:49:54 PM »
In most cases, it can be fixed by removing []
Code: [Select]
%macro Convert  2-3.nolist   
  %3CVTDQ2PD %1, %2
%endmacro

But it is quite confusing to read.