From mboxrd@z Thu Jan 1 00:00:00 1970 From: lehotsky@earthlink.net To: cgen@sourceware.cygnus.com Subject: branch-delay slot semantics questions Date: Fri, 11 May 2001 05:13:00 -0000 Message-id: <200105111205.IAA04658@iron.> X-SW-Source: 2001-q2/msg00048.html 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).