[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NTHCDR



If you want to unroll the loop, there are yet trickier ways to do it:
	MOVN TT,(B)		;the negation is important!
	ASHC TT,-LOGN
	ASH D,LOGN-43
	AOJGE TT,BARF(D)	;the G in GE is needed if arg 2 was zeroIt is cerrtainly true that the SOJG in the tight loop would screw up
a pipelined machine; this certainly holds for the S1.  Unfortunately
for the S1, though, the tight sequence of HRRZ A,(A) or the equivalent
also bottles up in the pipeline because it is hard to index off something
you wrote into the the previous instruction.  Sigh...

LOOP:	JUMPE A,CPOPJ		;optional, and may be placed later if desired
REPEAT 1_LOGN, HRRZ A,(A)
	AOJN TT,LOOP
	JRST BARF(D)

REPEAT 1_LOGN, HRRZ A,(A)
BARF:	POPJ P,
If the JUMPE test is included for early cutoff, I suggest that LOGN==3;
otherwise probably LOGN==2 will suffice.
By the way, it is astonishing that the compiled NCDR won, when
you consider that is was calling %CDDDDR out-of-line!