From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2C3A43858C60; Mon, 31 Jul 2023 05:26:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2C3A43858C60 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1690781164; bh=IZ5MUsNrm7qb0kt3gZiMiZ1A/0kI9S9QWbmbvRpHAVg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=xqBAJDzI2pMyfBQqD7Y39BkD9HqOAQ1j8mI9nKhR+92BRB/CSTeyGeqExJuEOssY0 xaLI77MmoPM6AGTwWYrYBmeKMejR+Ib0DBJNDsXxrQK6W9Z6AQGa/DeUIqVR6RI6OD FaGT3X9l3PslhD7rM6VCM1sEA5jUKZCVMr4IgqMU= From: "crazylht at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/81904] FMA and addsub instructions Date: Mon, 31 Jul 2023 05:26:03 +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: 8.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: crazylht at gmail dot com X-Bugzilla-Status: NEW 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D81904 --- Comment #4 from Hongtao.liu --- (In reply to Richard Biener from comment #2) > __m128d h(__m128d x, __m128d y, __m128d z){ > __m128d tem =3D _mm_mul_pd (x,y); > __m128d tem2 =3D tem + z; > __m128d tem3 =3D tem - z; > return __builtin_shuffle (tem2, tem3, (__m128i) {0, 3}); > } >=20 > doesn't quite work (the combiner pattern for fmaddsub is missing). Tried > {0, 2} as well. >=20 > : > .LFB5021: > .cfi_startproc > vmovapd %xmm0, %xmm3 > vfmsub132pd %xmm1, %xmm2, %xmm0 > vfmadd132pd %xmm1, %xmm2, %xmm3 > vshufpd $2, %xmm0, %xmm3, %xmm0 tem2_6 =3D .FMA (x_2(D), y_3(D), z_5(D)); # DEBUG tem2 =3D> tem2_6 # DEBUG BEGIN_STMT tem3_7 =3D .FMS (x_2(D), y_3(D), z_5(D)); # DEBUG tem3 =3D> NULL # DEBUG BEGIN_STMT _8 =3D VEC_PERM_EXPR ; Can it be handled in match.pd? rewrite fmaddsub pattern into vec_merge fma = fms looks too complex. Similar for VEC_ADDSUB + MUL -> VEC_FMADDSUB.=