* one more alignment trap
@ 1996-05-07 7:56 Harald Koenig
0 siblings, 0 replies; only message in thread
From: Harald Koenig @ 1996-05-07 7:56 UTC (permalink / raw)
my first fix for s3im.c wasn't sufficient. there may be odd addresses
too which was showed by some "x11perf" runs last night.
so here is a more gerenal (and ugly) fix relative to the original sources.
I havent tested this one (only compiled,not run yet) so look at it
and be careful.
Harald
-------------------------------------------------------------------------------
--- /soft/r6/xc/programs/Xserver/hw/xfree86/accel/s3/s3im.c.Df Sun Apr 28 23:56:35 1996
+++ /soft/r6/xc/programs/Xserver/hw/xfree86/accel/s3/s3im.c Tue May 7 09:49:40 1996
@@ -882,7 +882,7 @@
short *psrcs = (short *)&psrc[px*s3Bpp];
for (i = 0; i < w; ) {
if (s3InfoRec.bitsPerPixel == 32) {
- outl (PIX_TRANS, *((long*)(psrcs)));
+ outl (PIX_TRANS, *((int*)(psrcs)));
psrcs+=2;
i += 4;
}
@@ -1164,11 +1164,48 @@
((unsigned char *)(ptmp) + (srcx >> 3));
x2 = srcx & 7; /* Offset within byte. */
if( np >= 16 ) {
+#ifdef __alpha__ /* alignment check */
+ switch ((long)pnt & 3) {
+ case 0:
pix = (unsigned short)(*((unsigned int *)(pnt)) >> x2);
+ break;
+ case 2:
+ pix = (unsigned short)((*pnt | (*(pnt+1)<<16)) >> x2);
+ break;
+ default:
+ pix = (unsigned short)(( ((unsigned char *)(pnt))[0]<<0 |
+ ((unsigned char *)(pnt))[1]<<8 |
+ ((unsigned char *)(pnt))[2]<<16 |
+ ((unsigned char *)(pnt))[3]<<24 ) >> x2);
+ break;
+ }
+#else
+ pix = (unsigned short)(*((unsigned int *)(pnt)) >> x2);
+#endif
}
else if( pw >= 16 ) {
+#ifdef __alpha__ /* alignment check */
+ switch ((long)pnt & 3) {
+ case 0:
pix = (unsigned short)((*((unsigned int *)(pnt)) >> x2)
- & MSKBIT(np)) | (*ptmp << np);
+ & MSKBIT(np)) | (*ptmp << np);
+ break;
+ case 2:
+ pix = (unsigned short)(((*pnt | (*(pnt+1)<<16)) >> x2)
+ & MSKBIT(np)) | (*ptmp << np);
+ break;
+ default:
+ pix = (unsigned short)(((((unsigned char *)(pnt))[0]<<0 |
+ ((unsigned char *)(pnt))[1]<<8 |
+ ((unsigned char *)(pnt))[2]<<16 |
+ ((unsigned char *)(pnt))[3]<<24 ) >> x2)
+ & MSKBIT(np)) | (*ptmp << np);
+ break;
+ }
+#else
+ pix = (unsigned short)((*((unsigned int *)(pnt)) >> x2)
+ & MSKBIT(np)) | (*ptmp << np);
+#endif
}
else if( pw >= 8 ) {
pix = ((*pnt >> x2) & MSKBIT(np)) | (*ptmp << np)
-------------------------------------------------------------------------------
--
All SCSI disks will from now on ___ _____
be required to send an email notice 0--,| /OOOOOOO\
24 hours prior to complete hardware failure! <_/ / /OOOOOOOOOOO\
\ \/OOOOOOOOOOOOOOO\
\ OOOOOOOOOOOOOOOOO|//
Harald Koenig, \/\/\/\/\/\/\/\/\/
Inst.f.Theoret.Astrophysik // / \\ \
koenig@tat.physik.uni-tuebingen.de ^^^^^ ^^^^^
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1996-05-07 7:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-05-07 7:56 one more alignment trap Harald Koenig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox