[eris]<purcell>memo>TamarinOps.memo	17-Jul-85 17:31:55

Dynamic instruction statistics collectd June 81 by Dorado PC sampling of program "TEST".
Static instruction statistics collectd Oct 84 from <LISPCORE>NEXT>FULL.SYSOUT.

Name	Size   %Dynamic %Static WAddr← @ RAddr Op IB  	Misc	Stack	TagTrap	PreCond	Context
----	----   --------	------- ------ - ----- -- -- 	----	-----	-------	-------	-------
(1) Constants	
SCn	1	11	6	<S+1> ←	<CON n>		S←S+1
SIC	1	4	2	<S+1> ←	  	IB			S←S+1
SICX	2	5	0.5	<S+1> ←   	IDB			S←S+1
GCONST	5	1?	1	<S+1> ←   	IQB			S←S+1
ACONST	3,4	2?	4	<S+1> ←	<NIL> + IDB		S←S+1
COPY	1	3	3	<S+1> ←	<S>			S←S+1
POP		5	6	<S-1> ←	<S-1>			S←S-1

(2) Variables
VARn	1	19     16	<S+1> ←	<n>			S←S+1
VARX	2	3	3	<S+1> ←	<X>			S←S+1
VARM	2	0.05?	0.05?	<S+1> ←	@[<'Fx>, IB]		S←S+1
GVAR	3,4	3	2	<S+1> ←	@[<'Val>,IDB]		S←S+1
FVARn	1	2	2?	<S+1> ←	@[<n>]			S←S+1	BoundP
FVARn←	1	0.5?	0.5		@[<n>] ← <S>	*****	S←S-1	StackP		
VARn←	1	2	2	<n>   ←	<S>			
VARn←↑	1	2	1	<n>   ←	<S>			S←S-1
VARX←	2	1?	1?	<IB>  ←	<S>			S←S-1
VARIX	2	?	?	<S+1> ←	@[<IB>]			S←S+1	DirectP

(3) Stack
UNBIND	2	1	1	<IB>  ←	<S>		S←IB
DUNBIND	2	1	1	<IB>  ←	<IB>		S←IB

(4) Arithmetic
GREATERP	1	1	<S-1> ←	[<S> - <S-1>]NMINUSP	S←S-1	IntegerP2
PLUS		1	1	<S-1> ←	<S> + <S-1>		S←S-1	IntegerP3
DIFF		1	1	<S-1> ←	<S> - <S-1>		S←S-1	IntegerP3
AND		1	0.3	<S-1> ←	<S> AND <S-1>		S←S-1	IntegerP2
LLSH		1	1	<S>   ←	<S> FU 0			IntegerP3
LRSH		1	1	<S>   ←	<S> FU <S>			IntegerP2
OR		?	?	<S-1> ←	<S> OR <S-1>		S←S-1	IntegerP2
XOR		?	?	<S-1> ← <S> XOR <S-1>		S←S-1	IntegerP2

(5) Memory
GETPTR	2	1	2	<S>   ← @[<S> + IB]			PointerP
PUTPTR	2	3	2   		@[<S-1>+IB] ← <S> Rev?	S←S-1	PointerP
PUTPTR↑	2	?	?   		@[<S-1>+IB] ← <S> Rev?	S←S-2	PointerP
ADDBASE	1	1	0.4	<S-1> ←	<S> + <S-1>		S-S-1	IntegerP1

(6) Lists/Types
CAR	1	2	3	<S>   ←	@[<S>]				ListP
CDR	1	2	3	<S>   ←	@[<S>,,1]			ListP
TYPEPn	1	1?	1       <S> ←IF	<S>		LispP THEN ←NIL	(UserLispP)
DTESTn	1	?	?	<S>   ←	<S>				<n>P
TYPEP	2	1	0.4     <S> ←IF	@['TypeTable,<S>] #IB THEN ←NIL	(UserLispP)
DTEST	2	0	2	     IF	@['TypeTable,<S>] #IB THEN Trap	DTestP

(7) Control									
RET		3	2	<S+1> ←	<S>	     		S←S+1	SlowRet PreLoad	←prev
RETNV		3	2	<S>   ←	<S>    				SlowRet	PreLoad	←prev
RETEI		3	2	<S>   ←	<S>		EnbInt		SlowRet PreLoad	←prev
PAGEFAULT			<S+1> ←	<'MDR>	DisInt	arg ← 1			GOTO[TRAP]
TRAPn (Interrupts)	        <Code>←	@[<'FnDef>,,n] 					GOTO[Call]
APPLYFN	1	?	0.1	'arg  ←	<S-1>					
			        <Code>←	@[<'FnDef>,,<S>] 		AtomP		GOTO[Call]
FNn	3,4	3	7       <Code>←	@[<'FnDef>,,IDB]  arg ← n		PreDump GOTO[Call]
Call:				<'R0> ←	@4[<'Code>]					PC ← ,,arg
				<'All>←	<'Unbind>  					cur ← next
				<arg> ←	<old S>     	    	S←S-1	until arg=0	arg←arg-1
ENBINT	1	-	-				EnbInt
DISINT	1	-	-				DisInt
TAILFNX	4,5

(8) Jumps
NOPn	1-5	1?	1?		NOP	
JUMP	1	1	1	PC    ← PC + n
JUMPX	2	1	2	PC    ← PC + sIB
JUMPXX	3,5	1	1	PC    ←	PC + sIDB			
TFJUMP	1	6	4	PC    ← PC + sIB  IF <S>EQ<NIL>	S←S-1
TFJUMPX	2	2	2	PC    ← PC + sIB  IF <S>EQ<NIL>	S←S-1	
NTFJMPX	2	4	2	PC    ← PC + sIB  IF <S>EQ<NIL>	(S←S-1)
JEQ?	2	3	3	PC    ← PC + sIB  IF <S-1>EQ<S>	S←S-2	EQL
JGREATERP? 2	1	1	PC    ← PC + sIB  IF <S-1>GT<S>	S←S-2
JLISTP?	2	1	1	PC    ← PC + sIB  IF LISTP <S>  S←S-2
JREFILL	-	8?	-	<'IB> ← @4[<PC>]					GOTO[IREFILL]
IREFILL	-	12	-	<'IB> ← @4[<PC+4>]

(9) Frames
MYCLINK	1	-	-	<S+1> ←	<CLink>		S←S+1		PreFlush
MYCLINK← 1	-	-	<CLnk>←	<S>					PreFlush
REFRESH(2ms)	0.01		arg   ← N
				<arg> ←	<arg>		arg←arg-1		until arg=0
DUMP		.1			@4[<'Free>,arg] ← <arg←0>  arg←arg+4	until arg=TOS
				<CLnk>←	<Free>
				<Free>← @[<Free>,,next]
				
LOAD		.1		<Free>←	<CLnk>	arg←0
				<arg> ← @4[<FX>]	arg←arg+4		until arg=TOS


(10) Misc
CSTORE	?
BLTSTEP		?
BITBLTSTEP	?
FVLOOKSTEP	?
REFCNT		?
GCSCANSTEP?	?
	EXDIS			<S-1>	← <S>			S←S-1
	ADDB			<S>	← <S> + IB
	ADDDB			<S>	← <S> + IDB
	SUBB			<S>	← <S> - IB
	RSB			<S+1>	← @[<S> + IB]		S←S+1	
	WB		      @[<S>+IB] ← <S-1>			S←S-2	
	WSB		    @[<S-1>+IB] ← <S>			S←S-2	


(11) Macros
'NIL		2	2	SC0
'T		1	1	SC1
'0		1	1	SC2
'1		1	1	SC3
'UNBIND		1	1	SC4
SNIC		?	0.1	'0 SNIC DIFF
SWAP		0.1	0.1?	?
IVARn 		11	8	VARn
PVARn		8	8	VARn
PVARX		3	3	VARn or VARX or VARM
LISTP		?	1	TYPEP0
INTEGERP	?	?	TYPEP1
FLOATP		?	?	TYPEP2
TYPEMASK	?	?	?
BIND (2NIL 1PV)	1	1	VAR←↑, 'NIL, VAR←, VAR←↑
UNBIND1 (2NIL 1PV)	0.3	'UNBIND, VAR←, VAR←, VAR←↑
GETBASE	4	2	1	GETBASEPTR, GETFIELD	
GETBITS	3 fd, n	1?	0.2	
	4			GETBASEPTR n, GETFIELD fd
	7			GETBASEPTR n, RSHIFT fd, SICXX, AND
GETBYTE		3	0.1		
PUTBASE		1	0.4	<ptr>,GETBASEPTR,<val>,PUTFIELD,PUTBASEPTR	
PUTBITS	3 fd, n	1?	0.2
	6			<ptr>,GETBASEPTR,<val>,PUTFIELD,PUTBASEPTR
				<ptr>,GETBASEPTR,<val>, LSHIFT fd, G
PUTBYTE		3	0.0	RSH, ADDBASE, GETBASEPTR,<val>,PUTFIELD,PUTBASEPTR	

(12) UFNs
CONTEXTSWITCH(n)
	Temp ← (MYCLINK)
	MYCLINK← ContextTable(n)
	ContextTable(n) ← Temp
	RETEI

INTERRUPT
	n ← (InteruptNo)
	Temp ← (MYCLINK)
	MYCLINK← ContextTable(n)
	ContextTable(n) ← Temp
	RETURN
	
	
UFN1 XOP1(32)
	GETBYTE	3%
	PUTBYTE	3%
	GETWORD
	PUTWORD
	VAG2	1%
	NTYPX ?
	BIN
	ELT
	UNBOX
	UNBOX2
	INTEGERTRAP
	BOX 
	
UFN2 XOP2 (11)
	RPLPTR
	GCREF
	
UFN2 XOP2 MISC (256)
	APPLYFN
	CHECKAPPLY
	RPLACA
	RPLACD
	CONS
	GETP
	FMEMB
	GETHASH
	PUTHASH
	CREATECELL
	BOUT
	BITBLT
	NTHCHC
	SETA
	RPLCHARCODE
	EVAL
	\RETURN
	ARG0
	MYARGCOUNT
	MYALINK
	TIMES2
	QUOTIENT
	ITIMES2
	FPLUS2
	FDIFF
	FTIMES2
	FQUOTIENT
	FGREATERP
	FLOATP
	NUMBERP
	
XOP3 (23)
	GVAR←
	GETBITS
	PUTBITS	
	
XOP5 (29)
	PUTBITS
	



30-Oct-84 11:42:26	File started
14-Jul-85 14:53:29	first pass of microcode

DISCUSSION


Independence of VM Mapping from instruction PLA

I assume that a Map Entry Cache miss will be rapidly turned into a Map Entry memory fetch and that the new Map Entry will be chached and the memory fetch will be resumed without microcode intervention.

When the Instruction Fetch Unit prefetches instructions, the prefetcher conceptually has a slightly different PD than the instruction decoder's PC. 



Issues
  ufn's
  Atom representation
  types and tags
  multi value return
   VMM
  opcodes
  interpreter
  C.L. catch throw
  Interloops

 UNBOXED bits on stack for GETBITS and PUTBITS
 RefCnt?