diff options
author | Bruce Evans <bde@FreeBSD.org> | 1995-07-11 17:59:22 +0000 |
---|---|---|
committer | Bruce Evans <bde@FreeBSD.org> | 1995-07-11 17:59:22 +0000 |
commit | f2fb20ef418071bf3a5c9a0aebc74706d6b2123e (patch) | |
tree | eb18f83b13329d9bbc72e3d9c0acaeddf26c2f7c /sys/i386/isa/syscons.c | |
parent | 7fbcd76bb50fd98fff8da456970236cc417dd917 (diff) | |
download | src-f2fb20ef418071bf3a5c9a0aebc74706d6b2123e.tar.gz src-f2fb20ef418071bf3a5c9a0aebc74706d6b2123e.zip |
Speed up the inner loop of ansi_put() by a few percent.
syscons' output is now only about 4-5 times slower than I want.
It loses a factor of 2 for scrolling output by unnecessarily copying
the screen buffer, a factor of 4/3 for dumb OPOST processing, and
a factor of 3/2 for clist processing.
Notes
Notes:
svn path=/head/; revision=9483
Diffstat (limited to 'sys/i386/isa/syscons.c')
-rw-r--r-- | sys/i386/isa/syscons.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/i386/isa/syscons.c b/sys/i386/isa/syscons.c index 9591c71f1f4d..28e543324968 100644 --- a/sys/i386/isa/syscons.c +++ b/sys/i386/isa/syscons.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: syscons.c,v 1.117 1995/05/30 08:03:13 rgrimes Exp $ + * $Id: syscons.c,v 1.118 1995/06/14 05:16:12 bde Exp $ */ #include "sc.h" @@ -1860,7 +1860,15 @@ outloop: u_short cur_attr = scp->term.cur_attr; u_short *cursor_pos = scp->cursor_pos; do { - *cursor_pos++ = (scr_map[*ptr++] | cur_attr); + /* + * 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. + */ +#define UCVP(ucp) ((u_char volatile *)(ucp)) + *cursor_pos++ = UCVP(scr_map)[*UCVP(ptr)] | cur_attr; + ptr++; cnt--; } while (cnt && PRINTABLE(*ptr)); len -= (cursor_pos - scp->cursor_pos); |