1 /* Copyright (c) 2016 Cryptography Research, Inc.
2 * Released under the MIT License. See LICENSE.txt for license information.
5 #ifndef __ARCH_NEON_ARCH_INTRINSICS_H__
6 #define __ARCH_NEON_ARCH_INTRINSICS_H__
8 #define ARCH_WORD_BITS 32
10 static __inline__ __attribute((always_inline,unused))
11 uint32_t word_is_zero(uint32_t a) {
13 __asm__("subs %0, %1, #1;\n\tsbc %0, %0, %0" : "=r"(ret) : "r"(a) : "cc");
17 static __inline__ __attribute((always_inline,unused))
18 uint64_t widemul(uint32_t a, uint32_t b) {
19 /* Could be UMULL, but it's hard to express to CC that the registers must be different */
20 return ((uint64_t)a) * b;
23 #endif /* __ARCH_NEON_ARCH_INTRINSICS_H__ */