From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id qsUdDij3qWCgKwAAWB0awg (envelope-from ) for ; Sun, 23 May 2021 02:33:12 -0400 Received: by simark.ca (Postfix, from userid 112) id 2BD341F11C; Sun, 23 May 2021 02:33:12 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 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 024CC1E54D for ; Sun, 23 May 2021 02:33:10 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 51A91383D00A; Sun, 23 May 2021 06:33:10 +0000 (GMT) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2116.outbound.protection.outlook.com [40.107.220.116]) by sourceware.org (Postfix) with ESMTPS id 98C473850405 for ; Sun, 23 May 2021 06:33:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 98C473850405 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=wavecomp.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=fshahbazker@wavecomp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZclhKaQlrTMdeQJf5z0K92494TaYvZkH+4BO86yQ0426pA5xrI6rFhZjCZ3iv3KPjrSUbrT0AtJCwL5W4Gh7WuJA8dc6L6v5+oTJSNQiH+MaKLBLvgDP46wtFYePLcYHNiTvokohfkXIXc9d4bwH6Q/07kRU4unFlDyd05AiH2pvoWlm8B5Y1m/1FzGEX22RFaq4DqbKYJdrzoMnL1wQBG5UeOgi1LW4/Zi0uIFdU9N5K8K/nQkY/qTRpEkxnxrWe87ogWOmXMfanKY1enJZNQ5ursqPlDdtszePpO6zSQ4pNiMFe0+4+k4v8KNx03O6o46JVKOlrCdOqaYhhmQr6w== 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-SenderADCheck; bh=L3iNhyXqfgGdC9/bnYA61WQJ4NuUcPYA8OP6yqnZW4I=; b=JWmvpkz9v4MjRLSSm74YXWHgViXKVcngl2iMY6HIxrjquptB+TRrloUmmYacXzK/rBLmVODgs/tU0ygFqCKknexkKkgDAsUI0ozH1iPGov8GSnGc98nelCHgSNrXLCfVUk7YMWe9qycWpBpaNaE9exdp0rabJkFf/QmNAyFtL4UTtaNb81yyJB6VWIJcI7koLd4a1nl9t9fVI7cBwpnRDSU+iUT1KTkvCWoVFzLseVfOEnnP0K2JOkesPB/+X0LG1axRIiI2Cm7wFSwxA22sDUkXHXS5hu7mrNjgCfTl1H20qUSkvP146sKrFnBCO8RqkhP3VBAFamc+NYktar2DSA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wavecomp.com; dmarc=pass action=none header.from=wavecomp.com; dkim=pass header.d=wavecomp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wavecomp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=L3iNhyXqfgGdC9/bnYA61WQJ4NuUcPYA8OP6yqnZW4I=; b=fc7d6iVOUvMg0GTD7xkdmXqXAOWS1TSuX0R/GtwzGTCCedaSRKqIxHSVdXZRb7DO5Hx42IdgjdPtHQ65U4G1FE/oRhKw6ab6f60uU+EVAMWyS8AMWwxZ+kXvRnqppqPa8HPU9FugTotf3fl0VNLbWkXJp/T58UZ/3jNgeeNmHKM= Authentication-Results: wavecomp.com; dkim=none (message not signed) header.d=none;wavecomp.com; dmarc=none action=none header.from=wavecomp.com; Received: from MW3PR22MB2299.namprd22.prod.outlook.com (2603:10b6:303:47::10) by MWHPR22MB0558.namprd22.prod.outlook.com (2603:10b6:300:ff::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.25; Sun, 23 May 2021 06:33:04 +0000 Received: from MW3PR22MB2299.namprd22.prod.outlook.com ([fe80::e098:7822:150b:bb5b]) by MW3PR22MB2299.namprd22.prod.outlook.com ([fe80::e098:7822:150b:bb5b%7]) with mapi id 15.20.4150.027; Sun, 23 May 2021 06:33:03 +0000 Subject: Re: [EXTERNAL]Re: [PATCH 2/5] sim: Factor out NaN handling in floating point operations To: gdb-patches@sourceware.org, "Maciej W . Rozycki" , Chao-ying Fu References: <20210520074554.1465327-1-fshahbazker@wavecomp.com> <20210520074554.1465327-3-fshahbazker@wavecomp.com> From: Faraz Shahbazker Message-ID: <7c9257fe-d83c-17ed-7de7-e47a3f3f1998@wavecomp.com> Date: Sun, 23 May 2021 12:02:53 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [123.201.116.4] X-ClientProxiedBy: PN2PR01CA0164.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:26::19) To MW3PR22MB2299.namprd22.prod.outlook.com (2603:10b6:303:47::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.0.104] (123.201.116.4) by PN2PR01CA0164.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:26::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Sun, 23 May 2021 06:33:01 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5c8f2d74-3647-4031-b406-08d91db49df4 X-MS-TrafficTypeDiagnostic: MWHPR22MB0558: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5236; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zJDZQPo95OwHwj2SPe6KedYPKwboOxgsuSqkUX+jR3KyGL0jze80soZvZfA2NWkn9IAgRY9ufQ/IzbIUflaRyIfjON+9O+PlD+Szc6Uj6AVshpp+qz/TR2aQoUh8o6F+KQUu8d7N+Q7L1XnYjtzB2rbT+ywGDCIi1bjuRY7vaevFh2u1R/cAuWqaR6BTPXhacvzysFTDDg6D+2vawJHEI1/otiebytQRwSYMHR42kA5R8BTBcOTiZnFI2qGndh+UovyZw1dFKUkdkmokNEX1tTD+CU5RQEdKL4/rIwJ6z7iF3ByXz5DDGCT8QiPQNNMIEMjM6pASBvv9iwW6FHPZqSfejPfxv4beZg03LSDZZAWq5IIol4QCgTMwEfoldJgU6wWu9F/HHDg4Lvc/rHGJdg6Gi3vuvpB1ThpOHOZM8a1esx5I2KkVQNJNklwJmmVTRDXFCdyJYnxNH6xfsvJ9NU5vfVZiOAYNSmrNZ5B+qEq2kN4aSASBEgPYWh7FNqLsCy+HRo1d9YOyLf4v3gptesmQ3VVs6kDeKNmUyeguGjhR8f6KRFiZ8e52T1NCKdzQBDg3jlOGdFGdDy9auV+2+ZcNv8VPcDDH3W96vaE1Pq6sRSok6DmyvuwTnS7x6rs4oCNotbkcp47xqskQBwI0T/zy0/8ojl7YhK6Q3wfVgZmRCbPElsmQ8PPGCH1GDnBCO5ySRCj2DkJkrGz3Gmh/yQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW3PR22MB2299.namprd22.prod.outlook.com; PTR:; CAT:NONE; SFS:(136003)(396003)(366004)(346002)(39830400003)(376002)(5660300002)(956004)(52116002)(478600001)(2906002)(8936002)(6486002)(16526019)(186003)(38350700002)(8676002)(110136005)(36756003)(316002)(26005)(66556008)(86362001)(16576012)(2616005)(6666004)(53546011)(38100700002)(4744005)(66946007)(66476007)(31696002)(6636002)(31686004)(43740500002)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?B?TFlVOE1aMEJCdEQvbjBxUlA4S3lhbk42MnNjbzlKMTk2K3Y3RjlMeHRpTW9I?= =?utf-8?B?QkxrLy8yOGlGVm1xZ0tBaDZRSGxjb2RNalJTY1doL2xrL3JGUWl2a0JsQTB1?= =?utf-8?B?K3ZBSGlLOS9zOW9RbERxb3lncE03TDJhTUFsd202a0lhTmhYeG01N3llRzZa?= =?utf-8?B?VEpYNk51MTZlcm54T3RpSmtnQVpQS2JQKzgyRHp3ZU4rVC9rR2J1UHRWbkJK?= =?utf-8?B?bGwrSWgxTDRNWDdtcnNyWjh5NW9TSWJ6bDhNYVNDaVB5S0hVQi9OWTNKUHpu?= =?utf-8?B?c0MyN2FwR2pqK1FBTEZNR2ZiRW1JRjlBdjBSMjFGQTRFYkxmcFd4Vm42MS83?= =?utf-8?B?LzBSREd6UVFhZWdCMXBWZXZZSGVYN3hFRWtTYVc3ZjJTM1hPeGtJb0pZckdG?= =?utf-8?B?UWRVTEs0YXArc2s2NEtBWXBtTmJ3VkxsYmZ6OTNFVHpQM1E1Q2JzTG1idWww?= =?utf-8?B?L0FsNzhscnl3VlZ3bGJlSmhXRzY4N1UyNWdIRGVOeVRManE4eEwrVVV0dzNq?= =?utf-8?B?MitFWFJ1OG16MkVLdkJ6YW43bzBMR0d6cTZhL1RVa0VvcWduYURuUFp0d0VU?= =?utf-8?B?d1VZdGl2NnRCcUd1eFg5OEh0dlQ5czFEL1FVektMTl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NY3pETW00T0kvR08wUlZzb3dWTWU2dmU2MkdV?= =?utf-8?B?YnpLakVBV210LzVBNDlYY2R4Yk40NTUwRlM2S2d3dkREZmJtMytCdHVES0U0?= =?utf-8?B?NEMzRUxLb2sySFlNWVF3QjEyWlJGQTBIWmJVUnNzRnZlY0FoTnpCeExhTkFY?= =?utf-8?B?eGx1VHVKV1E1eFJXK0p2NzFNMWQxUHdBeUtWdlBydXltdXJxVGY4N2lNeWpZ?= =?utf-8?Q?JoCCRjmyayVyl6G0d6hTnPeL4t9LgM/fwAAoQ4D?= X-OriginatorOrg: wavecomp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5c8f2d74-3647-4031-b406-08d91db49df4 X-MS-Exchange-CrossTenant-AuthSource: MW3PR22MB2299.namprd22.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2021 06:33:03.6460 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 463607d3-1db3-40a0-8a29-970c56230104 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: tFtA0V1XFpYRhQX3I/+8YxmBhynbyD09iJb0yzmRSVoOz/u/HhYRwY2H5VXApTIyJh7jadGohsR7yr/R3/aeOJhRA1xZj2JxP46/zl72rkM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR22MB0558 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: , Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 5/22/21 6:55 AM, Mike Frysinger wrote: > so some of the logic you replaced below do: > if (sim_fpu_is_qnan (l)) > { > *f = *l; > return 0; > } > if (sim_fpu_is_qnan (r)) > { > *f = *r; > return 0; > } > > but others do: > if (sim_fpu_is_qnan (l)) > { > *f = *l; > f->class = sim_fpu_class_qnan; > return 0; > } > if (sim_fpu_is_qnan (r)) > { > *f = *r; > f->class = sim_fpu_class_qnan; > return 0; > } > > it seems like we should have been consistently doing the latter ? Isn't the extra assignment redundant? If sim_fpu_is_qnan(l), then l->class == sim_fpu_class_qnan, and so *f = *l is sufficient. Only sNaN-handling needs the extra assignment because it has to be downgraded to qNaN. - Faraz