From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 86050 invoked by alias); 4 Apr 2019 13:04: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 86037 invoked by uid 89); 4 Apr 2019 13:04:56 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-14.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.1 spammy=developed, examine, HX-Languages-Length:1535, half X-HELO: mail-ed1-f43.google.com Received: from mail-ed1-f43.google.com (HELO mail-ed1-f43.google.com) (209.85.208.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 04 Apr 2019 13:04:54 +0000 Received: by mail-ed1-f43.google.com with SMTP id a25so2120185edc.8 for ; Thu, 04 Apr 2019 06:04:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=T8stVjElfdQytNouDv5MsJBxPPf4oh1pfFNv4U5TuKI=; b=tAbiniq+m4uKc6xX0Or6z0sjYX9dwEOP+vfCNxA52DaKBY7MChKu2Whm4fG/Qd+D/+ 3bPvUqIIrUAc4H+a1tf3gg1htAnoAuE537eaZg503LMuiYitLPeiBPCzaeqHEgygRFoF 4ZPhVW6EFkSJwiJfQGJqdHadnU+RB9WIAVHfcZP6fR1e7A6ATkVC7j4b84EtUxwncB7h pnraPQrJ+CRTL4msoisHHAjjKtvi+jRSrxxH+sFmQqUAP7ZlqoejqRqlZNgT/QMMpPO0 UXzaVAELmfagx/IEFMTvSik22QoHzugLy7Rvy6mDbk73qgd4PIonURaALTJkHS5mL9iM fvVw== MIME-Version: 1.0 References: In-Reply-To: From: Tejas Joshi Date: Thu, 04 Apr 2019 13:04:00 -0000 Message-ID: Subject: Re: About GSOC. To: gcc@gcc.gnu.org Cc: Martin Jambor Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2019-04/txt/msg00062.txt.bz2 Hello. Here is the proposal draft for the idea. Please review and suggest changes or modifications. https://docs.google.com/document/d/15DEXa5NZL6Q_X_zlME3NNJw2zVimFWzi16x7cgIDqL0/edit?usp=sharing Thanks, -Tejas On Tue, 2 Apr 2019 at 01:23, Joseph Myers wrote: > > On Sat, 30 Mar 2019, Tejas Joshi wrote: > > > Hello. > > I have developed a fairly working patch for roundeven, attaching herewith. > > The testcase function as follows : > > > > double f() > > { > > double x = 4.5; > > double ret = __builtin_roundeven (x); > > return ret; > > } > > Tests need to be added to the testsuite, covering a range of inputs and > automatically verifying that the test is optimized correctly. > > "Round X to nearest even integer towards zero." is not correct. The > roundeven function does not round to an even integer. It rounds to the > nearest integer, whether even or odd - but, if two integers are equally > close, the result is even (and for any input that is not halfway between > two integers, it produces the same result as round (which rounds halfway > cases away from zero) - so 2.501, 3 and 3.499 round to 3, but 2.5 rounds > to 2 not 3, unlike round, and 3.5 rounds to 4, as with round). > > The function can't rely on arguments being in the range of HOST_WIDE_INT, > so it needs to examine the REAL_VALUE_TYPE representation directly to > determine whether it's half way between two integers and which way to > round in that case. > > -- > Joseph S. Myers > joseph@codesourcery.com