MWAIT V1.02 Nick de Smith, Applied Telematics Group Ltd., Telematics House, Vale Avenue, Tunbridge Wells, Kent TN1 1DJ England +44 892 511000 (Fax: +44 892 515402) PSI%234213300154::NICK NICK@NCDLAB.ULCC.AC.UK The code in this directory provides replacements for LIB$CRC_TABLE and the VAX CRC instruction that give performance increases of up to 300% and more for short buffers and "unknown" polynomials (not one of the set (FAL:0000E905, AUTODIN-II:EDB88320 and CRC-16:0000A001). CRC.MAR Source for VAX$CRC, VAX$FAST_CRC and VAX$FAST_CRC_TABLE TEST.C Timing comparisons for various uses of the above routines. FAST_CRC_TABLE.C A 'C' version of VAX$FAST_CRC_TABLE for comparison. For short buffers, a direct replacement for LIB$CRC, or the VAX CRC instruction is given by the routine VAX$CRC: crc = VAX$CRC( table, inicrc, length, address ) table address of a 16 entry table generated by LIB$CRC_TABLE Input CRC table inicrc longword, by value Initial CRC value length longword, by value Length of input data stream address address of "length" bytes of data Data on which to perform the checksum For really fast CRCs, use VAX$FAST_CRC. uses the same parameters as VAX$CRC, except that the CRC table parameter is 256 longwords generated by VAX$FAST_CRC_TABLE. If the stream length is less than 4 bytes, VAX$FAST_CRC will generate an SS$_BADPARAM signal. To be even faster, align the data buffer on a longword boundary, and use buffers that are a multiple of 4 bytes long. crc = VAX$FAST_CRC( table, inicrc, length, address ) table address of a 256 entry table generated by VAX$FAST_CRC_TABLE Input CRC table (see VAX$FAST_CRC_TABLE). inicrc longword, by value Initial CRC value length longword, by value Length of input data stream address address of "length" bytes of data Data on which to perform the checksum To generate the 256 entry (8 bit) shift tables used by VAX$FAST_CRC, use void VAX$FAST_CRC_TABLE( polynomial, table ) polynomial longword, by reference initial polynomial value, eg. 00008408 for CCITT table address of a 256 entry longword table 8 bit shift table for use by VAX$FAST_CRC. [end]