https://sourceware.org/bugzilla/show_bug.cgi?id=34171
Bug ID: 34171
Summary: as: invalid vpbroadcastq -> vpunpcklqdq transformation
at -Os
Product: binutils
Version: 2.47 (HEAD)
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: gas
Assignee: unassigned at sourceware dot org
Reporter: zsojka at seznam dot cz
Target Milestone: ---
Created attachment 16726
--> https://sourceware.org/bugzilla/attachment.cgi?id=16726&action=edit
C testcase
Compiling the attached C file results in a broken binary when as -Os is
specified:
$ gcc -O -mavx2 -Wa,-O2 testcase.c
$ objdump -S -Mintel ./a.out > O2.S
$ ./a.out
$ gcc -O -mavx2 -Wa,-Os testcase.c
$ objdump -S -Mintel ./a.out > Os.S
$ ./a.out
Aborted ./a.out
$ diff -u O2.S Os.S
...
@@ -101,39 +101,39 @@
40112f: c6 05 e0 2e 00 00 05 mov BYTE PTR [rip+0x2ee0],0x5
# 404016 <u+0x2>
401136: c5 f9 6e 05 d6 2e 00 vmovd xmm0,DWORD PTR [rip+0x2ed6]
# 404014 <u>
40113d: 00
- 40113e: c4 e2 7d 59 c0 vpbroadcastq ymm0,xmm0
- 401143: c5 fd eb c1 vpor ymm0,ymm0,ymm1
- 401147: c3 ret
+ 40113e: c5 f9 6c c0 vpunpcklqdq xmm0,xmm0,xmm0
+ 401142: c5 fd eb c1 vpor ymm0,ymm0,ymm1
+ 401146: c3 ret
...
As far as I can tell, "vpbroadcastq ymm0,xmm0" makes 4 copies of the lower
quadword into ymm0, while "vpunpcklqdq xmm0,xmm0,xmm0" makes only 2 copies into
xmm0.
--
You are receiving this mail because:
You are on the CC list for the bug.