Bug 114189 - Target implements obsolete vcond{,u,eq} expanders
Summary: Target implements obsolete vcond{,u,eq} expanders
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 14.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: internal-improvement
Depends on: 115490 115519 115659 115683 115517
Blocks:
  Show dependency treegraph
 
Reported: 2024-03-01 10:16 UTC by Richard Biener
Modified: 2024-06-27 13:15 UTC (History)
2 users (show)

See Also:
Host:
Target: x86_64-*-*, i?86-*-*, sparc, s390, powerpc, mips, loongarch, ia64, gcn, arm, aarch64,
Build:
Known to work:
Known to fail:
Last reconfirmed: 2024-06-17 00:00:00


Attachments
patch to remove use of the legacy optabs (950 bytes, patch)
2024-06-14 10:24 UTC, Richard Biener
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Biener 2024-03-01 10:16:05 UTC
The listed targets implement any of vcond, vcondu or vcondeq expanders where
the modern way of exposing vector conditional instructions is using
mask generating vec_cmp{,u,eq} and vcond_mask expanders.

vcond, vcondu and vcondeq optabs will be retired in the future.
Comment 1 Richard Biener 2024-03-01 10:23:55 UTC
The following shows them all:

grep 'vcond[<eu]' gcc/config/*/*.md

ia64 and sparc are the only targets that do not implement any vec_cmp{,u,eq}
pattern.

mips, sparc and ia64 do not implement any vcond_mask pattern.
Comment 2 Richard Biener 2024-06-14 10:24:45 UTC
Created attachment 58426 [details]
patch to remove use of the legacy optabs
Comment 4 Richard Biener 2024-06-17 05:48:11 UTC
aarch64 reports just

FAIL: gcc.target/aarch64/if-compare_2.c check-function-bodies bar1
FAIL: gcc.target/aarch64/if-compare_2.c check-function-bodies bar2
Comment 5 Andrew Pinski 2024-06-17 15:48:52 UTC
.
Comment 6 GCC Commits 2024-06-26 03:13:25 UTC
The master branch has been updated by hongtao Liu <liuhongt@gcc.gnu.org>:

https://gcc.gnu.org/g:aac00d09859cc5934bd0f7493d537b8430337773

commit r15-1638-gaac00d09859cc5934bd0f7493d537b8430337773
Author: liuhongt <hongtao.liu@intel.com>
Date:   Thu Jun 20 12:41:13 2024 +0800

    Optimize a < 0 ? -1 : 0 to (signed)a >> 31.
    
    Try to optimize x < 0 ? -1 : 0 into (signed) x >> 31
    and x < 0 ? 1 : 0 into (unsigned) x >> 31.
    
    Move the optimization did in ix86_expand_int_vcond to match.pd
    
    gcc/ChangeLog:
    
            PR target/114189
            * match.pd: Simplify a < 0 ? -1 : 0 to (signed) >> 31 and a <
            0 ? 1 : 0 to (unsigned) a >> 31 for vector integer type.
    
    gcc/testsuite/ChangeLog:
    
            * gcc.target/i386/avx2-pr115517.c: New test.
            * gcc.target/i386/avx512-pr115517.c: New test.
            * g++.target/i386/avx2-pr115517.C: New test.
            * g++.target/i386/avx512-pr115517.C: New test.
            * g++.dg/tree-ssa/pr88152-1.C: Adjust testcase.