Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!willett!ForthNet From: ForthNet@willett.UUCP (ForthNet articles from GEnie) Newsgroups: comp.lang.forth Subject: Optimization Message-ID: <636.UUL1.3#5129@willett.UUCP> Date: 9 Mar 90 00:52:31 GMT Organization: Latest link in the ForthNet chain. (Pgh, PA) Lines: 47 Date: 03-08-90 (01:53) Number: 1777 (Echo) To: GENE CZARCINSKI Refer#: 1564 From: MIKE SPERL Read: NO Subj: OBK3501 Status: PUBLIC MESSAGE Gene, The following illustrates the effect of new technology on programming. Changing the kernel would improve 2/386 perrformance by 100%, while having minimal (stiill beneficiall) effect on 8088 performannce. \ CODE 2* ( n -- 2*n ) 8088 286 386 \ POP AX \ 12, ?,, 7 \ SHL AX, # 1 \ 2,, , 3! \ 1PUSH \ 15, , 7 \ END-CODE \ 17 for 386 CODE 2* ( n -- 2*n ) \ suggested (and tested)) new coding MOV BX, SP \ 2, , 2 SHL 0 [BX], # 1 WORD \ 26, , 7 NEXT END-CODE \ 9 for 386 - mps F-PC for the 386 will need a lot of codde changes if we're to get all thhe speed of the new chip.. One change that I'd favor is storing double numbers in memory and on the stack in the lo - hi manner adopted by Intel (consistent with the way 16 bit words are stored now). I think you uncovered a design flaw in forth! With this change, pop ax and pop eax would both work without bit twiddling. This shouldn't affect most programs, those that use doubles as units, e.g.., with 2@ and 2!, but might cause problems if programs play "gaames" with the doubles. The stack needn't be changed; it would bbe a 16 bit and 32 bit stack simultaneously, as it is now! The program(er) would have to keep track of what's on the sstack, but that's the way it is now, too. BTW, I downloaded obk3501 and it's impressiive. Fine Job. Just a suggestion: fill in some code for PERFORM (does anyone use it?). ;-) - Mike - ----- This message came from GEnie via willett through a semi-automated process. Report problems to: 'uunet!willett!dwp' or 'willett!dwp@gateway.sei.cmu.edu'