From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 98417 invoked by alias); 22 Jun 2019 17:37:56 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 98409 invoked by uid 89); 22 Jun 2019 17:37:56 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-3.9 required=5.0 tests=AWL,BAYES_50 autolearn=ham version=3.3.1 spammy=nearest, ROUND_ROUNDEVEN, GEN_INT, Joshi X-HELO: nikam.ms.mff.cuni.cz Received: from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 22 Jun 2019 17:37:54 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id EA5B12825E3; Sat, 22 Jun 2019 19:37:49 +0200 (CEST) Date: Sat, 22 Jun 2019 17:37:00 -0000 From: Jan Hubicka To: Tejas Joshi Cc: gcc@gcc.gnu.org, Martin Jambor , joseph@codesourcery.com Subject: Re: Expanding roundeven (Was: Re: About GSOC.) Message-ID: <20190622173749.o3o74vkryyxt2ukb@kam.mff.cuni.cz> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) X-SW-Source: 2019-06/txt/msg00265.txt.bz2 > Hello. > I have already sent a patch for expanding roundeven for i386 with > relevant doubts. I also was regression testing with > make -k check > after successful bootstrap build with reverting my patches. Turns out > do-check fails without any patches applied, Is it ok to do anyways for > applied patch? Also, /contrib/compare_tests returns with "no common > files to compare" but I see all as the same files (actually, I am > moving *.sum files in manual directory and comparing with build of > applied patch.)? Is it due to failed make check? The usual procedure is to do make check on clean tree and use contrib/test_summary to produce summary and then do the same with patched tree and compare the outputs (by diff) Honza > > Thanks, > -Tejas > > > On Wed, 19 Jun 2019 at 19:07, Tejas Joshi wrote: > > > > Hello. > > I have made following changes to inspect inlining of roundeven with > > the following test code: > > double > > plusone (double d) > > { > > return __builtin_roundeven (d) + 1; > > } > > > > Running the program using -O2 foo.c gave internal compiler error which > > I believe is because gcc_unreachable() at: > > > > if (TARGET_SSE4_1) > > emit_insn (gen_sse4_1_round2 > > (operands[0], operands[1], GEN_INT (ROUND_ > > | ROUND_NO_EXC))); > > I think the following condition matches the criterion? : > > > I think the code will be much clearer if it explicitly says > > > ROUND_ROUNDEVEN | ROUND_NO_EXC, > > > > else if (TARGET_64BIT || (mode != DFmode)) > > { > > if (ROUND_ == ROUND_FLOOR) > > ix86_expand_floorceil (operands[0], operands[1], true); > > else if (ROUND_ == ROUND_CEIL) > > ix86_expand_floorceil (operands[0], operands[1], false); > > else if (ROUND_ == ROUND_TRUNC) > > ix86_expand_trunc (operands[0], operands[1]); > > else > > gcc_unreachable (); > > } > > in: > > (define_expand "2" > > But with -mavx, generated the vroundsd insn. Does it mean ROUNDEVEN > > should have a condition in the else if, but comments above > > ix86_expand* functions in i386-expand.c says that those are for SSE2 > > sequences? > > > > Thanks, > > --Tejas > > > > > > On Mon, 17 Jun 2019 at 22:45, Joseph Myers wrote: > > > > > > On Mon, 17 Jun 2019, Tejas Joshi wrote: > > > > > > > > existing ROUND_NO_EXC definition in GCC. A new definition will need > > > > > adding alongside ROUND_FLOOR, ROUND_CEIL and ROUND_TRUNC to correspond to > > > > > rounding to nearest with ties to even, evaluating to 0.) > > > > > > > > So (ROUND_ROUNDEVEN 0x0) be declared for rounding towards nearest > > > > even for rounding mode argument? But reference says that RC field > > > > should end up as 00B for rounding ties to even? I am also much > > > > > > I think the code will be much clearer if it explicitly says > > > ROUND_ROUNDEVEN | ROUND_NO_EXC, than if it hardcodes implicit knowledge > > > that 0 is the value used for rounding to nearest with ties to even. > > > > > > -- > > > Joseph S. Myers > > > joseph@codesourcery.com