From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5E8B6385BF81; Thu, 11 Jun 2020 08:11:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5E8B6385BF81 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1591863096; bh=duTQQa9/jWq1JsOy0rjYFDPDp6VpUEhNB3iKiGTyfqg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=YR8/UFCez0heFcNvAaIgM1SJXroU3REBVVZQsTYCe9VAcgPcv6mypL/HMkYIMLv2R lUNOrDxBe2P5DireGGepX3TdKQO7CMZivlmpfOJliFob1+4NvGxdzfZYthPJj/WF1K resfTdmmPrXSCwv36d9z0gPSVD3vs3TOOTJyce7I= From: "crazylht at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/95488] Suboptimal multiplication codegen for v16qi Date: Thu, 11 Jun 2020 08:11:36 +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: 11.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: crazylht 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, 11 Jun 2020 08:11:36 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95488 --- Comment #5 from Hongtao.liu --- Microbenchmark ---- cat test.c #include #include #include typedef char v16qi __attribute__ ((vector_size (16))); extern v16qi interleave_mul (v16qi, v16qi); extern v16qi extend_mul (v16qi, v16qi); #define LOOP 30000000 int main () { int i; unsigned long long start, end; unsigned long long diff; unsigned int aux; v16qi *p0; v16qi *p1; v16qi x, y; p0 =3D (v16qi *) malloc (LOOP * sizeof (*p0)); p1 =3D (v16qi *) malloc (LOOP * sizeof (*p1)); for (i =3D 0; i < LOOP; i++) for (int j =3D 0; j !=3D 16; j++) { p0[i][j] =3D 1 + i + j; p1[i][j] =3D 1 + i * i + j * j; } #if 1 start =3D __rdtscp (&aux); for (i =3D 0; i < LOOP; i+=3D16) y =3D interleave_mul (p0[i], p1[i]); end =3D __rdtscp (&aux); diff =3D end - start; printf ("interleave_mul : %lld\n", diff); #endif #if 1 start =3D __rdtscp (&aux); for (i =3D 0; i < LOOP; i+=3D16) x =3D extend_mul (p0[i], p1[i]); end =3D __rdtscp (&aux); diff =3D end - start; printf ("extend_mul : %lld\n", diff); #endif free (p0); free (p1); return 0; } --- show a little bit improvement: interleave_mul : 104180000 extend_mul : 103922083=