Skip to content

Commit

Permalink
see what happens without an alignment on those arrays.
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanHenson committed Feb 1, 2024
1 parent 0e31476 commit 4870411
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions source/arm/crc32c_arm.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# endif

uint32_t aws_checksums_crc32c_armv8(const uint8_t *data, int length, uint32_t previous_crc32c) {
uint32_t crc = ~previousCrc32;
uint32_t crc = ~previous_crc32c;

// Align data if it's not aligned
while (((uintptr_t)data & 7) && length > 0) {
Expand Down Expand Up @@ -55,7 +55,7 @@ uint32_t aws_checksums_crc32c_armv8(const uint8_t *data, int length, uint32_t pr
}

uint32_t aws_checksums_crc32_armv8(const uint8_t *data, int length, uint32_t previous_crc32) {
uint32_t crc = ~previousCrc32;
uint32_t crc = ~previous_crc32;

// Align data if it's not aligned
while (((uintptr_t)data & 7) && length > 0) {
Expand Down
6 changes: 4 additions & 2 deletions source/crc64.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
#include <aws/checksums/private/crc64_priv.h>
#include <aws/common/cpuid.h>

AWS_ALIGNED_TYPEDEF(uint8_t, checksums_maxks_shifts_type[6][16], 16);
//AWS_ALIGNED_TYPEDEF(uint8_t, checksums_maxks_shifts_type[6][16], 16);
// Intel PSHUFB / ARM VTBL patterns for left/right shifts and masks
checksums_maxks_shifts_type aws_checksums_masks_shifts = {
uint8_t aws_checksums_masks_shifts[6][16] = {
{0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, //
{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, // left/right
// shifts
Expand Down Expand Up @@ -87,6 +87,8 @@ static uint64_t (*s_crc64xz_fn_ptr)(const uint8_t *input, int length, uint64_t p

uint64_t aws_checksums_crc64xz(const uint8_t *input, int length, uint64_t prev_crc64) {

size_t blah = sizeof(aws_checksums_masks_shifts);

if (AWS_UNLIKELY(!s_crc64xz_fn_ptr)) {
#if defined(AWS_ARCH_INTEL_X64) && !(defined(_MSC_VER) && _MSC_VER < 1920)
# if defined(AWS_HAVE_AVX512_INTRINSICS)
Expand Down

0 comments on commit 4870411

Please sign in to comment.