From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 58654 invoked by alias); 1 May 2015 13:12:02 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 58643 invoked by uid 89); 1 May 2015 13:12:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 X-HELO: eu-smtp-delivery-143.mimecast.com Received: from eu-smtp-delivery-143.mimecast.com (HELO eu-smtp-delivery-143.mimecast.com) (146.101.78.143) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 01 May 2015 13:12:00 +0000 Received: from cam-owa2.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by uk-mta-13.uk.mimecast.lan; Fri, 01 May 2015 14:11:56 +0100 Received: from e103246vm ([10.1.2.79]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 1 May 2015 14:11:56 +0100 From: "Wilco Dijkstra" To: "Kyrylo Tkachov" Cc: "GCC Patches" References: <000401d080f0$16a78c90$43f6a5b0$@com> <000001d08401$abe1a570$03a4f050$@com> In-Reply-To: Subject: RE: [PATCH][AArch64] Make aarch64_min_divisions_for_recip_mul configurable Date: Fri, 01 May 2015 13:12:00 -0000 Message-ID: <000501d08410$63f46a90$2bdd3fb0$@com> MIME-Version: 1.0 X-MC-Unique: KSiBoUXXTWK4CO9B80dB1A-1 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0006_01D08418.C5B8D290" X-SW-Source: 2015-05/txt/msg00046.txt.bz2 This is a multi-part message in MIME format. ------=_NextPart_000_0006_01D08418.C5B8D290 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-length: 1437 > Marcus Shawcroft wrote: > On 1 May 2015 at 12:26, Wilco Dijkstra wrote: > > > > > >> Marcus Shawcroft wrote: > >> On 27 April 2015 at 14:43, Wilco Dijkstra wrote: > >> > >> >> static unsigned int > >> >> -aarch64_min_divisions_for_recip_mul (enum machine_mode mode ATTRIB= UTE_UNUSED) > >> >> +aarch64_min_divisions_for_recip_mul (enum machine_mode mode) > >> >> { > >> >> - return 2; > >> >> + if (GET_MODE_UNIT_SIZE (mode) =3D=3D 4) > >> >> + return aarch64_tune_params->min_div_recip_mul_sf; > >> >> + return aarch64_tune_params->min_div_recip_mul_df; > >> > >> This should be expressed directly as mode =3D=3D SFmode (or DFmode) ra= ther > >> than the indirect approach of first computing the size first. > > > > Can we never see vector types at this point? >=20 > Fair point, curiously we don't appear to see them, but I see no reason > why we should not. Commit your patch as proposed. >=20 > Cheers /Marcus And this one please. Wilco 2015-05-01 Wilco Dijkstra * gcc/config/aarch64/aarch64-protos.h (tune_params): Add min_div_recip_mul_sf and min_div_recip_mul_df fields. * gcc/config/aarch64/aarch64.c (aarch64_min_divisions_for_recip_mul): Return value depending on target. (generic_tunings): Initialize new target settings. (cortexa53_tunings): Likewise. (cortexa57_tunings): Likewise. (thunderx_tunings): Likewise. (xgene1_tunings): Likewise. ------=_NextPart_000_0006_01D08418.C5B8D290 Content-Type: text/plain; name=0001-Make-aarch64_min_divisions_for_recip_mul-configurabl.txt Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0001-Make-aarch64_min_divisions_for_recip_mul-configurabl.txt" Content-length: 3041 --- gcc/config/aarch64/aarch64-protos.h | 2 ++ gcc/config/aarch64/aarch64.c | 26 +++++++++++++++++++------- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/gcc/config/aarch64/aarch64-protos.h b/gcc/config/aarch64/aarch= 64-protos.h index 59c5824..4331e5c 100644 --- a/gcc/config/aarch64/aarch64-protos.h +++ b/gcc/config/aarch64/aarch64-protos.h @@ -177,6 +177,8 @@ struct tune_params const int int_reassoc_width; const int fp_reassoc_width; const int vec_reassoc_width; + const int min_div_recip_mul_sf; + const int min_div_recip_mul_df; }; =20 HOST_WIDE_INT aarch64_initial_elimination_offset (unsigned, unsigned); diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index e22d72e..42a96f6 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -353,7 +353,9 @@ static const struct tune_params generic_tunings =3D 4, /* loop_align. */ 2, /* int_reassoc_width. */ 4, /* fp_reassoc_width. */ - 1 /* vec_reassoc_width. */ + 1, /* vec_reassoc_width. */ + 2, /* min_div_recip_mul_sf. */ + 2 /* min_div_recip_mul_df. */ }; =20 static const struct tune_params cortexa53_tunings =3D @@ -371,7 +373,9 @@ static const struct tune_params cortexa53_tunings =3D 4, /* loop_align. */ 2, /* int_reassoc_width. */ 4, /* fp_reassoc_width. */ - 1 /* vec_reassoc_width. */ + 1, /* vec_reassoc_width. */ + 2, /* min_div_recip_mul_sf. */ + 2 /* min_div_recip_mul_df. */ }; =20 static const struct tune_params cortexa57_tunings =3D @@ -389,7 +393,9 @@ static const struct tune_params cortexa57_tunings =3D 4, /* loop_align. */ 2, /* int_reassoc_width. */ 4, /* fp_reassoc_width. */ - 1 /* vec_reassoc_width. */ + 1, /* vec_reassoc_width. */ + 2, /* min_div_recip_mul_sf. */ + 2 /* min_div_recip_mul_df. */ }; =20 static const struct tune_params thunderx_tunings =3D @@ -406,7 +412,9 @@ static const struct tune_params thunderx_tunings =3D 8, /* loop_align. */ 2, /* int_reassoc_width. */ 4, /* fp_reassoc_width. */ - 1 /* vec_reassoc_width. */ + 1, /* vec_reassoc_width. */ + 2, /* min_div_recip_mul_sf. */ + 2 /* min_div_recip_mul_df. */ }; =20 static const struct tune_params xgene1_tunings =3D @@ -423,7 +431,9 @@ static const struct tune_params xgene1_tunings =3D 16, /* loop_align. */ 2, /* int_reassoc_width. */ 4, /* fp_reassoc_width. */ - 1 /* vec_reassoc_width. */ + 1, /* vec_reassoc_width. */ + 2, /* min_div_recip_mul_sf. */ + 2 /* min_div_recip_mul_df. */ }; =20 /* A processor implementing AArch64. */ @@ -512,9 +522,11 @@ static const char * const aarch64_condition_codes[] =3D }; =20 static unsigned int -aarch64_min_divisions_for_recip_mul (enum machine_mode mode ATTRIBUTE_UNUS= ED) +aarch64_min_divisions_for_recip_mul (enum machine_mode mode) { - return 2; + if (GET_MODE_UNIT_SIZE (mode) =3D=3D 4) + return aarch64_tune_params->min_div_recip_mul_sf; + return aarch64_tune_params->min_div_recip_mul_df; } =20 static int --=20 1.9.1 ------=_NextPart_000_0006_01D08418.C5B8D290--