Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!uunet!seismo!rochester!pt!sei!sei.cmu.edu!firth
From: firth@sei.cmu.edu (Robert Firth)
Newsgroups: comp.lang.c,comp.lang.forth,comp.lang.misc
Subject: Re: The winner!
Message-ID: <1946@aw.sei.cmu.edu>
Date: Tue, 21-Jul-87 08:19:13 EDT
Article-I.D.: aw.1946
Posted: Tue Jul 21 08:19:13 1987
Date-Received: Wed, 22-Jul-87 06:49:33 EDT
References: <398@sugar.UUCP> <8326@utzoo.UUCP>
Sender: netnews@sei.cmu.edu
Reply-To: firth@bd.sei.cmu.edu.UUCP (PUT YOUR NAME HERE)
Organization: Carnegie-Mellon University, SEI, Pgh, Pa
Lines: 37
Xref: mnetor comp.lang.c:3188 comp.lang.forth:106 comp.lang.misc:558

In article <8326@utzoo.UUCP> henry@utzoo.UUCP (Henry Spencer) writes:
>> Using direct threaded code, you can actually implement both NEXT and DOCOL
>> in one instruction apiece. 
>> 
>> NEXT:
>> 	jmp (IP)+
>> 
>> DOCOL:
>> 	jsr (IP),
>> 
>> I challenge anyone to come up with a faster interpreter anywhere (how can
>> you beat one instruction?)...
>
>Given that that one instruction takes 1.68 us in the first case and 3.7 in
>the second, this being on a relatively fast 11 (the 44), I would say it is
>pretty easy to come up with a faster interpreter on something like a MIPS
>machine...

On the M/500, the first sequence would be

	jr ip
	addiu ip,ip,4

and execute in 2 cycles. (of course, the second instruction executes
in the branch delay slot of the first).

Likewise, the second would be

	jal 
	sw rl,(ip)

similarly.  (The jal instruction saves the return address in rl and the
second instruction again executes in the delay slot).

On our M/500, the time taken is about 250 ns for each sequence.

Can anyone beat THAT?