summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Burke <tim.burke@gmail.com>2017-07-06 00:08:45 +0000
committerTim Burke <tim.burke@gmail.com>2017-07-06 00:08:45 +0000
commit9b4d8bcf8dc97d7edad3dc1443b317ecb5a0a254 (patch)
tree942e95f1db79f7b7111b5f596c8c7f273d34bef2
parent24038b3588fc02cda18159e87e213c3177d67f38 (diff)
Stop pretending to support SSE4-optimized CRC-32C
It isn't the CRC we want, and we never used it anyway. While we may define INTEL_SSE41 or INTEL_SSE42 if CPU seems to support it, we've never defined INTEL_SSE4. Change-Id: I04e1dd6458ccde58a0a2f3f4d6947569a31e9697 Partial-Bug: 1666320
Notes
Notes (review): Code-Review+1: Daniel Axtens <dja@axtens.net> Code-Review+2: Pete Zaitcev <zaitcev@kotori.zaitcev.us> Code-Review+2: Thiago da Silva <thiago@redhat.com> Workflow+1: Thiago da Silva <thiago@redhat.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Thu, 13 Jul 2017 19:28:45 +0000 Reviewed-on: https://review.openstack.org/480776 Project: openstack/liberasurecode Branch: refs/heads/master
-rw-r--r--src/utils/chksum/crc32.c29
1 files changed, 0 insertions, 29 deletions
diff --git a/src/utils/chksum/crc32.c b/src/utils/chksum/crc32.c
index 6710dd7..6bc844d 100644
--- a/src/utils/chksum/crc32.c
+++ b/src/utils/chksum/crc32.c
@@ -42,30 +42,6 @@
42 42
43#include <sys/param.h> 43#include <sys/param.h>
44 44
45#if defined(INTEL_SSE4)
46#include <nmmintrin.h>
47
48int
49crc32(int crc, const void *buf, size_t size)
50{
51 unsigned long long *current = (unsigned long long*)buf;
52 unsigned char *current_char;
53
54 crc = crc ^ ~0U;
55
56 while(size >= 8) {
57 crc = _mm_crc32_u64(crc, *current++);
58 size -= 8;
59 }
60
61 current_char = (unsigned char*)current;
62 while (size--) {
63 crc = _mm_crc32_u8(crc, *current_char++);
64 }
65 return crc ^ ~0U;
66}
67#else
68
69static int crc32_tab[] = { 45static int crc32_tab[] = {
70 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 46 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f,
71 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 47 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,
@@ -112,9 +88,6 @@ static int crc32_tab[] = {
112 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d 88 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d
113}; 89};
114 90
115// Use same polynomial as Intel's SSE4 instruction!
116#define POLY_CRC_32 0x11EDC6F41
117
118int 91int
119crc32(int crc, const void *buf, size_t size) 92crc32(int crc, const void *buf, size_t size)
120{ 93{
@@ -128,5 +101,3 @@ crc32(int crc, const void *buf, size_t size)
128 101
129 return crc ^ ~0U; 102 return crc ^ ~0U;
130} 103}
131#endif
132