From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id E94B33858D37 for ; Wed, 30 Nov 2022 16:18:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E94B33858D37 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=us.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=us.ibm.com Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2AUFlnZu011262; Wed, 30 Nov 2022 16:18:24 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : from : to : cc : date : in-reply-to : references : content-type : content-transfer-encoding : mime-version : subject; s=pp1; bh=DldV11/ya8cwGwGO+ez7/QCNbu94Yt7xZNS6BkFpdo8=; b=nsQeWGztwyodPW6+rh+ynJRCtgB4pbwrW4n39XinGrXRmwKdNWivCKzOWCqqGjHCqTH0 u941wYbRFgB+PbhzyQFLbRL3QJGFJ4ul7QmqBWiZpBZ9gvQ1Fqw+6NjuJjPd1e6y0VnS TUaLVs1i3782KiSE7HX5bSn3WACjrY/5qRBajTUpt2yPtqL6AvxSHp0Y4piiMke2O0AS u/dRoYg1IpZHcucLIJy669dCurzzCbIVrB/fHQrI4cYHcKxjxdMi2haImge6oLsZTUUt A0KFbE2HXTPzwIZuTM27oN+Re0g/AxEbIjFS6ZGwVy08mjX9FnoilQzRqXrkqTBRkWRc 1A== Received: from ppma01wdc.us.ibm.com (fd.55.37a9.ip4.static.sl-reverse.com [169.55.85.253]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3m65abs2rv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 30 Nov 2022 16:18:22 +0000 Received: from pps.filterd (ppma01wdc.us.ibm.com [127.0.0.1]) by ppma01wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 2AUG5S5W003967; Wed, 30 Nov 2022 16:18:21 GMT Received: from b03cxnp08028.gho.boulder.ibm.com (b03cxnp08028.gho.boulder.ibm.com [9.17.130.20]) by ppma01wdc.us.ibm.com with ESMTP id 3m3ae9myh3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 30 Nov 2022 16:18:21 +0000 Received: from smtpav04.dal12v.mail.ibm.com ([9.208.128.131]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2AUGILSL27329080 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 30 Nov 2022 16:18:22 GMT Received: from smtpav04.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 72CCD58067; Wed, 30 Nov 2022 16:18:19 +0000 (GMT) Received: from smtpav04.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2507F58063; Wed, 30 Nov 2022 16:18:19 +0000 (GMT) Received: from li-e362e14c-2378-11b2-a85c-87d605f3c641.ibm.com (unknown [9.163.52.7]) by smtpav04.dal12v.mail.ibm.com (Postfix) with ESMTP; Wed, 30 Nov 2022 16:18:19 +0000 (GMT) Message-ID: From: Carl Love To: Tom de Vries , gdb-patches@sourceware.org Cc: Ulrich Weigand Date: Wed, 30 Nov 2022 08:18:18 -0800 In-Reply-To: <20221130140006.25890-1-tdevries@suse.de> References: <20221130140006.25890-1-tdevries@suse.de> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-18.el8) X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: -h-VIVkcw50g4vRSfB4jj12d-Ssi1M8g X-Proofpoint-GUID: -h-VIVkcw50g4vRSfB4jj12d-Ssi1M8g Content-Transfer-Encoding: 7bit X-Proofpoint-UnRewURL: 1 URL was un-rewritten MIME-Version: 1.0 Subject: Re: [PATCH] [gdb/testsuite] Fix gdb.ada/float-bits.exp for powerpc64le X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-30_04,2022-11-30_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 impostorscore=0 lowpriorityscore=0 mlxscore=0 spamscore=0 suspectscore=0 clxscore=1015 bulkscore=0 priorityscore=1501 adultscore=0 malwarescore=0 mlxlogscore=909 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211300112 X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Tom: On Wed, 2022-11-30 at 15:00 +0100, Tom de Vries wrote: > On powerpc64le-linux, I run into: > ... > (gdb) print 16llf#4000921fb54442d18469898cc51701b8#^M > $9 = ^M > (gdb) FAIL: gdb.ada/float-bits.exp: print \ > 16llf#4000921fb54442d18469898cc51701b8# > ... > > The problem is that we're using a hex string for the 128-bit IEEE > quad long > double format, but the actual long double float format is: > ... > gdbarch_dump: long_double_format = > floatformat_ibm_long_double_little^M > ... I am not sure what exactly the defaults are for the ada compiler. But for GCC compiling C code, the default was floatformat_ibm_long_double_little until recently. The default setting for C was changed to IEEE. Not sure exactly what the version was. I will have to check. Not sure if ada will switch or not. Carl > > Fix this by using the hex string obtained by compiling test.c: > ... > long double a = 5.0e+25L; > ... > like so: > ... > $ gcc -mlittle test.c -c -g > ... > and running gdb: > ... > $ gdb -q -batch test.o -ex "p /x a" > $1 = 0xc1e1c000000000004544adf4b7320335 > ... > and likewise for -mbig: > ... > $ gdb -q -batch test.o -ex "p /x a" > $1 = 0x4544adf4b7320335c1e1c00000000000 > ... > > Tested on powerpc64le-linux. > > I excercised the case of floatformat_ibm_long_double_big by > using "set endian big" in the test-case. > > Note that for this patch to work correctly, recent commit aaa79cd62b8 > ("[gdb] > Improve printing of float formats") is required. > > PR testsuite/29816 > Bug: > https://sourceware.org/bugzilla/show_bug.cgi?id=29816 > > --- > gdb/testsuite/gdb.ada/float-bits.exp | 28 > ++++++++++++++++++++++++++++ > 1 file changed, 28 insertions(+) > > diff --git a/gdb/testsuite/gdb.ada/float-bits.exp > b/gdb/testsuite/gdb.ada/float-bits.exp > index 55a0566580c..921fe36a4bd 100644 > --- a/gdb/testsuite/gdb.ada/float-bits.exp > +++ b/gdb/testsuite/gdb.ada/float-bits.exp > @@ -73,12 +73,40 @@ set gdb_long_double_size [float_size "16llf#0#" ] > # example, IEEE quad versus i387 long doubles. Account for that in > the > # tests below. > > +# Get the used long double format. > +set long_double_format "" > +gdb_test_multiple "maint print architecture" "" { > + -re "\r\ngdbarch_dump: long_double_format = (\[^\r\n\]*)" { > + set long_double_format $expect_out(1,string) > + exp_continue > + } > + -re -wrap "" { > + pass $gdb_test_name > + } > +} > + > # Set default values for 128-bit IEEE quad long doubles. > set valid_long_double "16llf#4000921fb54442d18469898cc51701b8#" > set printed_long_double "3.1415926535897932384626433832795028" > set invalid_long_double "" > set has_invalid_long_double 0 > > +switch -glob $long_double_format { > + floatformat_ibm_long_double_* { > + set w1 c1e1c00000000000 > + set w2 4544adf4b7320335 > + switch $long_double_format { > + floatformat_ibm_long_double_big { > + set valid_long_double "16llf#$w2$w1#" > + } > + floatformat_ibm_long_double_little { > + set valid_long_double "16llf#$w1$w2#" > + } > + } > + set printed_long_double "50000000000000000000000000.0" > + } > +} > + > if { [istarget x86_64-*-* ] || [istarget i?86-*-*] } { > # i387 long double have invalid values > set has_invalid_long_double 1 > > base-commit: aaa79cd62b873be672e3163eb267513c97ec4399