Skip to content

Commit c35030a

Browse files
committed
minor refactor (pedantic)
1 parent fd0331c commit c35030a

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

src/clhash.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ static __m128i clmulhalfscalarproductwithoutreduction(const __m128i * randomsour
272272
* Same half-scalar product as above, but with explicit handling for 1 or 2
273273
* trailing 64-bit words.
274274
*/
275-
static __m128i __clmulhalfscalarproductwithtailwithoutreduction(const __m128i * randomsource,
275+
static __m128i clmulhalfscalarproductwithtailwithoutreduction(const __m128i * randomsource,
276276
const uint64_t * string, const size_t length) {
277277
assert(((uintptr_t) randomsource & 15) == 0);// we expect cache line alignment for the keys
278278
const uint64_t * const endstring = string + length;
@@ -313,7 +313,7 @@ static __m128i __clmulhalfscalarproductwithtailwithoutreduction(const __m128i *
313313
}
314314
// the value length does not have to be divisible by 4
315315
// additionally folds one extra synthesized word (partial tail packed in LE).
316-
static __m128i __clmulhalfscalarproductwithtailwithoutreductionWithExtraWord(const __m128i * randomsource,
316+
static __m128i clmulhalfscalarproductwithtailwithoutreductionWithExtraWord(const __m128i * randomsource,
317317
const uint64_t * string, const size_t length, const uint64_t extraword) {
318318
assert(((uintptr_t) randomsource & 15) == 0);// we expect cache line alignment for the keys
319319
const uint64_t * const endstring = string + length;
@@ -357,7 +357,7 @@ static __m128i __clmulhalfscalarproductwithtailwithoutreductionWithExtraWord(con
357357
}
358358

359359

360-
static __m128i __clmulhalfscalarproductOnlyExtraWord(const __m128i * randomsource,
360+
static __m128i clmulhalfscalarproductOnlyExtraWord(const __m128i * randomsource,
361361
const uint64_t extraword) {
362362
const __m128i temp1 = _mm_load_si128(randomsource);
363363
const __m128i temp2 = _mm_loadl_epi64((__m128i const*)&extraword);
@@ -437,22 +437,22 @@ uint64_t clhash(const void* random, const char * stringbyte,
437437
acc = mul128by128to128_lazymod127(polyvalue, acc);
438438
if (lengthbyte % sizeof(uint64_t) == 0) {
439439
const __m128i h1 =
440-
__clmulhalfscalarproductwithtailwithoutreduction(rs64,
440+
clmulhalfscalarproductwithtailwithoutreduction(rs64,
441441
string + t, remain);
442442
acc = _mm_xor_si128(acc, h1);
443443
} else {
444444
const uint64_t lastword = createLastWord(lengthbyte,
445445
(string + length));
446446
const __m128i h1 =
447-
__clmulhalfscalarproductwithtailwithoutreductionWithExtraWord(
447+
clmulhalfscalarproductwithtailwithoutreductionWithExtraWord(
448448
rs64, string + t, remain, lastword);
449449
acc = _mm_xor_si128(acc, h1);
450450
}
451451
} else if (lengthbyte % sizeof(uint64_t) != 0) {// added to address issue #2 raised by Eik List
452452
// there are no completely filled words left, but there is one partial word.
453453
acc = mul128by128to128_lazymod127(polyvalue, acc);
454454
const uint64_t lastword = createLastWord(lengthbyte, (string + length));
455-
const __m128i h1 = __clmulhalfscalarproductOnlyExtraWord( rs64, lastword);
455+
const __m128i h1 = clmulhalfscalarproductOnlyExtraWord( rs64, lastword);
456456
acc = _mm_xor_si128(acc, h1);
457457
}
458458

@@ -463,7 +463,7 @@ uint64_t clhash(const void* random, const char * stringbyte,
463463
} else { // short strings
464464
/* Single-block path: no polynomial folding needed. */
465465
if(lengthbyte % sizeof(uint64_t) == 0) {
466-
__m128i acc = __clmulhalfscalarproductwithtailwithoutreduction(rs64, string, length);
466+
__m128i acc = clmulhalfscalarproductwithtailwithoutreduction(rs64, string, length);
467467
const uint64_t keylength = *(const uint64_t *)(rs64 + m128neededperblock + 2);
468468
acc = _mm_xor_si128(acc,lazyLengthHash(keylength, (uint64_t)lengthbyte));
469469
#ifdef CLHASH_BITMIX
@@ -473,7 +473,7 @@ uint64_t clhash(const void* random, const char * stringbyte,
473473
#endif
474474
}
475475
const uint64_t lastword = createLastWord(lengthbyte, (string + length));
476-
__m128i acc = __clmulhalfscalarproductwithtailwithoutreductionWithExtraWord(
476+
__m128i acc = clmulhalfscalarproductwithtailwithoutreductionWithExtraWord(
477477
rs64, string, length, lastword);
478478
const uint64_t keylength = *(const uint64_t *)(rs64 + m128neededperblock + 2);
479479
acc = _mm_xor_si128(acc,lazyLengthHash(keylength, (uint64_t)lengthbyte));

0 commit comments

Comments
 (0)