public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Eric Botcazou <botcazou@adacore.com>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] x86: Replace ne:CCC/ne:CCO with UNSPEC_CC_NE in neg patterns
Date: Tue, 01 Nov 2022 22:28:57 +0100	[thread overview]
Message-ID: <3131485.5fSG56mABF@fomalhaut> (raw)
In-Reply-To: <20221101203431.GM25951@gate.crashing.org>

> Yes.  But it is all the same: neither signed overflow nor unsigned
> overflow (of an addition, say) can be described as the result of an
> RTL comparison.

I disagree, see for example the implementation of the addvdi4_sp3 pattern (for 
which we indeed use an UNSPEC) and of the uaddvdi4_sp32 pattern (for which we 
describe the overflow with a COMPARE) in the SPARC back-end.  And that's even 
simpler for an unsigned subtraction, where we do not need a special CC mode.

Sure there is a technical difficulty for unsigned negation because of the 
canonicalization rules, hence the trick used in the SPARC back-end, but 
unsigned overflow is much easier to deal with than signed overflow.

-- 
Eric Botcazou



  reply	other threads:[~2022-11-01 21:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-26 18:58 H.J. Lu
2022-10-27  6:06 ` Uros Bizjak
2022-10-28  5:56 ` Hongtao Liu
2022-10-28  6:08   ` Hongtao Liu
2022-10-28  8:35 ` Eric Botcazou
2022-10-28 15:51   ` H.J. Lu
2022-10-28 17:58     ` Eric Botcazou
2022-10-28 21:43   ` Segher Boessenkool
2022-10-28 21:55     ` Eric Botcazou
2022-11-01 20:34       ` Segher Boessenkool
2022-11-01 21:28         ` Eric Botcazou [this message]
2022-10-28 21:32 ` Segher Boessenkool
2022-10-28 22:28   ` H.J. Lu

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=3131485.5fSG56mABF@fomalhaut \
    --to=botcazou@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=segher@kernel.crashing.org \
    /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).