You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

23 lines
623 B

  1. /* Copyright (c) 2016 Cryptography Research, Inc.
  2. * Released under the MIT License. See LICENSE.txt for license information.
  3. */
  4. #ifndef __ARCH_ARCH_32_ARCH_INTRINSICS_H__
  5. #define __ARCH_ARCH_32_ARCH_INTRINSICS_H__
  6. #define ARCH_WORD_BITS 32
  7. static __inline__ __attribute((always_inline,unused))
  8. uint32_t word_is_zero(uint32_t a) {
  9. /* let's hope the compiler isn't clever enough to optimize this. */
  10. return (((uint64_t)a)-1)>>32;
  11. }
  12. static __inline__ __attribute((always_inline,unused))
  13. uint64_t widemul(uint32_t a, uint32_t b) {
  14. return ((uint64_t)a) * b;
  15. }
  16. #endif /* __ARCH_ARM_32_ARCH_INTRINSICS_H__ */