From: lkcl Date: Thu, 28 Jan 2021 17:18:53 +0000 (+0000) Subject: (no commit message) X-Git-Tag: convert-csv-opcode-to-binary~269 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3f52776c812ccf64306422404cf483a13302ce9e;p=libreriscv.git --- diff --git a/openpower/sv/bitmanip.mdwn b/openpower/sv/bitmanip.mdwn index 7a6bf065a..87c0153d6 100644 --- a/openpower/sv/bitmanip.mdwn +++ b/openpower/sv/bitmanip.mdwn @@ -20,8 +20,6 @@ minor opcode allocation | dest | src1 | subop | op | | ---- | ---- | ----- | -------- | | RT | RA | .. | bmatflip | -| RT | RA | size | crc32 | -| RT | RA | size | crc32c | 2-op and variants @@ -553,36 +551,6 @@ def gf_invert(a, mod=0x1B) : return g1 ``` -# crc - -* -* - -``` -uint_xlen_t crc32(uint_xlen_t x, int nbits) -{ - for (int i = 0; i < nbits; i++) - x = (x >> 1) ^ (0xEDB88320 & ~((x&1)-1)); - return x; -} -uint_xlen_t crc32c(uint_xlen_t x, int nbits) -{ - for (int i = 0; i < nbits; i++) - x = (x >> 1) ^ (0x82F63B78 & ~((x&1)-1)); - return x; -} -uint_xlen_t crc32_b(uint_xlen_t RA) { return crc32(RA, 8); } -uint_xlen_t crc32_h(uint_xlen_t RA) { return crc32(RA, 16); } -uint_xlen_t crc32_w(uint_xlen_t RA) { return crc32(RA, 32); } -uint_xlen_t crc32c_b(uint_xlen_t RA) { return crc32c(RA, 8); } -uint_xlen_t crc32c_h(uint_xlen_t RA) { return crc32c(RA, 16); } -uint_xlen_t crc32c_w(uint_xlen_t RA) { return crc32c(RA, 32); } -#if XLEN > 32 -uint_xlen_t crc32_d (uint_xlen_t RA) { return crc32 (RA, 64); } -uint_xlen_t crc32c_d(uint_xlen_t RA) { return crc32c(RA, 64); } -#endif -``` - # bitmatrix ```