This is the mail archive of the
cgen@sources.redhat.com
mailing list for the CGEN project.
Re: simulator "branch"
- To: Johan Rydberg <johan dot rydberg at netinsight dot se>
- Subject: Re: simulator "branch"
- From: Ben Elliston <bje at redhat dot com>
- Date: Tue, 12 Dec 2000 07:17:30 +1100 (EST)
- Cc: <cgen at sources dot redhat dot com>
(dni jalr "jalr"
(DELAY-SLOT)
"l.jalr $rA"
(+ OP1_0 OP2_5 OP22_0 OP23_1 rA uimm-16)
(sequence((WI tmp-slot))
(set tmp-slot rA)
(set (reg h-gr 11) (add pc 4))
(set pc tmp-slot))
()
)
(dni sys "sys"
(DELAY-SLOT)
"l.sys ${uimm-16}"
(+ OP1_0 OP2_5 OP22_2 OP23_0 rA uimm-16)
(set pc #xc00)
()
)
Both insn are (from my point of view) very simple and should not
create any problems (I guess). But when simulating them, the last
insn ("sys") doesn't effect the program counter. Here's the trace.
0x001230 #139 uos_msgsnd l.sys 0x1 - pc <- 0xc00
0x001234 #139 uos_msgsnd l.nop -
0x001238 #139 uos_msgsnd l.nop -
First and foremost, you should be using the (delay ..) rtx and let CGEN
infer the DELAY-SLOT attribute:
(delay 1 (set pc #xc00))
Does that help?
Ben