public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
* branch-delay slot semantics questions
@ 2001-05-11  5:13 lehotsky
  2001-05-11  6:17 ` Johan Rydberg
  2001-05-13 15:41 ` Ben Elliston
  0 siblings, 2 replies; 3+ messages in thread
From: lehotsky @ 2001-05-11  5:13 UTC (permalink / raw)
  To: cgen

I found cgen pretty easy to get up and running for the most part.
It's a definitely a handy (and powerful) tool.

But I don't seem to be able to get the instruction in the "delay" slot
to execute.  My branch instructions are all of the form

       (dni "jmp"
         ...
         (delay 1
		(set pc (....)))
         ...  
       )

But my machine seems to suppress the execution of the instruction
in the delay slot, although I don't have any annul code that I'm
aware of...  (when I run the simulator with -ton, the instructions
in the delay slots are never traced.

Anything I should be looking for?  Is there something special my
mloop.in code needs to do?

Is there also any support for dealing with the semantics that
"a branch in the delay-slot is always annulled".  I think I can
implement this by having two bits in the ISA's (setup-semantics (..))
code.  

    (define-isa
      ...
      (setup-semantics (sequence
			 ()
			 (set h-annul-jmp-p h-jump-insn-p)
			 (set h-jump-insn-p (attr BI insn DELAY-SLOT))))
    )

    ; Branch instructions in the shadow of a branch are annulled.  Remember
    ; if last executed instruction was a branch
    (dsh h-annul-jmp-p "remember if last instruction was jump" ()
							       (register BI))
    (dsh h-jump-insn-p "current instruction is a jmp/ret" () (register BI))




And then in every branch instruction, if the h-annul-jmp-p is set,
then we just evaluate the jump as (nop).


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

* Re: branch-delay slot semantics questions
  2001-05-11  5:13 branch-delay slot semantics questions lehotsky
@ 2001-05-11  6:17 ` Johan Rydberg
  2001-05-13 15:41 ` Ben Elliston
  1 sibling, 0 replies; 3+ messages in thread
From: Johan Rydberg @ 2001-05-11  6:17 UTC (permalink / raw)
  To: lehotsky; +Cc: cgen

lehotsky@earthlink.net wrote:

> Anything I should be looking for?  Is there something special my
> mloop.in code needs to do?

I asked the same question a week ago or so, here's my reply from
Frank:

: Anyone got any suggestions how I should implement the delay slot
: handling in the best way?

If you're planning to build a simulator for the gdb/sim collection,
see sim/fr30/mloop.in. 


You can follow the thread here:

  http://sources.redhat.com/ml/cgen/2001-q2/msg00035.html

regards,
johan

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

* Re: branch-delay slot semantics questions
  2001-05-11  5:13 branch-delay slot semantics questions lehotsky
  2001-05-11  6:17 ` Johan Rydberg
@ 2001-05-13 15:41 ` Ben Elliston
  1 sibling, 0 replies; 3+ messages in thread
From: Ben Elliston @ 2001-05-13 15:41 UTC (permalink / raw)
  To: lehotsky; +Cc: cgen

>>>>> "lehotsky" == lehotsky  <lehotsky@earthlink.net> writes:

  lehotsky> Is there also any support for dealing with the semantics that
  lehotsky> "a branch in the delay-slot is always annulled".  I think I can
  lehotsky> implement this by having two bits in the ISA's (setup-semantics (..))
  lehotsky> code.  

On some architectures, certain classes of instructions are forbidden
in the delay slot.  If this is what you really want, it's easiest to
detect this condition during instruction extraction ("fetching").
Again, see the fr30/mloop.in for an illustration.

Ben

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

end of thread, other threads:[~2001-05-13 15:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-11  5:13 branch-delay slot semantics questions lehotsky
2001-05-11  6:17 ` Johan Rydberg
2001-05-13 15:41 ` Ben Elliston

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