|
7 | 7 | * Copyright (C) 2011, 2015, 2018, 2021, D. R. Commander. |
8 | 8 | * Copyright (C) 2016, 2018, Matthieu Darbois. |
9 | 9 | * Copyright (C) 2020, Arm Limited. |
| 10 | + * Copyright (C) 2021, Alex Richardson. |
10 | 11 | * For conditions of distribution and use, see the accompanying README.ijg |
11 | 12 | * file. |
12 | 13 | * |
|
52 | 53 | * flags (this defines __thumb__). |
53 | 54 | */ |
54 | 55 |
|
55 | | -#if defined(__arm__) || defined(__aarch64__) || defined(_M_ARM) || \ |
56 | | - defined(_M_ARM64) |
| 56 | +/* NOTE: Both GCC and Clang define __GNUC__ */ |
| 57 | +#if (defined(__GNUC__) && (defined(__arm__) || defined(__aarch64__))) || \ |
| 58 | + defined(_M_ARM) || defined(_M_ARM64) |
57 | 59 | #if !defined(__thumb__) || defined(__thumb2__) |
58 | 60 | #define USE_CLZ_INTRINSIC |
59 | 61 | #endif |
@@ -679,7 +681,7 @@ encode_mcu_AC_first(j_compress_ptr cinfo, JBLOCKROW *MCU_data) |
679 | 681 | emit_restart(entropy, entropy->next_restart_num); |
680 | 682 |
|
681 | 683 | #ifdef WITH_SIMD |
682 | | - cvalue = values = (JCOEF *)PAD((size_t)values_unaligned, 16); |
| 684 | + cvalue = values = (JCOEF *)PAD((JUINTPTR)values_unaligned, 16); |
683 | 685 | #else |
684 | 686 | /* Not using SIMD, so alignment is not needed */ |
685 | 687 | cvalue = values = values_unaligned; |
@@ -944,7 +946,7 @@ encode_mcu_AC_refine(j_compress_ptr cinfo, JBLOCKROW *MCU_data) |
944 | 946 | emit_restart(entropy, entropy->next_restart_num); |
945 | 947 |
|
946 | 948 | #ifdef WITH_SIMD |
947 | | - cabsvalue = absvalues = (JCOEF *)PAD((size_t)absvalues_unaligned, 16); |
| 949 | + cabsvalue = absvalues = (JCOEF *)PAD((JUINTPTR)absvalues_unaligned, 16); |
948 | 950 | #else |
949 | 951 | /* Not using SIMD, so alignment is not needed */ |
950 | 952 | cabsvalue = absvalues = absvalues_unaligned; |
|
0 commit comments