> +#define ODP_ROUNDUP_POWER2_U32(x) \
> + (((x) > 0x8000) ? 0 : (_POW2_U32_R5(x - 1) + 1))
>
> it's better to not name internal macros with ODP_
>
>
> Agree, but that's the current convention over the odp_align_interal.h. All
> are internal macros and are ODP_ prefixed. Another patch
> > /**
> > * @internal
> > - * When 'x' is not already a power of two, round it up to the next
> > - * power of two value. Zero is not supported as an input value.
> > - */
> > -#define ODP_ROUNDUP_POWER_2(x)\
> > - (1 << (((int)(8 * sizeof(x))) - __builtin_clz((x) - 1)))
> > + * Round u
On Thu, Jan 19, 2017 at 9:28 AM, Petri Savolainen
wrote:
> Implement round up to power of two as a macro. Macro
> enables preprocessor to calculate the constant value and
> avoid code generation. Also dependency to __builtin_clz()
> is not needed anymore.
>
> Signed-off-by: Petri Savolainen
> ---
/**
* @internal
- * When 'x' is not already a power of two, round it up to the next
- * power of two value. Zero is not supported as an input value.
- */
-#define ODP_ROUNDUP_POWER_2(x)\
- (1 << (((int)(8 * sizeof(x))) - __builtin_clz((x) - 1)))
+ * Round up a uint32_t value 'x' to the ne
On 19 January 2017 at 18:28, Petri Savolainen
wrote:
> Implement round up to power of two as a macro. Macro
> enables preprocessor to calculate the constant value and
> avoid code generation. Also dependency to __builtin_clz()
> is not needed anymore.
>
> Signed-off-by: Petri Savolainen
> ---
>
Implement round up to power of two as a macro. Macro
enables preprocessor to calculate the constant value and
avoid code generation. Also dependency to __builtin_clz()
is not needed anymore.
Signed-off-by: Petri Savolainen
---
platform/linux-generic/include/odp_align_internal.h | 19