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