Re: [lng-odp] [PATCH] linux-gen: align: round up power of two as macro

2017-01-20 Thread Savolainen, Petri (Nokia - FI/Espoo)
> +#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

Re: [lng-odp] [PATCH] linux-gen: align: round up power of two as macro

2017-01-20 Thread Savolainen, Petri (Nokia - FI/Espoo)
> > /** > > * @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

Re: [lng-odp] [PATCH] linux-gen: align: round up power of two as macro

2017-01-19 Thread Bill Fischofer
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 > ---

Re: [lng-odp] [PATCH] linux-gen: align: round up power of two as macro

2017-01-19 Thread Savolainen, Petri (Nokia - FI/Espoo)
 /**   * @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

Re: [lng-odp] [PATCH] linux-gen: align: round up power of two as macro

2017-01-19 Thread Maxim Uvarov
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 > --- >

[lng-odp] [PATCH] linux-gen: align: round up power of two as macro

2017-01-19 Thread 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