public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Hans-Peter Nilsson <hp@bitrange.com>
To: Sylvain Munaut <tnt@246tNt.com>
Cc: gcc@gcc.gnu.org
Subject: Re: Design a microcontroller for gcc
Date: Thu, 16 Feb 2006 02:49:00 -0000	[thread overview]
Message-ID: <Pine.BSF.4.58.0602152124320.90848@dair.pair.com> (raw)
In-Reply-To: <43F3C6F8.7080007@246tNt.com>

On Thu, 16 Feb 2006, Sylvain Munaut wrote:
> What I was thinking for the moment was to have :
>  - sign is always the msb of the last ALU output
>  - add/sub to modify all flags
>  - move/xor/and/not/or only affect zero (and sign)
>  - shift operations always affect carry and zero
>  - Have some specific instructions like compare and test, but theses
>    would only operate on registers (and not on immediate)

No, really.  Just use compare insns.  (And perhaps some way for
carry propagation for multi-word add/sub, if that mechanism
interferes.  BTW, carry-out from shifts is very rarely used in
compiled code.)

> What's so bad about have the flag as side-effects ?

Besides what DJ said about performance (both pros and cons
there), the problem is as I said with port complexity, because
of the way you have to handle condition codes in gcc.
(_Should_ now, _have_to_ in the future -- or actually now, as
you say you need scheduling.)  Flag setting really should be
explicit, so with your way, you have to show that add and sub
etc. also set condition codes.  And that's where you notice the
complexity in the port, because (partly because of gcc
pecularities) unless you want to lose performancewise, you need
to show that most of the time, the flag register result is just
clobbered by those operations and not used.  Anyway, at least
keep a way to add reg+reg and reg+integer, load and store of
memory and load of integer and address without condition code
effects and your port has a chance to avoid the related bloat.

Sorry, I won't spend the time to spell out the details.
Whatever: if you're determined on your way to do it and won't
take advice you asked for, by all means feel free.  You _have_
been warned, though.

brgds, H-P

  parent reply	other threads:[~2006-02-16  2:49 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-14 23:22 Sylvain Munaut
2006-02-14 23:40 ` DJ Delorie
2006-02-15  0:28   ` Sylvain Munaut
2006-02-15  0:41     ` DJ Delorie
2006-02-15 19:59       ` Sylvain Munaut
2006-02-15 20:06         ` DJ Delorie
2006-02-15 20:23           ` Paul Brook
2006-02-15 21:21             ` DJ Delorie
2006-02-15 22:10 ` Hans-Peter Nilsson
2006-02-15 23:10   ` David Daney
2006-02-16  0:26   ` Sylvain Munaut
2006-02-16  0:46     ` DJ Delorie
2006-02-16  2:49     ` Hans-Peter Nilsson [this message]
2006-02-16  3:21       ` DJ Delorie
2006-02-16  3:34         ` Hans-Peter Nilsson
2006-02-16  3:37           ` Hans-Peter Nilsson
2006-02-16  3:44             ` DJ Delorie
2006-02-16  3:40           ` DJ Delorie
2006-02-16  3:56             ` Hans-Peter Nilsson
2006-02-16  4:10               ` Hans-Peter Nilsson
2006-02-16  4:17                 ` DJ Delorie
2006-02-16  4:13               ` DJ Delorie
2006-02-16 11:42         ` Hans-Peter Nilsson
2006-02-16 20:49           ` Sylvain Munaut
2006-02-17  0:28             ` Hans-Peter Nilsson
2006-02-20  8:54               ` Sylvain Munaut

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=Pine.BSF.4.58.0602152124320.90848@dair.pair.com \
    --to=hp@bitrange.com \
    --cc=gcc@gcc.gnu.org \
    --cc=tnt@246tNt.com \
    /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).