https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124315
Bug ID: 124315
Summary: wrong asm generated for vfnmadd231sh / vfnmadd231sd
with -masm=intel
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: zsojka at seznam dot cz
Target Milestone: ---
Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
Created attachment 63799
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=63799&action=edit
reduced testcase
Output:
$ x86_64-pc-linux-gnu-gcc -mavx512fp16 -c testcase.c
$ objdump -S testcase.o > att.S
$ x86_64-pc-linux-gnu-gcc -mavx512fp16 -c testcase.c -masm=intel
$ objdump -S testcase.o > intel.S
$ diff -u att.S intel.S
--- att.S 2026-03-02 07:54:30.144550317 +0100
+++ intel.S 2026-03-02 07:54:35.554550344 +0100
@@ -15,7 +15,7 @@
1b: 00
1c: b8 00 00 00 00 mov $0x0,%eax
21: c5 f9 92 c8 kmovb %eax,%k1
- 25: 62 f6 75 59 bd c2 vfnmadd231sh {ru-sae},%xmm2,%xmm1,%xmm0{%k1}
+ 25: 62 f6 7d 59 bd c2 vfnmadd231sh {ru-sae},%xmm2,%xmm0,%xmm0{%k1}
2b: 5d pop %rbp
2c: c3 ret
@@ -30,6 +30,6 @@
48: 00
49: b8 00 00 00 00 mov $0x0,%eax
4e: c5 f9 92 c8 kmovb %eax,%k1
- 52: 62 f2 ed 59 bb c1 vfmsub231sd {ru-sae},%xmm1,%xmm2,%xmm0{%k1}
+ 52: 62 f2 fd 59 bb c1 vfmsub231sd {ru-sae},%xmm1,%xmm0,%xmm0{%k1}
58: 5d pop %rbp
59: c3 ret
The -masm=intel output has xmm0 twice as the operand.