public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Stefan Kanthak" <stefan.kanthak@nexgo.de>
To: "Paul Koning" <paulkoning@comcast.net>
Cc: <gcc@gnu.org>
Subject: Re: Widening multiplication, but no narrowing division [i386/AMD64]
Date: Mon, 9 Jan 2023 16:20:37 +0100	[thread overview]
Message-ID: <3BFE5710A2B04DA89EC334177EC28BC6@H270> (raw)
In-Reply-To: <A2650E81-2627-4F3C-A531-1D4944C338AB@comcast.net>

"Paul Koning" <paulkoning@comcast.net> wrote:

>> On Jan 9, 2023, at 7:20 AM, Stefan Kanthak <stefan.kanthak@nexgo.de> wrote:
>> 
>> Hi,
>> 
>> GCC (and other C compilers too) support the widening multiplication
>> of i386/AMD64 processors, but DON'T support their narrowing division:
>
> 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.  

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.

regards
Stefan

  reply	other threads:[~2023-01-09 15:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-09 12:20 Stefan Kanthak
2023-01-09 13:10 ` LIU Hao
2023-01-09 13:19   ` Stefan Kanthak
2023-01-09 14:23 ` Paul Koning
2023-01-09 15:20   ` Stefan Kanthak [this message]
2023-01-09 15:30     ` Paul Koning
2023-01-09 16:27       ` Stefan Kanthak
2023-01-10 16:49         ` Paul Koning

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3BFE5710A2B04DA89EC334177EC28BC6@H270 \
    --to=stefan.kanthak@nexgo.de \
    --cc=gcc@gnu.org \
    --cc=paulkoning@comcast.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).