Skip to content

Commit 073e872

Browse files
authored
mirage_crypto.h, entropy_cpu_stubs.c: add powerpc macros (#269)
* mirage_crypto.h: add powerpc macros * entropy_cpu_stubs.c: fix powerpc
1 parent 154ff24 commit 073e872

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/native/entropy_cpu_stubs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ static inline uint64_t read_virtual_count(void)
126126
}
127127
#endif /* aarch64 */
128128

129-
#if defined (__powerpc64__)
129+
#if defined (__powerpc64__) || defined(__POWERPC__)
130130
/* from clang's builtin version and gperftools at
131131
https://chromium.googlesource.com/external/gperftools/+/master/src/base/cycleclock.h
132132
*/
@@ -183,7 +183,7 @@ CAMLprim value mc_cycle_counter (value __unused(unit)) {
183183
return Val_long (__rdtsc ());
184184
#elif defined (__arm__) || defined (__aarch64__)
185185
return Val_long (read_virtual_count ());
186-
#elif defined(__powerpc64__)
186+
#elif defined(__powerpc64__) || defined(__POWERPC__)
187187
return Val_long (read_cycle_counter ());
188188
#elif defined(__riscv) && (64 == __riscv_xlen)
189189
return Val_long (cycle_count ());

src/native/mirage_crypto.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ extern struct _mc_cpu_features mc_detected_cpu_features;
5050

5151
#endif /* __mc_ACCELERATE__ */
5252

53-
#if defined (__x86_64__) || defined (__aarch64__) || defined (__powerpc64__) || (64 == __riscv_xlen) || defined (__s390x__) || (defined (__mips__) && _MIPS_SIM==_ABI64) || defined (__loongarch_lp64) || (1 == _WIN64)
53+
#if defined (__x86_64__) || defined (__aarch64__) || defined (__powerpc64__) || defined (__ppc64__) || (64 == __riscv_xlen) || defined (__s390x__) || (defined (__mips__) && _MIPS_SIM==_ABI64) || defined (__loongarch_lp64) || (1 == _WIN64)
5454
#define ARCH_64BIT
55-
#elif defined (__i386__) || defined (__arm__) || (32 == __riscv_xlen) || (defined (__mips__) && _MIPS_SIM==_ABIO32) || (1 == _WIN32)
55+
#elif defined (__i386__) || defined (__arm__) || (32 == __riscv_xlen) || (defined (__mips__) && _MIPS_SIM==_ABIO32) || defined (__ppc__) || (1 == _WIN32)
5656
#define ARCH_32BIT
5757
#else
5858
#error "unsupported platform"

0 commit comments

Comments
 (0)