summaryrefslogtreecommitdiffstats
path: root/sys/dev/syscons
diff options
context:
space:
mode:
authorrobert <robert@FreeBSD.org>2002-10-20 22:50:13 +0000
committerrobert <robert@FreeBSD.org>2002-10-20 22:50:13 +0000
commitf3c329d265a6da401af0721541a68b516c924a8d (patch)
treeaa55721b94940306bdd1bff697f5c3566130b022 /sys/dev/syscons
parentc377d3e2b439a770210d502e3fd212a05929a7a2 (diff)
downloadFreeBSD-src-f3c329d265a6da401af0721541a68b516c924a8d.zip
FreeBSD-src-f3c329d265a6da401af0721541a68b516c924a8d.tar.gz
Do not try to work around ``poor (un)sign extension code''
creation by GCC-2.6.3. Casting pointers to unsigned char to volatile pointers to unsigned char seemed to produce better results on the ia32 architecture with old versions of GCC. The current FreeBSD system compiler GCC-3.2.1 emits better sign extension code for non-volatile variables: volatile char c; int i = c; is compiled to: ... movb -1(%ebp), %al movbsl %al, %eax movl %eax, -8(%ebp) ... char c; int i = c; is compiled to: ... movbsl -1(%ebp), %eax movl %eax, -8(%ebp) ... The same holds for zero-extension of dereferenced pointers to volatile unsigned char. When compiled on alpha or sparc64, the code produced for the two examples above does not differ.
Diffstat (limited to 'sys/dev/syscons')
-rw-r--r--sys/dev/syscons/sctermvar.h12
1 files changed, 1 insertions, 11 deletions
diff --git a/sys/dev/syscons/sctermvar.h b/sys/dev/syscons/sctermvar.h
index d2c278a..b1c01af 100644
--- a/sys/dev/syscons/sctermvar.h
+++ b/sys/dev/syscons/sctermvar.h
@@ -322,17 +322,7 @@ sc_term_gen_print(scr_stat *scp, u_char **buf, int *len, int attr)
cnt = imin(l, scp->xsize - scp->xpos);
i = cnt;
do {
- /*
- * gcc-2.6.3 generates poor (un)sign extension code.
- * Casting the pointers in the following to volatile
- * should have no effect, but in fact speeds up this
- * inner loop from 26 to 18 cycles (+ cache misses)
- * on i486's.
- * XXX: out of date?
- */
-#define UCVP(ucp) ((u_char volatile *)(ucp))
- p = sc_vtb_putchar(&scp->vtb, p,
- UCVP(map)[*UCVP(ptr)], attr);
+ p = sc_vtb_putchar(&scp->vtb, p, map[*ptr], attr);
++ptr;
--i;
} while ((i > 0) && PRINTABLE(*ptr));
OpenPOWER on IntegriCloud