X11 Unix squeak on B&W displays

John M McIntosh johnmci at smalltalkconsulting.com
Fri Apr 5 23:24:28 UTC 2002


>Hi,
>
>After a bit of work, I have NetBSD running on my old 68k powerbook.
>Ian's Squeak-3.1beta-4478-src.tar.gz builds and runs just fine (well,
>for carefully selected definitions of fine), as long as I send the
>display to another system because NetBSD on my hardware only supports
>B&W.  I can see in sqXWindow.c in SetUpPixmap where the visual class
>is checked and then errors when it is B&W.

Besides with a cup of coffee and the MC68030 User Manual or the 68000 
programmer reference manual on hand you can easily figure out how 
long those assembler instructions take and removing one actually 
improves performance!!!! Unlike RISC stuff with multiple execution 
units.

Bruce a few things to check
first ensure you are using a gnuified interp.c

For gcc I was doing
-O3 -m68040 -m68881 -fomit-frame-pointer /*makes debugging impossible*/


Also I added my sqGnu.h changes for jumptableR

#define BREAK		goto *jumpTableR[currentBytecode]

&&
     &&_250, &&_251, &&_252, &&_253, &&_254, &&_255 \
   }; \
   register void **jumpTableR JP_REG; \
   jumpTableR = &jumpTable[0]

&&
# define JP_REG asm("a3")

that makes the jump
movel a3@(d7:l:4),a0
mp a0@

versus the old code which is

lea _jumpTable.325,a0
movel a0@(d7:l:4),a0
jump a0@

I think it is 8 clock cycles faster when we avoid the lea. I'd guess 
the _jumpTable.325 resolves to register+offset

Note that is for each bytecode executed! So it does have an impact on 
performance.

This changes bytecodes/sec
1,439,884. 51098 sends/sec
to
1,550,387. 55080

For interest sake I did a global var based interp.c and found

movel _receiver,a0

becomes

movel a6@(148),a0

I think the _receiver resolves to a PC+displacement
so the cost is the same, mind overall it's a bit higher because we must setup
a6 in each routine, whereas the register used by _receiver is static. 
So going to a global structure for 68K isn't going to work in GCC.

-- 
--
===========================================================================
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================



More information about the Squeak-dev mailing list