Skip to content

Commit

Permalink
Align to 32B instead of 64B
Browse files Browse the repository at this point in the history
No benefit to full 64B alignment, just more scalar ops.
  • Loading branch information
zbjornson committed Oct 23, 2018
1 parent 8c81322 commit 1e9a3c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/bswap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ static void shuffle(Local<TypedArray> data_ta) {
size_t byteLength = data_ta->ByteLength();
size_t elemLength = byteLength / sizeof(STYPE);

// Scalar until aligned to cache line
// Scalar until aligned
size_t sIdx = 0;
size_t preLength = ((uintptr_t)(void *)(bytes) % 64) / sizeof(STYPE);
size_t preLength = ((uintptr_t)(void *)(bytes) % 32) / sizeof(STYPE);
if (elemLength < preLength) preLength = elemLength;
while (sIdx < preLength) swap(&(*data)[sIdx++]);

Expand Down

0 comments on commit 1e9a3c8

Please sign in to comment.