This is the mail archive of the cgen@sources.redhat.com mailing list for the CGEN project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: simulator "branch"


     (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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]