[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
NTHCDR
- To: (BUG LISP) at MIT-MC
- Subject: NTHCDR
- From: GLS at MIT-MC (Guy L. Steele, Jr.)
- Date: Thu, 21 Sep 78 05:35:00 GMT
- Original-date: 21 SEP 1978 0135-EDT
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!