public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Signed vs. unsigned compares
@ 2022-06-17 15:32 Paul Koning
  2022-06-17 15:51 ` Andreas Schwab
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Koning @ 2022-06-17 15:32 UTC (permalink / raw)
  To: GCC Development

Question for target code:

In expanding a longer-than-word compare, I need to do things differently depending on whether a signed vs. unsigned compare is needed.  But it seems the compare operation applies to either.  How can I do this in the target code?

	paul


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Signed vs. unsigned compares
  2022-06-17 15:32 Signed vs. unsigned compares Paul Koning
@ 2022-06-17 15:51 ` Andreas Schwab
  2022-06-17 16:52   ` Paul Koning
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Schwab @ 2022-06-17 15:51 UTC (permalink / raw)
  To: Paul Koning via Gcc; +Cc: Paul Koning

On Jun 17 2022, Paul Koning via Gcc wrote:

> In expanding a longer-than-word compare, I need to do things differently depending on whether a signed vs. unsigned compare is needed.  But it seems the compare operation applies to either.  How can I do this in the target code?

There are both signed and unsigned comparison operations, eg. GE
vs. GEU.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Signed vs. unsigned compares
  2022-06-17 15:51 ` Andreas Schwab
@ 2022-06-17 16:52   ` Paul Koning
  0 siblings, 0 replies; 3+ messages in thread
From: Paul Koning @ 2022-06-17 16:52 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: GCC Development



> On Jun 17, 2022, at 11:51 AM, Andreas Schwab <schwab@linux-m68k.org> wrote:
> 
> On Jun 17 2022, Paul Koning via Gcc wrote:
> 
>> In expanding a longer-than-word compare, I need to do things differently depending on whether a signed vs. unsigned compare is needed.  But it seems the compare operation applies to either.  How can I do this in the target code?
> 
> There are both signed and unsigned comparison operations, eg. GE
> vs. GEU.
> 
> -- 
> Andreas Schwab, schwab@linux-m68k.org

It looks like what I need is to define additional CCmodes, to describe "cc mode valid for unsigned comparison" vs. "cc mode valid for signed comparison".  Right now I don't make that distinction and that reportedly can produce bad code errors.

	paul



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-06-17 16:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-17 15:32 Signed vs. unsigned compares Paul Koning
2022-06-17 15:51 ` Andreas Schwab
2022-06-17 16:52   ` Paul Koning

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).