From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 85E833858402; Thu, 16 Dec 2021 18:49:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 85E833858402 From: "ubizjak at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/103571] ABI: V2HF, V4HF and V8HFmode argument passing issues Date: Thu, 16 Dec 2021 18:49:38 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: ABI X-Bugzilla-Severity: normal X-Bugzilla-Who: ubizjak at gmail 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: Message-ID: In-Reply-To: References: 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Dec 2021 18:49:38 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103571 --- Comment #27 from Uro=C5=A1 Bizjak --- (In reply to Hongtao.liu from comment #17) > (In reply to Hongtao.liu from comment #16) > > There're already testcases for vec_extract/vec_set/vec_duplicate, but t= hose > > testcases are written under TARGET_AVX512FP16, i'll make a copy of them= and > > test them w/o avx512fp16. >=20 > Also we can relax condition of extendv*hfv*sf and truncv*sfv*hf to > avx512vl/f16c so that vect-float16-1.c could be vectorized. >=20 > vect-float16-1.c >=20 > void > foo (_Float16 *__restrict__ a, _Float16 *__restrict__ b, > _Float16 *__restrict__ c) > { > for (int i =3D 0; i < 256; i++) > a[i] =3D b[i] + c[i]; > } This was recently fixed, for -O2 -ftree-vectorize -mfp16c I get: vpxor %xmm2, %xmm2, %xmm2 vpinsrw $0, (%rsi,%rax), %xmm2, %xmm0 vpinsrw $0, (%rdx,%rax), %xmm2, %xmm1 vcvtph2ps %xmm0, %xmm0 vcvtph2ps %xmm1, %xmm1 vaddss %xmm1, %xmm0, %xmm0 vinsertps $0xe, %xmm0, %xmm0, %xmm0 vcvtps2ph $4, %xmm0, %xmm0 vpextrw $0, %xmm0, (%rdi,%rax) addq $2, %rax cmpq $512, %rax jne .L2 ret While it would be nice to partially vectorize with vcvtph2ps/vcvtps2ph, the compiler doesn't reach that far.=