[Bug target/96861] New: Integer min/max optimization failed under -march=skylake-avx512
crazylht at gmail dot com
gcc-bugzilla@gcc.gnu.org
Mon Aug 31 09:33:45 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96861
Bug ID: 96861
Summary: Integer min/max optimization failed under
-march=skylake-avx512
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: crazylht at gmail dot com
CC: hjl.tools at gmail dot com
Target Milestone: ---
Target: i386, x86-64
cat minmax-10.c
---
#define max(a,b) (((a) > (b))) ? (a) : (b)
#define min(a,b) (((a) < (b))) ? (a) : (b)
int smax1(int x)
{
return max(x,1);
}
---
gcc -O2 -march=skylake-avx512 -S
---
smax1(int):
vmovdqa xmm1, XMMWORD PTR .LC0[rip]
vmovd xmm0, edi
vpmaxsd xmm0, xmm0, xmm1
vmovd eax, xmm0
ret
---
gcc -O2 -march=x86-64 -S
---
smax1(int):
test edi, edi
mov eax, 1
cmovg eax, edi
ret
---
It seems cost model need to be adjusted for skylake_cost.
More information about the Gcc-bugs
mailing list