fallback_builtins.h 876 B

12345678910111213141516171819202122232425262728293031
  1. /* Helper functions to work around issues with clang builtins
  2. * Copyright (C) 2021 IBM Corporation
  3. *
  4. * Authors:
  5. * Daniel Black <daniel@linux.vnet.ibm.com>
  6. * Rogerio Alves <rogealve@br.ibm.com>
  7. * Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
  8. *
  9. * For conditions of distribution and use, see copyright notice in zlib.h
  10. */
  11. #ifndef POWER_BUILTINS_H
  12. #define POWER_BUILTINS_H
  13. /*
  14. * These stubs fix clang incompatibilities with GCC builtins.
  15. */
  16. #ifndef __builtin_crypto_vpmsumw
  17. #define __builtin_crypto_vpmsumw __builtin_crypto_vpmsumb
  18. #endif
  19. #ifndef __builtin_crypto_vpmsumd
  20. #define __builtin_crypto_vpmsumd __builtin_crypto_vpmsumb
  21. #endif
  22. static inline __vector unsigned long long __attribute__((overloadable))
  23. vec_ld(int __a, const __vector unsigned long long* __b) {
  24. return (__vector unsigned long long)__builtin_altivec_lvx(__a, __b);
  25. }
  26. #endif