From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id njj4GzTQcGLi+AMAWB0awg (envelope-from ) for ; Tue, 03 May 2022 02:48:20 -0400 Received: by simark.ca (Postfix, from userid 112) id 62DE01E058; Tue, 3 May 2022 02:48:20 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=UT/SLPNR; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A, UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 9F1F21E01D for ; Tue, 3 May 2022 02:48:19 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4DD0F385734E for ; Tue, 3 May 2022 06:48:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4DD0F385734E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1651560498; bh=wtLDSMo5SrEIMLXebtRpefHM+KNIufJPQezyv2ianWY=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=UT/SLPNRLYSU32GHmj5+w3iuMfSgX1v0jRFl3Dze6IBYQT9s+u4D7Hy2hnbtTV0J1 lk/dwOSFndX6Q81fWeumO+UqasM0bWGYpUyKgQQhGaBLL5sYofJwQQ1t+g5Pf6ESrW tA4eGWFHDc3hWaCRuB7XUMr7bu05uE5vsC1GD+Dk= Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70072.outbound.protection.outlook.com [40.107.7.72]) by sourceware.org (Postfix) with ESMTPS id 90246385840F for ; Tue, 3 May 2022 06:47:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 90246385840F ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=cYU26HUbjfrVo3sSWiBZUOoFqzhZkav4gKPeP8flqlIqsSwMorsY1S0UIWsgRDrAPjrQhmPkS2JOs3tkPS+l+KCHK6PMYz1kurJz9HOIgdgos5wtWs+1SV1wFUCIA0RlnbI1u9FJYZxcWUgx8OUzZ0jCrBTH7e6Hksad2t9DAXAL+QGwMXQOS63REAFD5EMItLd4iDEg+W5392oZAaUot4l3EoyxQeFb20aZSgmditaUkh6jHVz+drSVDcLAWr9OhCZM1090QFnIqlvwTdM68w7WY6uw9XsgS6h48QNBofIx+PeFik2QXu4vlRJIBbISQju/OqyLpzzt+bQx/4Fslw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wtLDSMo5SrEIMLXebtRpefHM+KNIufJPQezyv2ianWY=; b=KFQ+xaFdCAIK1wS+oaYPlNsTdDwGHQ2FfhDlxFNUlFDi4UwYylf5oK+rEEm/PoOylqAiez/2ey/3Oy5IbszX+9YvYAP5yMNSv0LAGQTCkewv++GR/yRNTiv5RDeXtn3tv5sahFbsQx8lJJfNng/Uw9DUhJ10SXQ3fbmn2P1Rap+aa1egieKCGjjuU721HNR6/cbxCXCHvY439wwEQfY/2zufRLFfUpRT2Dg3HWGkyng9NB3AriT/il/+Od1pxK7ZOWcYoPiklbbQib+7P9zlE/SayX0ibk0YuDlGyMoAQwH6leSJSUBpJln0awjuQR+JAmaP652GjkFufPPR+C1lMA== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) Received: from AM6P194CA0048.EURP194.PROD.OUTLOOK.COM (2603:10a6:209:84::25) by HE1PR0802MB2153.eurprd08.prod.outlook.com (2603:10a6:3:c2::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.15; Tue, 3 May 2022 06:47:53 +0000 Received: from AM5EUR03FT045.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:84:cafe::c8) by AM6P194CA0048.outlook.office365.com (2603:10a6:209:84::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.13 via Frontend Transport; Tue, 3 May 2022 06:47:53 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT045.mail.protection.outlook.com (10.152.17.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.12 via Frontend Transport; Tue, 3 May 2022 06:47:51 +0000 Received: ("Tessian outbound 62985e3c34b6:v118"); Tue, 03 May 2022 06:47:51 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: a9384c3189596dad X-CR-MTA-TID: 64aa7808 Received: from 33149f1744ec.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 997AFF76-C161-4257-95C7-2B0E0C0666A6.1; Tue, 03 May 2022 06:47:45 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 33149f1744ec.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 03 May 2022 06:47:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gclvK/kE+UQ9Q0IGWqgX6kfdkHwyhhiG3UvXtm1wb0yxoZfWgdrN2NUNJ8uRBW6GZD1dW8Zsifqep9+qhfw8LdKzbYzim6/9Ufdh8xyYDwMsibAtpC6hF4/0NstJIuSFTu5ZgYVGcYYxVefd0uIsnV9hBqXlazIeJkBJJiKM8SI8KVZv3ZywMGNDs3MGPcqr9BuLPUz/OfvStbTq6aaDep3Jd4f9VfzHCzhrQJ5K709JGs+jAnNAuNBDEWgvY88glmID2oTuV6vwlRQVRrBnPXXIfct2wMZ63TQZtG3TOuq8SmFRa9Etl0ta7A+tGA5e4C2dR78bFTzpXmCIsFftRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wtLDSMo5SrEIMLXebtRpefHM+KNIufJPQezyv2ianWY=; b=eFMPCjUi7Yfcr/HHi6+knRmtG4TEL291WFXLOd2OQZrMaSNaShEU3EOAKOiUJQ6G7KtuTGuatEJX9aMrNybdfrFG4tOonHrUhjaEy0aYXZFx0LepXRhbD+t6/6PbRiDwGhKLythKt8c+IHbD8b3ODYafrgHWrJsdB7GE/Oz1i1dFQ3R9zEt6yC2d8uMwAelsxkYU4uyrFDM114jpGbgzc0ItVwmh7UNN6tzWHrWm+knTXORKO5u8321ibzUk7HXWEOsCL+HKWg8a1k4vzCdRFjBgCOxeyZzsH/hya2MGTFGvuPNdzWFWzX9PJEL4s2t0ONM3FgvUTKDX3XXZe5rrlQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from AM6PR08MB3911.eurprd08.prod.outlook.com (2603:10a6:20b:80::27) by VI1PR08MB3822.eurprd08.prod.outlook.com (2603:10a6:803:bb::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.15; Tue, 3 May 2022 06:47:43 +0000 Received: from AM6PR08MB3911.eurprd08.prod.outlook.com ([fe80::a8fb:37c7:214f:9cb4]) by AM6PR08MB3911.eurprd08.prod.outlook.com ([fe80::a8fb:37c7:214f:9cb4%4]) with mapi id 15.20.5206.024; Tue, 3 May 2022 06:47:43 +0000 Message-ID: <0d550247-8ac6-6ff7-c025-c303e2883ed5@arm.com> Date: Tue, 3 May 2022 07:47:40 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH][gdb/testsuite] Fix gdb.ada/float-bits.exp with -m32 Content-Language: en-US To: Tom de Vries , gdb-patches@sourceware.org References: <20220414131412.GA9234@delia> <2ce6644a-6480-8a78-b53c-c2321956f3d8@arm.com> <98208d6d-817d-b3a8-aebf-d56ac33ff40e@suse.de> In-Reply-To: <98208d6d-817d-b3a8-aebf-d56ac33ff40e@suse.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: AM0PR10CA0121.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:e6::38) To AM6PR08MB3911.eurprd08.prod.outlook.com (2603:10a6:20b:80::27) MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 6e838f58-462d-43fa-c929-08da2cd0d81c X-MS-TrafficTypeDiagnostic: VI1PR08MB3822:EE_|AM5EUR03FT045:EE_|HE1PR0802MB2153:EE_ X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 78FR6OHj+2kFrSnW9B+vhYRtcs5FeiLNisf8NtlPO0fJLRBLgJQ3LFESxpAeZoTn9dQrEbUIE2ROqeoTcxX8OxVvjZU9wQFg3UVSva0SW44lN9MZGQ9BlNQLUIRQR7WhJ+Y43sf9cN4C/R+0ND99os/SafaBQSSmCr2cSUQxMOQVCWxg4DuwZwufjjnhqMdQw/EeBK71UMaitDyefhuaJNWmYyWIJ2FNktgj0Lpei/pq7BmAuVNPjfyqLnlMVrXj4ryIe9dCw2dAN/J1VMCuidb0fksimd6aB8Q5mccM/M668vPK7o8vfQ5HprTLuRbf0Kv+uasSRzMB8WemJkKG9wpMISVtRxypZr1SplVJW7BDup5hj096VczU0bA4yNsRZJAF0Q3D1g8tO6xPWAohV+p0W1lOGw+T8Ab55NBYhPJ9ft3nMqPnYnG/hs6npc6x/FzCZeqfRpXA3xrxvcpmxHFvqbcvmdCskaVJ4uGhzT8v1JXdzmVPwhxL4vqGAbGEue9+4Amm9o8AAyGsz2Q9IHKoE84yTidcHhd8tgT0mbxc5jl1msqHoh/glmnjfXQxxr3rpbM65USq4Ut3dGxvaKDjA6U0p7lJkr3lxAGcu+vZ0z1iPAj5qDZ6ofP5dJm/JsVsjd9+aMa98kIv01zTqjXxoFym87OV2eqHjKSkimQMnOc/qD+FPspAQuPtyVqlFQdyh753LVAr0kL7UYxd9vcI3+T4knPaF3qJpoXOs3oAmLfKvRkT4Tt2X3JAxCvXcZed74smQDxLumHYwuV4tM5ihZSBg8GSUTVe0gkJfJ3pT05VAF4XSUMZeHlk5/gjH1HynV48jqp4hX+DD3+k1G7H9tHg1XSiRxylOLUVrsA= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR08MB3911.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(53546011)(31696002)(316002)(4326008)(5660300002)(186003)(2616005)(84970400001)(36756003)(966005)(86362001)(66476007)(66946007)(66556008)(8676002)(44832011)(38100700002)(508600001)(2906002)(6486002)(8936002)(31686004)(26005)(6506007)(83380400001)(6512007)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3822 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT045.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 60939360-dfa8-401b-1cd3-08da2cd0d2e3 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hKZ2q/6rZiEAo+FNUHIvLSxxZy18CF81exNSp1eLCUAJlY+d1jVxmKp2gfcruxRMcFOXE8FRC5bKY/TLeUUnKfGDlJJ4fIul5BiEH5ongDSCz0iKvPR8NDYMov1n30eASSIro8EMsO1Z6zr+VX5Ij9uJEXUk/CcNlLBGod1GXrtbtA0ZvY33uxOlMj3/0CHsPCfrqGQhy9IjrSGqc6rTN3KvqX23t9qu+AOSncZpvR3e6vZ9SFVUg10FfxOrYfk5MHJQuHQs9R85ze2R15piEnYoftsJpc8ZthZA7egqdcQ2fCWbxGzp4aE2GNBmIbcZ2QFrpkHXx6ggEiCMomz/wIfOYzJVawDm6+25S/IN3CIh/gefzULON1DJzNefSCfVv8HE/Iu5+cknsaxO4Z2sQkKYOZzND+t3lpBtMhO7oOtsVPL38/vPFuT5O0KCAkw/33Iiww1u61+rekYMp0HkO4b1//MFTa6dI84/ChANMKmNXqQ+LAzNAHEXGibZmdUHB6/XGS0RIMGfLqo4dT04CQy6+55PHaF3GcQYFCvRZWwFTV3Q94xPyTZO8Ie24XF0WwfAYttKkOxuTqoKNVLziXyFY361IRo05iSmJQprHUCY0zP9V2hqyv3Rok4fiK6nIQxCMpySlvfGdv9dZlZAdxT0AwPmxC0EjphR6AcM2/8h4hNbohTVsdi/djlk+fhAnLyfR1n1Ko+zVym2ogyfC1swilum8Sa/fvSnYsN5499dPZ8bQtDJ71LqSc0AKas419+3S5owwpaaRfrOQvQ2Q5VX/GVQ+vJHq0lP/zO/j6jd08YR7ho/uf0SddMJo1bhm3LGRBNJyQy9VFqX+A737A== X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230001)(4636009)(36840700001)(46966006)(40470700004)(508600001)(84970400001)(5660300002)(31696002)(336012)(86362001)(31686004)(8936002)(966005)(6486002)(82310400005)(2616005)(107886003)(26005)(53546011)(6512007)(186003)(2906002)(44832011)(6506007)(356005)(36860700001)(81166007)(4326008)(8676002)(70206006)(70586007)(36756003)(316002)(47076005)(40460700003)(83380400001)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 May 2022 06:47:51.6306 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6e838f58-462d-43fa-c929-08da2cd0d81c X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM5EUR03FT045.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0802MB2153 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Luis Machado via Gdb-patches Reply-To: Luis Machado Cc: Tom Tromey Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 5/2/22 08:10, Tom de Vries wrote: > On 4/25/22 12:31, Luis Machado wrote: >> On 4/14/22 14:14, Tom de Vries via Gdb-patches wrote: >>> Hi, >>> >>> With test-case gdb.ada/float-bits.exp and native we get: >>> ... >>> (gdb) print 16llf#7FFFF7FF4054A56FA5B99019A5C8#^M >>> $9 = 5.0e+25^M >>> (gdb) PASS: gdb.ada/float-bits.exp: print >>> 16llf#7FFFF7FF4054A56FA5B99019A5C8# >>> ... >>> but with target board unix/-m32 we have instead: >>> ... >>> (gdb) print 16llf#7FFFF7FF4054A56FA5B99019A5C8#^M >>> Cannot export value 2596145952482202326224873165792712 as 96-bits \ >>>    unsigned integer (must be between 0 and >>> 79228162514264337593543950335)^M >>> (gdb) FAIL: gdb.ada/float-bits.exp: print >>> 16llf#7FFFF7FF4054A56FA5B99019A5C8# >>> ... >>> >>> Fix this by testing whether 16llf is supported by doing ptype >>> long_long_float >>> which gets us either: >>> ... >>> type = <16-byte float>^M >>> ... >>> or: >>> ... >>> type = <12-byte float>^M >>> ... >>> >>> Tested on x86_64-linux with native and unix/-m32. >> >> Unfortunately not all targets support 128-bit long doubles. For arm >> and aarch64 the compiler won't generate a 128-bit float, but a 64-bit >> float, so the 16ll tests won't be meaningful. >> > > Right, but I'd expect those tests are skipped because 16llf_supported is > 0 for 64-bit long double. They are skipped, but the testcase still assumes some 16llf tests can be executed: gdb_test "print val_long_double" " = 5.0e\\+25" gdb_test "print val_long_double" " = 5.0e\\+25" \ "print val_long_double after assignment" The above couple tests won't work correctly, as you're trying to force a 128-bit value into a 64-bit variable. > >> FAIL: gdb.ada/float-bits.exp: print val_long_double >> FAIL: gdb.ada/float-bits.exp: print val_long_double after assignment >> > > Can you show me the actual failure mode, that is, copy from gdb.log > instead of gdb.sum?  I'm surprised that these fail because AFAICT, the > used constant: 5.0e+25 is exactly representable in 64-bit ieee ( I used > https://babbage.cs.qc.cuny.edu/ieee-754.old/decimal.html to check this ). Sure, here it is: print val_long_double $9 = 5.0000000000000002e+25 (gdb) FAIL: gdb.ada/float-bits.exp: print val_long_double print val_long_double $10 = 5.0000000000000002e+25 (gdb) FAIL: gdb.ada/float-bits.exp: print val_long_double after assignment > >> I wonder if it would be best to bail out as soon as we find out the >> target has no support for 128-bit floats. I can write a patch for that. >> > > With a rewrite like this: > ... > -set 16llf_supported 0 > +set long_double_bytes 0 >  gdb_test_multiple "ptype long_long_float" "" { > -    -re -wrap "<16-byte float>" { > -       set 16llf_supported 1 > -       pass $gdb_test_name > -    } > -    -re -wrap "<\\d+-byte float>" { > -       pass $gdb_test_name > +    -re -wrap "<\(\\d+\)-byte float>" { > +       set long_double_bytes $expect_out(1,string) >      } >  } > > +set 16llf_supported [expr $long_double_bytes >= 16] > ... > we can formulate the precondition for any test in terms number of long > double bytes. I've sent a patch to make this test a bit more generic: https://sourceware.org/pipermail/gdb-patches/2022-April/188440.html Did you see it? > > Thanks, > - Tom > >> I'm guessing some 16ll tests still work for 12-byte floats, right? >> >> What do you think?