Skip to content

Commit

Permalink
Removed ut_crc32_byte_by_byte: never used
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Vojtovich committed Nov 23, 2017
1 parent e69466d commit 62ce8ce
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 52 deletions.
4 changes: 0 additions & 4 deletions storage/innobase/include/ut0crc32.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ extern ut_crc32_func_t ut_crc32;
when converting byte strings to integers internally. */
extern ut_crc32_func_t ut_crc32_legacy_big_endian;

/** Pointer to CRC32-byte-by-byte calculation function (byte order agnostic,
but very slow). */
extern ut_crc32_func_t ut_crc32_byte_by_byte;

extern const char* ut_crc32_implementation;

#endif /* ut0crc32_h */
48 changes: 0 additions & 48 deletions storage/innobase/ut/ut0crc32.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,6 @@ ut_crc32_func_t ut_crc32;
when converting byte strings to integers internally. */
ut_crc32_func_t ut_crc32_legacy_big_endian;

/** Pointer to CRC32-byte-by-byte calculation function (byte order agnostic,
but very slow). */
ut_crc32_func_t ut_crc32_byte_by_byte;

/** Text description of CRC32 implementation */
const char* ut_crc32_implementation;

Expand Down Expand Up @@ -409,26 +405,6 @@ ut_crc32_legacy_big_endian_hw(

return(~crc);
}

/** Calculates CRC32 using hardware/CPU instructions.
This function processes one byte at a time (very slow) and thus it does
not depend on the byte order of the machine.
@param[in] buf data over which to calculate CRC32
@param[in] len data length
@return CRC-32C (polynomial 0x11EDC6F41) */
uint32_t
ut_crc32_byte_by_byte_hw(
const byte* buf,
ulint len)
{
uint32_t crc = 0xFFFFFFFFU;

while (len > 0) {
ut_crc32_8_hw(&crc, &buf, &len);
}

return(~crc);
}
#endif /* defined(__GNUC__) && defined(__x86_64__) */

/* CRC32 software implementation. */
Expand Down Expand Up @@ -669,28 +645,6 @@ ut_crc32_legacy_big_endian_sw(
return(~crc);
}

/** Calculates CRC32 in software, without using CPU instructions.
This function processes one byte at a time (very slow) and thus it does
not depend on the byte order of the machine.
@param[in] buf data over which to calculate CRC32
@param[in] len data length
@return CRC-32C (polynomial 0x11EDC6F41) */
uint32_t
ut_crc32_byte_by_byte_sw(
const byte* buf,
ulint len)
{
uint32_t crc = 0xFFFFFFFFU;

ut_a(ut_crc32_slice8_table_initialized);

while (len > 0) {
ut_crc32_8_sw(&crc, &buf, &len);
}

return(~crc);
}

/********************************************************************//**
Initializes the data structures used by ut_crc32*(). Does not do any
allocations, would not hurt if called twice, but would be pointless. */
Expand All @@ -701,7 +655,6 @@ ut_crc32_init()
ut_crc32_slice8_table_init();
ut_crc32 = ut_crc32_sw;
ut_crc32_legacy_big_endian = ut_crc32_legacy_big_endian_sw;
ut_crc32_byte_by_byte = ut_crc32_byte_by_byte_sw;
ut_crc32_implementation = "Using generic crc32 instructions";

#if defined(__GNUC__) && defined(__x86_64__)
Expand Down Expand Up @@ -735,7 +688,6 @@ ut_crc32_init()
if (features_ecx & 1 << 20) {
ut_crc32 = ut_crc32_hw;
ut_crc32_legacy_big_endian = ut_crc32_legacy_big_endian_hw;
ut_crc32_byte_by_byte = ut_crc32_byte_by_byte_hw;
ut_crc32_implementation = "Using SSE2 crc32 instructions";
}

Expand Down

0 comments on commit 62ce8ce

Please sign in to comment.