|
From: Nicholas N. <nj...@cs...> - 2005-05-19 13:12:41
|
On Thu, 19 May 2005, Julian Seward wrote: > So, what I'm thinking is to calculate a 32-bit CRC of the code > and store it in the translation; then rerun the crc for the > self-check. Except a CRC is expensive in terms of insns and > cache misses (it requires a table). Mark Adler (co-author > of gzip) had some other magic checksum scheme that gzip uses, which > doesn't require a table and is fast. Maybe use that instead. The good thing is that the checksum doesn't need to be very good, since false collisions will only cause extra translations to be executed. Something incredibly simple like adding up each byte of code (modulo 256) might be good enough. N |