From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 2E2703858D1E for ; Mon, 9 Jan 2023 15:30:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2E2703858D1E Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=comcast.net Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=comcast.net Received: from resqmta-a1p-077725.sys.comcast.net ([2001:558:fd01:2bb4::b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pEu6g-0001UO-SR for gcc@gnu.org; Mon, 09 Jan 2023 10:30:41 -0500 Received: from resomta-a1p-076786.sys.comcast.net ([96.103.145.235]) by resqmta-a1p-077725.sys.comcast.net with ESMTP id EtbYp962ll5OPEu6cpSqrd; Mon, 09 Jan 2023 15:30:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=20190202a; t=1673278234; bh=nBggjmzchxbekW6Rc1IhRn4+rbTsVbRThJRENP6ltFY=; h=Received:Received:Content-Type:Mime-Version:Subject:From:Date: Message-Id:To:Xfinity-Spam-Result; b=Jx2Mub5tyl7HmVy+P0H7ichcj06tQjJ2Yup5g/IbcGCsRqFVpRwqDu9r0WHX++W6h aXgvD7Zd4jUDJjeYZXh9SZGc8Sf7wvfNts+LJjsowDqL1fZ7B/NtfeSi1teR5XfJH7 O+P//CBs9XPwsRWIAbA09UM9d+rJITkYFgOJWjN8ldmVPj97OeoOCRpON47gZHKGMc oKBiymVC/rJ34honosKMHSuMvSohUdYxeTKFSlhuby1uileqG9GZXZcxKjth822mmi 6rpTrWwvkiV+aCUq9kfBfx/9dZYiU/Lrxmcws2bQrOTjDokwwgRom7aUrAWEbxkGSE K1osBneC0CqYQ== Received: from smtpclient.apple ([73.60.223.101]) by resomta-a1p-076786.sys.comcast.net with ESMTPSA id Eu6Zp4MjSYW0xEu6apGxzK; Mon, 09 Jan 2023 15:30:34 +0000 X-Xfinity-VAAS: gggruggvucftvghtrhhoucdtuddrgedvhedrkeeigdejvdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucevohhmtggrshhtqdftvghsihdpqfgfvfdppffquffrtefokffrnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpegtggfuhffrjgffvefgkfhfvffosehtqhhmtdhhtddvnecuhfhrohhmpefrrghulhcumfhonhhinhhguceophgruhhlkhhonhhinhhgsegtohhmtggrshhtrdhnvghtqeenucggtffrrghtthgvrhhnpefgudeiudekudeufeeiffegvedtgfdtffelvedvgefhvdduhfduhfekieduleetfeenucfkphepjeefrdeitddrvddvfedruddtudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhephhgvlhhopehsmhhtphgtlhhivghnthdrrghpphhlvgdpihhnvghtpeejfedriedtrddvvdefrddutddupdhmrghilhhfrhhomhepphgruhhlkhhonhhinhhgsegtohhmtggrshhtrdhnvghtpdhnsggprhgtphhtthhopedvpdhrtghpthhtohepshhtvghfrghnrdhkrghnthhhrghksehnvgigghhordguvgdprhgtphhtthhopehgtggtsehgnhhurdhorhhg X-Xfinity-VMeta: sc=-100.00;st=legit Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: Widening multiplication, but no narrowing division [i386/AMD64] From: Paul Koning X-Priority: 3 In-Reply-To: <3BFE5710A2B04DA89EC334177EC28BC6@H270> Date: Mon, 9 Jan 2023 10:30:30 -0500 Cc: gcc@gnu.org Content-Transfer-Encoding: quoted-printable Message-Id: <46F8B35E-93C9-4B76-90C1-217291D6509A@comcast.net> References: <554A1354252F43BB8915A74129C41BE3@H270> <3BFE5710A2B04DA89EC334177EC28BC6@H270> To: Stefan Kanthak X-Mailer: Apple Mail (2.3696.120.41.1.1) Received-SPF: pass client-ip=2001:558:fd01:2bb4::b; envelope-from=paulkoning@comcast.net; helo=resqmta-a1p-077725.sys.comcast.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,DKIM_VALID_EF=-0.1,FREEMAIL_FROM=0.001,SPF_HELO_PASS=-0.001,SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_PASS,SPF_SOFTFAIL,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > On Jan 9, 2023, at 10:20 AM, Stefan Kanthak = wrote: >=20 > "Paul Koning" wrote: >=20 >>> On Jan 9, 2023, at 7:20 AM, Stefan Kanthak = wrote: >>>=20 >>> Hi, >>>=20 >>> GCC (and other C compilers too) support the widening multiplication >>> of i386/AMD64 processors, but DON'T support their narrowing = division: >>=20 >> I wonder if this changed in the recent past. >> I have a pattern for this type of thing in pdp11.md: > [...] >> and I'm pretty sure this worked at some point in the past. =20 >=20 > Unfortunately the C standard defines that the smaller operand (of = lesser > conversion rank), here divisor, has to undergo a conversion to the = "real > common type", i.e. the broader operand (of higher conversion rank), = here > dividend. Unless the information about promotion/conversion is handed = over > to the code generator it can't apply such patterns -- as demonstrated = by > the demo code. >=20 > regards > Stefan Yes, I was thinking the same. But I spent a while on that pattern -- I = wanted to support div/mod as a single operation because the machine has = that primitive. And I'm pretty sure I saw it work before I committed = that change. That's why I'm wondering if something changed. paul