From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DA3883858C5F; Wed, 17 May 2023 23:20:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DA3883858C5F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684365640; bh=ZruBkEiGa5mgYcJPM289aovm6oEioWt9d+qC/Dz/Bgo=; h=From:To:Subject:Date:From; b=Dw4ZpXBhzYqVMo42XP9R1W9iX/z0TBamc2bi+DLfHrVnBPN0eUVh3YIgZTeLOQ1rz kA5SvGtBcN/Q8WvHitpMCkjLnwSF7aNE5g0WIv5VRzc+nc5SAnTn1r9pHwgB6fjB2H WOZb+aRVFlCFvPEkdFY0mO6bJ1rDzx39xayxzj9k= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/109900] New: _mm256_abs_epi8 is not expanded on gimple level Date: Wed, 17 May 2023 23:20:40 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: pinskia at gcc dot gnu.org 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 keywords bug_severity priority component assigned_to reporter target_milestone cf_gcctarget 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=3D109900 Bug ID: 109900 Summary: _mm256_abs_epi8 is not expanded on gimple level Product: gcc Version: 14.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: enhancement Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: pinskia at gcc dot gnu.org Target Milestone: --- Target: x86_64-linux-gnu Take (at -O3 -march=3Dx86-64-v3): ``` #include __m256i should_be_cmpeq_abs0 () { return _mm256_set1_epi8 (1); } __m256i should_be_cmpeq_abs1 () { return _mm256_abs_epi8(_mm256_set1_epi8 (-1)); } ``` I would have expected these two produce the same code generation. In the end, we still have a builtin function in the IR rather than ABS_EXPR. The RTL level uses abs. In fact combine tries to combine the two instructions: Trying 5 -> 6: 5: r85:V32QI=3Dconst_vector 6: r84:V32QI=3Dabs(r85:V32QI) REG_DEAD r85:V32QI REG_EQUAL const_vector Failed to match this instruction: (set (reg:V32QI 84) (const_vector:V32QI [ (const_int 1 [0x1]) repeated x32 ]))=