Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
To: Doug Evans <dje@transmeta.com>
Cc: Andrew Cagney <ac131313@redhat.com>, gdb-patches@sources.redhat.com
Subject: Re: [PATCH] fix trap in parallel for m32r-sim
Date: Tue, 20 Jan 2004 04:57:00 -0000	[thread overview]
Message-ID: <000801c3df12$cf9ec4c0$2569910a@tool.maec.co.jp> (raw)
In-Reply-To: <16396.25248.771893.16597@claire.transmeta.com>

> Ah hah!  So this is about TRAP_SYSCALL. :-)
> TRAP_SYSCALL is a simulator-only facility to simplify printf,exit,etc.
Yes. It's only for executing a system call hook routine.
The parallel execution is no problem if a trap is not for system
calls(TRAP_SYSCALL etc.).
A trap instruction doesn't need a result of second insn. (A trap is like a
jump instruction.)
A trap handler routine needs a result of second insn.
A m32r_trap() also executes a trap handler routine.

> I gather you want r0 to be 1 before the trap is taken,
> violating standard parallel execution semantics: all inputs
> read before any outputs written.
> i.e. you want the trap to _read_ the value of r0 and get 1.
> This is different than the violation I refered to previously
> where the trap will _write_ the value of r0, say, before
> other insns have read their inputs.
>
> It seems like you're trying to fix a broken program by breaking
> (or at least hacking) the simulator.  How about instead just having
> a rule that says the TRAP_SYSCALL trap cannot be paired with instructions
> that set up inputs for the syscall?  This would be no different
> than trying to make
>
>     asm ("add r1,r0 || ldi r0,#1"); // increment r1 by 1
>
> work.  It doesn't work because the `add' will read the value of r0
> before the ldi has set it to 1.
> [apologies if I got the syntax wrong, haven't programmed m32r
> assembler in a while :-)]

> the TRAP_SYSCALL trap cannot be paired with instructions
> that set up inputs for the syscall
....(--;)

The following patch is only for a trap in parallel.
http://sources.redhat.com/ml/gdb-patches/2004-01/msg00497.html



  reply	other threads:[~2004-01-20  4:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-16  3:26 Kazuhiro Inaoka
2004-01-16  3:43 ` Doug Evans
2004-01-16  5:56   ` Kazuhiro Inaoka
2004-01-16 21:11     ` Doug Evans
2004-01-19  6:29       ` Kazuhiro Inaoka
2004-01-19 23:05         ` Doug Evans
2004-01-20  4:57           ` Kazuhiro Inaoka [this message]
2004-01-27  3:53         ` Andrew Cagney

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='000801c3df12$cf9ec4c0$2569910a@tool.maec.co.jp' \
    --to=inaoka.kazuhiro@renesas.com \
    --cc=ac131313@redhat.com \
    --cc=dje@transmeta.com \
    --cc=gdb-patches@sources.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