public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
* simulator "branch"
@ 2000-12-11 10:29 Johan Rydberg
  2000-12-11 12:17 ` Ben Elliston
  0 siblings, 1 reply; 4+ messages in thread
From: Johan Rydberg @ 2000-12-11 10:29 UTC (permalink / raw)
  To: cgen

Hi!

I have defined two insn that looks like this;

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

0x000da0 #37   printf          l.jalr r11        - gr-11 <- 0xda4, pc <- 0x192c
0x000da4 #37   printf          l.nop             -
0x00192c #23   task1           l.sb -43(r2),r4   - memory <- 0x0

I have looked at the generated sematic code, and I can't find any 
different between them that could cause this result.  Any ideas ?

-- 
johan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: simulator "branch"
  2000-12-11 10:29 simulator "branch" Johan Rydberg
@ 2000-12-11 12:17 ` Ben Elliston
  2000-12-11 12:33   ` Johan Rydberg
  0 siblings, 1 reply; 4+ messages in thread
From: Ben Elliston @ 2000-12-11 12:17 UTC (permalink / raw)
  To: Johan Rydberg; +Cc: cgen

     (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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: simulator "branch"
  2000-12-11 12:17 ` Ben Elliston
@ 2000-12-11 12:33   ` Johan Rydberg
  2000-12-11 12:38     ` Ben Elliston
  0 siblings, 1 reply; 4+ messages in thread
From: Johan Rydberg @ 2000-12-11 12:33 UTC (permalink / raw)
  To: Ben Elliston; +Cc: cgen

Ben Elliston wrote:

> 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?

Yes.  When will all this pretty needfull stuff hit the documentation ?

-- 
Johan Rydberg, Net Insight AB, Sweden, +46-8-685 04 00

$ ON F$ERROR("LANGUAGE","ENGLISH","IN_MESSAGE").GT.F$ERROR("NORMAL") -
             THEN EXCUSE/OBJECT=ME

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: simulator "branch"
  2000-12-11 12:33   ` Johan Rydberg
@ 2000-12-11 12:38     ` Ben Elliston
  0 siblings, 0 replies; 4+ messages in thread
From: Ben Elliston @ 2000-12-11 12:38 UTC (permalink / raw)
  To: Johan Rydberg; +Cc: cgen

   Yes.  When will all this pretty needfull stuff hit the documentation ?

Ah -- I see the (delay ..) rtx is not documented!  I'll do so.

Ben

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2000-12-11 12:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-12-11 10:29 simulator "branch" Johan Rydberg
2000-12-11 12:17 ` Ben Elliston
2000-12-11 12:33   ` Johan Rydberg
2000-12-11 12:38     ` 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).