This is the mail archive of the
cgen@sources.redhat.com
mailing list for the CGEN project.
branch-delay slot semantics questions
- To: cgen at sourceware dot cygnus dot com
- Subject: branch-delay slot semantics questions
- From: lehotsky at earthlink dot net
- Date: Fri, 11 May 2001 08:05:19 -0400 (EDT)
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).