199a2dd95SBruce Richardson /* 299a2dd95SBruce Richardson * SPDX-License-Identifier: BSD-3-Clause 399a2dd95SBruce Richardson * Copyright (C) Mellanox 2020. 499a2dd95SBruce Richardson */ 599a2dd95SBruce Richardson 699a2dd95SBruce Richardson #ifndef _RTE_ALTIVEC_H_ 799a2dd95SBruce Richardson #define _RTE_ALTIVEC_H_ 899a2dd95SBruce Richardson 999a2dd95SBruce Richardson /* To include altivec.h, GCC version must be >= 4.8 */ 1099a2dd95SBruce Richardson #include <altivec.h> 1199a2dd95SBruce Richardson 1299a2dd95SBruce Richardson /* 13*b251bb76SThomas Monjalon * The keyword "vector" is defined in altivec.h, 14*b251bb76SThomas Monjalon * and often conflicts with code in applications or dependencies. 15*b251bb76SThomas Monjalon * It is preferred to use the alternative keyword "__vector". 16*b251bb76SThomas Monjalon */ 17*b251bb76SThomas Monjalon #undef vector 18*b251bb76SThomas Monjalon 19*b251bb76SThomas Monjalon /* 2099a2dd95SBruce Richardson * Compilation workaround for PPC64 when AltiVec is fully enabled, e.g. std=c11. 2199a2dd95SBruce Richardson * Otherwise there would be a type conflict between stdbool and altivec. 2299a2dd95SBruce Richardson */ 2399a2dd95SBruce Richardson #if defined(__PPC64__) && !defined(__APPLE_ALTIVEC__) 2499a2dd95SBruce Richardson #undef bool 2599a2dd95SBruce Richardson /* redefine as in stdbool.h */ 2699a2dd95SBruce Richardson #define bool _Bool 2799a2dd95SBruce Richardson #endif 2899a2dd95SBruce Richardson 2999a2dd95SBruce Richardson #endif /* _RTE_ALTIVEC_H_ */ 30