From: Andrew Cagney <ac131313@redhat.com>
To: Richard Sandiford <rsandifo@redhat.com>, cgd@broadcom.com
Cc: gdb-patches@sources.redhat.com
Subject: Re: sim/mips patch: add support for more NEC VR targets
Date: Tue, 26 Nov 2002 16:55:00 -0000 [thread overview]
Message-ID: <3DE417F8.8030209@redhat.com> (raw)
In-Reply-To: <wvnu1i4sdpd.fsf@talisman.cambridge.redhat.com>
> :function:::int:check_mf_cycles:hilo_history *history, signed64 time, const char *new
> {
> + /* There are no timing requirements in vr5500 code. */
> + if (MIPS_MACH (SD) == bfd_mach_mips5500)
> + return 1;
> if (history->mf.timestamp + 3 > time)
> {
> sim_engine_abort (SD, CPU, CIA, "HILO: %s: %s at 0x%08lx too close to MF at 0x%08lx\n",
Just this,
Add:
function:::int:check_mf_cycles:hilo_history *history, signed64 time,
const char *new
*vr5500
{
return 1;
}
and then tag the old function with the other CPU variants.
that way
if (MIPS_MACH (SD) == bfd_mach_mips5500)
is not needed and the compiler can (if configured with sufficient
inlining) eliminate the entire function call.
This post:
http://sources.redhat.com/ml/gdb-patches/2002-11/msg00512.html
> We have had very bad experiences with trying to make a single function
> serve two different ABI's in the past. (mips_push_arguments seems to
> have been cleaned up since I last looked; it was a real mess.) So
> while using things like 'REGISTER_SIZE' and
> 'S390_STACK_PARAMETER_ALIGNMENT' are clearly a good idea, for the sake
> of the other stuff I'd like to see a separate 's390x_push_arguments'
> function written that does things right for the s390x's ABI. The
> helper functions like `is_simple_arg' should be duplicated, rather
> than testing GDB_TARGET_IS_ESAME.
Gives the thrust of the rationale. Namely, its better to, from the
start, have separate independant functions and not confuse things by
adding more and more if(ISA/ABI) specific gunk. As JimB noted, the MIPS
is the not so shining example of how to do things (i.e., how things can
go wrong).
For the sim, the original gencode tried to be smart and combine isa
variants. Given the age of the code, the number of CPU variants, and
the number of developers making changes (the two are comparable and both
are large!), it ended to end up with a total mess. Someone trying to
add one ISA would [always, I'm pretty sure it was] broke the other ISAs
(only discovered months later) by either also adding instructions to
other ISAs or, worse, removing/changing existing instructions. Ulgh!
IGEN and MIPS.IGEN gave up.
Instead, the developer gets to spend a few minutes adding an ISA
selector to every relevant instruction. That's in the noise when
compared to the amount of time that needs to be spent auding the
instruction set looking for where the vendor has an instruction variant
that deviates from the official spec (how many mul/adds are there?). In
the case of a variant, the instruction can cloned, taged and changed
with the absolute certaintity that it won't break any other instruction,
because none of the other instructions / ISAs are affected.
So, while this might sux from an asthetic point of view, it definitly
doesn't sux from the point of view of being able to confidently, quickly
and reliably update the simulator.
(cgd, does this answer your question?)
Andrew
next prev parent reply other threads:[~2002-11-27 0:55 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-04 9:44 Richard Sandiford
[not found] ` <mailpost.1033749908.1650@news-sj1-1>
2002-10-04 10:54 ` cgd
2002-10-09 7:14 ` Richard Sandiford
2002-10-22 15:27 ` cgd
2002-11-05 8:20 ` Richard Sandiford
2002-11-06 10:44 ` cgd
2002-11-06 14:46 ` cgd
2002-11-06 15:08 ` cgd
2002-11-26 4:44 ` Richard Sandiford
[not found] ` <mailpost.1038314670.25092@news-sj1-1>
2002-11-26 12:49 ` cgd
2002-11-26 16:55 ` Andrew Cagney [this message]
[not found] ` <mailpost.1038358543.15485@news-sj1-1>
2002-11-26 17:48 ` cgd
2002-11-26 19:10 ` Andrew Cagney
[not found] ` <mailpost.1038366650.19029@news-sj1-1>
2002-12-03 9:17 ` cgd
2002-12-03 9:35 ` Andrew Cagney
2003-01-05 7:57 ` cgd
2003-01-05 11:51 ` Richard Sandiford
[not found] ` <mailpost.1041767504.18587@news-sj1-1>
2003-01-06 7:18 ` cgd
2002-11-06 16:46 ` Andrew Cagney
2002-11-06 17:28 ` cgd
2002-11-06 17:40 ` Andrew Cagney
2002-11-07 11:08 ` cgd
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=3DE417F8.8030209@redhat.com \
--to=ac131313@redhat.com \
--cc=cgd@broadcom.com \
--cc=gdb-patches@sources.redhat.com \
--cc=rsandifo@redhat.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