From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EF8C2384641C; Wed, 8 May 2024 14:44:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EF8C2384641C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1715179472; bh=u4158g8/fMxkXA2548f0An0t1auVYFxREkp5Zwch9hU=; h=From:To:Subject:Date:From; b=PTsjT5SOkh90DIM+JKELnsOYd/QctHHDvK02OBs7TcyzUkP5sVsyB2UDGE/hyStIm BMhEc//h2nQAS/ziAY26sxILBZA0r+DguygBn6Ca6s6AXtcMvoJq3tfaq9zKC4ZB1a EiHxhL3Ep8qJNaJhjjkKFh9ueZ454pKH9YP/J2rM= From: "colin.king at intel dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/114987] New: floating point vector regression, x86, between gcc 14 and gcc-13 using -O3 and target clones on skylake platforms Date: Wed, 08 May 2024 14:44:31 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: colin.king at intel dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114987 Bug ID: 114987 Summary: floating point vector regression, x86, between gcc 14 and gcc-13 using -O3 and target clones on skylake platforms Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: colin.king at intel dot com Target Milestone: --- Created attachment 58126 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D58126&action=3Dedit reproducer.c source code I'm seeing a ~10% performance regression in gcc-14 compared to gcc-13, using gcc on Ubuntu 24.04: Versions: gcc version 13.2.0 (Ubuntu 13.2.0-23ubuntu4)=20 gcc version 14.0.1 20240412 (experimental) [master r14-9935-g67e1433a94f] (Ubuntu 14-20240412-0ubuntu1)=20 king@skylake:~$ CFLAGS=3D"" gcc-13 reproducer.c; ./a.out=20=20 4.92 secs duration, 2130.379 Mfp-ops/sec cking@skylake:~$ CFLAGS=3D"" gcc-14 reproducer.c; ./a.out=20=20 5.46 secs duration, 1921.799 Mfp-ops/sec The original issue appeared when regression testing stress-ng vecfp stressor [1] using the floating point vector 16 add stressor method. I've managed to extract the attached reproducer (reproducer.c) from the original code. Salient points to focus on: 1. The issue is dependant on the OPTIMIZE3 macro in the reproducer being __attribute__((optimize("-O3"))) 2. The issue is also dependant on the TARGET_CLONES macro being defined as __attribute__((target_clones("mmx,avx,default"))) - the avx target clones seems to be an issue in reproducing this problem. Attached are the reproducer.c C source and disassembled object code. The stress_vecfp_float_add_16.avx from gcc-13 is significantly different from t= he gcc-14 code. References: [1] https://github.com/ColinIanKing/stress-ng/blob/master/stress-vecfp.c=