[PATCH 1/2] eal: provide macro for GCC builtin constant intrinsic
Andrew Rybchenko
andrew.rybchenko at oktetlabs.ru
Wed May 29 13:42:42 CEST 2024
On 5/27/24 15:00, Bruce Richardson wrote:
> On Wed, Mar 20, 2024 at 02:33:35PM -0700, Tyler Retzlaff wrote:
>> MSVC does not have a __builtin_constant_p intrinsic so provide
>> __rte_constant(e) that expands false for MSVC and to the intrinsic for
>> GCC.
>>
>> Signed-off-by: Tyler Retzlaff <roretzla at linux.microsoft.com>
>> ---
>> lib/eal/include/rte_common.h | 6 ++++++
>> 1 file changed, 6 insertions(+)
>>
>> diff --git a/lib/eal/include/rte_common.h b/lib/eal/include/rte_common.h
>> index 298a5c6..d520be6 100644
>> --- a/lib/eal/include/rte_common.h
>> +++ b/lib/eal/include/rte_common.h
>> @@ -44,6 +44,12 @@
>> #endif
>> #endif
>>
>> +#ifdef RTE_TOOLCHAIN_MSVC
>> +#define __rte_constant(e) 0
>> +#else
>> +#define __rte_constant(e) __extension__(__builtin_constant_p(e))
>> +#endif
>> +
>
> Acked-by: Bruce Richardson <bruce.richardson at intel.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko at oktetlabs.ru>
More information about the dev
mailing list