From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 90235 invoked by alias); 9 Oct 2017 16:58:38 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 90223 invoked by uid 89); 9 Oct 2017 16:58:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=worse, Hx-languages-length:1645, out X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Oct 2017 16:58:37 +0000 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v99Gv8am042381 for ; Mon, 9 Oct 2017 12:58:35 -0400 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0a-001b2d01.pphosted.com with ESMTP id 2dg9s8brns-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Oct 2017 12:58:35 -0400 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 9 Oct 2017 17:58:33 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 9 Oct 2017 17:58:30 +0100 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v99GwUVw25493576; Mon, 9 Oct 2017 16:58:30 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5735A52041; Mon, 9 Oct 2017 16:53:02 +0100 (BST) Received: from oc3748833570.ibm.com (unknown [9.152.213.178]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 475695203F; Mon, 9 Oct 2017 16:53:02 +0100 (BST) Received: by oc3748833570.ibm.com (Postfix, from userid 1000) id 1607ED83320; Mon, 9 Oct 2017 18:58:30 +0200 (CEST) Subject: Re: [RFC][13/19] Target FP: Perform Ada fixed-point scaling in target format To: brobecker@adacore.com (Joel Brobecker) Date: Mon, 09 Oct 2017 16:58:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org In-Reply-To: <20171009163008.5svu3sjyeubqaux7@adacore.com> from "Joel Brobecker" at Oct 09, 2017 12:30:08 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 17100916-0020-0000-0000-000003BF00A2 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17100916-0021-0000-0000-0000425200B5 Message-Id: <20171009165830.1607ED83320@oc3748833570.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-10-09_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1710090247 X-SW-Source: 2017-10/txt/msg00223.txt.bz2 Joel Brobecker wrote: > On Tue, Sep 05, 2017 at 08:21:35PM +0200, Ulrich Weigand wrote: > > * ada-lang.c (cast_to_fixed): Reimplement in target arithmetic. > > (cast_to_fixed): Likewise. > ^^^^^^^^^^^^^ > cast_from_fixed :) Fixed. > > (ada_scaling_type): New function. > > (ada_delta): Return value instead of DOUBLEST. Perform target > > arithmetic instead of host arithmetic. > > (scaling_factor): Rename to ... > > (ada_scaling_factor) ... this. Return value instead of DOUBLEST. > > Perform target arithmetic instead of host arithmetic. > > Maybe mention that we are making this function non-static too? Fixed. > We have a fixed point tests in the testsuite (gdb.ada/fixed_points.exp), > so having it run and pass after your change should be a very good sanity > check on its own. I did run the test suite including Ada tests on x86_64-linux, and this test case does still pass. > This is a C++ question, really. Does it make any difference if you > declare the std::string first, and then only set its contents in > a second statement? I can't remember the details, but it has to do > with initialization vs assignment. I _really_ hope that the string > class is sufficiently well designed that the two are really equivalent > in practice? Huh. Indeed I see worse code when doing the assignment as a separate statement, at least with GCC 4.8. I'll make sure to use initialization instead wherever possible. Thanks for pointing this out! Thanks for the review! Bye, Ulrich -- Dr. Ulrich Weigand GNU/Linux compilers and toolchain Ulrich.Weigand@de.ibm.com