Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site ncrcae.UUCP
Path: utzoo!linus!decvax!mcnc!ncsu!ncrcae!wescott
From: wescott@ncrcae.UUCP (Mike Wescott)
Newsgroups: net.lang.c
Subject: Re: Re: Casting Pointers -- fast *portab - (nf)
Message-ID: <2011@ncrcae.UUCP>
Date: Mon, 20-Feb-84 22:43:10 EST
Article-I.D.: ncrcae.2011
Posted: Mon Feb 20 22:43:10 1984
Date-Received: Wed, 22-Feb-84 04:29:25 EST
References: <2482@fortune.UUCP>
Organization: NCR, Columbia, SC
Lines: 27

[]
> And of course (?) everyone knows by now (?) that you can get even better
> with a 68000 by using the move-multiple-long (register load/store)
> instructions to eat and spew big gulps.
>        .
>        .
>        .
> (See the code for "blt" that comes with the the MIT "C" compiler.)

You can also get into trouble if you're not careful. The version
of "blt" we used here worked just fine, until it pointed out a
microcode bug in the MC68000 for us. The movem instruction, when
fetching from memory into registers does an extra word read. The
extra word is thrown away and causes no problems, except when the
extra read crosses into an unreadable segment, in which case you
get an unwanted "segmentation violation" or "panic: kernel memory
management error."

The situation shows up (if my memory is correct), when the length
of the move is a multiple of 48 bytes and abuts an unreadable
segment ("blt" uses a 12 register movem).

I recoded it and still managed to pick up a little performance.

-Mike Wescott
 NCR Corporation, W. Columbia SC
 mcnc!ncsu!ncrcae!wescott