]> git.ipfire.org Git - thirdparty/gcc.git/commit
x86: Check each component of source operand for AVX_U128_DIRTY
authorH.J. Lu <hjl.tools@gmail.com>
Sun, 30 Jan 2022 18:08:14 +0000 (10:08 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 9 Feb 2022 12:30:13 +0000 (04:30 -0800)
commit5390a2f191682dae3c6d1e1deac20e05be413514
tree8e601cbe75954c26b809329c26b25f3d8a4d138d
parent59b31f0e2d187ebdb3d399661e22b28e4ebd8099
x86: Check each component of source operand for AVX_U128_DIRTY

commit 9775e465c1fbfc32656de77c618c61acf5bd905d
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Jul 27 07:46:04 2021 -0700

    x86: Don't set AVX_U128_DIRTY when zeroing YMM/ZMM register

called ix86_check_avx_upper_register to check mode on source operand.
But ix86_check_avx_upper_register doesn't work on source operand like

(vec_select:V2DI (reg/v:V4DI 23 xmm3 [orig:91 ymm ] [91])
    (parallel [
            (const_int 2 [0x2])
            (const_int 3 [0x3])
        ]))

Add ix86_avx_u128_mode_source to check mode for each component of source
operand.

gcc/

PR target/104441
* config/i386/i386.cc (ix86_avx_u128_mode_source): New function.
(ix86_avx_u128_mode_needed): Return AVX_U128_ANY for debug INSN.
Call ix86_avx_u128_mode_source to check mode for each component
of source operand.

gcc/testsuite/

PR target/104441
* gcc.target/i386/pr104441-1a.c: New test.
* gcc.target/i386/pr104441-1b.c: Likewise.
gcc/config/i386/i386.cc
gcc/testsuite/gcc.target/i386/pr104441-1a.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr104441-1b.c [new file with mode: 0644]