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

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