public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Peter Barada <peter@the-baradas.com>
To: bernie@develer.com
Cc: rz@linux-m68k.org, gcc@gnu.org
Subject: Re: m68k bootstrapping broken
Date: Wed, 07 Jan 2004 03:25:00 -0000	[thread overview]
Message-ID: <20040107032443.4428D989A3@baradas.org> (raw)
In-Reply-To: <3FFB6CA9.2090906@develer.com> (message from Bernardo Innocenti on Wed, 07 Jan 2004 03:19:21 +0100)


>>>>It won't be that hard to make it work for a 5206e/5272/528x/5249, at
>>>>least from the core perspective(just need to add the div/mod
>>>>instructions and the extra v2 insn for the 528x).  Adding in the v4
>>>>instructions shouldn't be too hard either.
>>>
>>>Yes, but I think the emulator also lacks the required infrastructure
>>>to select multiple CPUs at run-time.
>> 
>> Yes, it does.  Its all trade;  do you add ColdFire bits to UAE and then
>> go through the hassle of getting uClinux to boot, or do you add the
>> other bits to the emulator at lightbox.  I understand that performance
>> of the emulator at lightbox can be improved, and I see ways to speed
>> it up, or do we take all ot the above and produce one frm scratch that
>> has the benifit of being usable as a simulator by GDB?
>
>Do we really need to start from scratch?  Can't we massage existing
>code until it fits into GDB's simulator infrastructure?
>
>Even though in the end you'll have rewritten every single line of the
>emulator, usually the time you save in design and debug are worth it.
>
>I tend to avoid starting projects from scratch when there's even the
>smallest chance to use existing code, as ugly, buggy or limited as it
>may be :-)

If you're tryong to make a McLaren F1 car, you surely don't want to
start with a Model T.  It all depends on what you're starting with and
what you're trying to make.  I do agree with ripping off as much so
the reinvention of the wheel is limited, but sometimes starting with a
clean slate is easier.

>By the way, all the projects we're talking about GPLed, so there are
>no legal issues.

Yes, there is that. That's why I've been looking at both(in my copious
spare time of course).

>> I'm happy to go in any direction, I just want to know its the right
>> one :-)  As a side note, I've already started on building a UAE style
>> instruction decoder for ColdFire, and have a decoder that produces a
>> full table for V4. It should be pretty trivial to have it genreate the
>> table at startup based on which CPU model you want...
>
>That's great news!  UAE's cpugen also has some questionable x86
>optimizations done by post-processing GCC's assembly output.  Of course
>it breaks on every new GCC release, so I don't think I'd want to maintain
>such a thing ;-)

I'll look at having it encode instructions with a model selector in
the first filed so we can have it produce different decode selectors.

>Another thing.  I'm playing with libffi to see if I can get it to work
>on plain 68000.   Do you know a simple instruction sequence to replace
>this bit-field operation?
>
>   bfins   %d0,(%a1){#0,%d2}
>
>
>I was thinking of something like this (in pseudo-C):
>
>   mask = (1 << (d2 & 0x1f)) - 1;
>   *a1 = (*a2 & ~mask) | (d0 & mask);
>
>This should work like bfins for any value of d2,
>but the code as produced by GCC is quite longwinded:
>
>        moveq   #31,%d1
>        and.l   %d1,%d0
>        move.b  #1,%d1
>        lsl.l   %d0,%d1
>        subq.l  #1,%d1
>        move.l  %d1,%d0
>        not.l   %d0
>        and.l   (%a1),%d0
>        and.l   %d1,%d2
>        or.l    %d2,%d0
>        move.l  %d0,(%a1)
>
>Is there a more efficient way?

Let me think for a bit.  Perhaps I'll code it up for superopt to
crunch over for a while...

-- 
Peter Barada
peter@the-baradas.com

  reply	other threads:[~2004-01-07  3:25 UTC|newest]

Thread overview: 106+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-05  0:20 Richard Zidlicky
2004-01-05  4:08 ` Bernardo Innocenti
2004-01-05 13:20   ` Richard Zidlicky
2004-01-06  1:07     ` Bernardo Innocenti
2004-01-06  9:24       ` Richard Zidlicky
2004-01-06 11:41         ` Bernardo Innocenti
2004-01-06 15:59           ` Peter Barada
2004-01-06 23:24             ` Bernardo Innocenti
2004-01-07  0:26               ` Peter Barada
2004-01-07  1:08                 ` Bernardo Innocenti
2004-01-07  0:50                   ` Peter Barada
2004-01-07  2:20                     ` Bernardo Innocenti
2004-01-07  3:25                       ` Peter Barada [this message]
2004-01-07 10:54                       ` Andreas Schwab
2004-01-07 11:02                         ` Andreas Schwab
2004-01-07 19:42                         ` Bernardo Innocenti
2004-01-08  9:49                           ` Andreas Schwab
2004-01-08 10:32                             ` Bernardo Innocenti
2004-01-08 14:38                               ` Peter Barada
2004-01-06 22:18           ` Richard Zidlicky
2004-01-07  0:15             ` Bernardo Innocenti
2004-01-07 18:40               ` Richard Zidlicky
2004-01-07 20:58                 ` Bernardo Innocenti
2004-01-08  9:45                   ` Andreas Schwab
2004-01-08 11:56                     ` Bernardo Innocenti
2004-01-09  2:13                       ` Andreas Schwab
2004-01-08 14:37                     ` Peter Barada
2004-01-08 18:26                   ` Richard Zidlicky
2004-01-08 23:55                   ` Richard Zidlicky
2004-01-08 22:11                     ` Bernardo Innocenti
2004-01-09  0:48                       ` Richard Zidlicky
2004-01-09  5:53                         ` Bernardo Innocenti
2004-01-09 23:23                           ` Richard Zidlicky
2004-01-10 21:09                             ` Bernardo Innocenti
2004-01-11  1:35                               ` Richard Henderson
2004-01-11  6:33                                 ` Bernardo Innocenti
2004-01-11 11:55                                   ` Richard Zidlicky
2004-01-11 16:35                                     ` Andreas Schwab
2004-01-11 21:45                                     ` Bernardo Innocenti
2004-01-11 14:18                                   ` Richard Henderson
2004-01-11 18:08                                     ` Matt Thomas
2004-01-11 21:21                                       ` VAX support (was: m68k bootstrapping broken) Jan-Benedict Glaw
2004-01-11 14:59                                   ` m68k bootstrapping broken Richard Zidlicky
2004-01-11 18:01                                     ` Andreas Schwab
2004-01-11 20:10                                     ` Andreas Schwab
2004-01-11 20:37                                       ` Andreas Schwab
2004-01-11 22:25                                         ` Bernardo Innocenti
2004-01-13  2:19                                         ` Richard Zidlicky
2004-01-13 12:18                                           ` Andreas Schwab
2004-01-13 23:00                                             ` Richard Zidlicky
2004-01-14  0:59                                               ` Bernardo Innocenti
2004-01-15  0:29                                                 ` Richard Zidlicky
2004-01-15  1:16                                                   ` Bernardo Innocenti
2004-01-15 13:08                                                     ` Richard Zidlicky
2004-01-15 19:10                                                       ` Bernardo Innocenti
2004-01-15 19:35                                                         ` Andrew Pinski
2004-01-15 13:49                                                   ` Matthias Klose
2004-01-15 23:21                                               ` Bernardo Innocenti
2004-01-16  1:36                                                 ` Richard Henderson
2004-02-09  1:47                                                   ` Bernardo Innocenti
2004-02-09 14:57                                                     ` Richard Zidlicky
2004-02-15 18:34                                                       ` Bernardo Innocenti
2004-02-16 20:40                                                         ` Richard Zidlicky
2004-01-16 11:27                                                 ` Andreas Schwab
2004-01-16 19:03                                                   ` Bernardo Innocenti
2004-01-17  1:01                                                     ` Andreas Schwab
2004-01-17  1:28                                                       ` Bernardo Innocenti
2004-01-17  3:57                                                         ` Andreas Schwab
2004-01-21  0:30                                                           ` Jim Wilson
2004-01-21  0:30                                                             ` Andreas Schwab
2004-01-21  1:55                                                             ` Jim Wilson
2004-01-13 15:12                                         ` Gunther Nikl
2004-01-13 21:58                                           ` Bernardo Innocenti
2004-01-13 22:55                                             ` Richard Zidlicky
2004-01-14  0:56                                               ` Bernardo Innocenti
2004-01-15  0:00                                                 ` Richard Zidlicky
2004-01-15  0:08                                                   ` Bernardo Innocenti
2004-01-15 12:32                                                     ` Richard Zidlicky
2004-01-15 14:00                                                       ` Andreas Schwab
2004-01-16  3:34                                                         ` Richard Zidlicky
2004-01-16  3:39                                                           ` Daniel Jacobowitz
2004-01-16  4:18                                                         ` Richard Zidlicky
2004-01-15 22:10                                                       ` Bernardo Innocenti
2004-01-14 10:15                                             ` Gunther Nikl
2004-01-14 17:10                                               ` Andreas Schwab
2004-01-14 17:05                                                 ` Gunther Nikl
2004-01-14 17:13                                                   ` Andreas Schwab
2004-01-14 23:14                                                     ` Gunther Nikl
2004-01-14 18:55                                                       ` Andreas Schwab
2004-01-15  1:16                                                       ` Joe Buck
2004-01-13 17:18                                         ` Richard Zidlicky
2004-01-14  1:13                                           ` Bernardo Innocenti
2004-01-15  2:50                                         ` Bernardo Innocenti
2004-01-15  6:22                                           ` Richard Henderson
2004-01-15  9:40                                           ` Andreas Schwab
2004-01-15 14:12                                             ` Matthias Klose
2004-01-15 16:08                                               ` Richard Zidlicky
2004-01-15 23:21                                             ` Bernardo Innocenti
2004-01-13 11:04                                   ` Gunther Nikl
2004-01-13 12:14                                     ` Andreas Schwab
2004-01-13 13:24                                       ` Gunther Nikl
2004-01-14  0:46                                     ` Bernardo Innocenti
2004-01-14 10:01                                       ` Gunther Nikl
2004-01-11 11:07                               ` Richard Zidlicky
2004-01-11 16:08                                 ` Andreas Schwab
2004-01-05 20:42 ` Hans-Peter Nilsson

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=20040107032443.4428D989A3@baradas.org \
    --to=peter@the-baradas.com \
    --cc=bernie@develer.com \
    --cc=gcc@gnu.org \
    --cc=rz@linux-m68k.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).