This patch is Reviewed-by: Ian Romanick <ian.d.roman...@intel.com>
On 10/29/2014 05:25 PM, Jason Ekstrand wrote: > --- > src/mesa/main/bitset.h | 1 + > src/mesa/main/macros.h | 27 --------------------------- > src/util/macros.h | 27 +++++++++++++++++++++++++++ > 3 files changed, 28 insertions(+), 27 deletions(-) > > diff --git a/src/mesa/main/bitset.h b/src/mesa/main/bitset.h > index f50b14f..dbf1af9 100644 > --- a/src/mesa/main/bitset.h > +++ b/src/mesa/main/bitset.h > @@ -33,6 +33,7 @@ > > #include "imports.h" > #include "util/bitcount.h" > +#include "util/macros.h" > > /**************************************************************************** > * generic bitset implementation > diff --git a/src/mesa/main/macros.h b/src/mesa/main/macros.h > index cd5f2d6..33cc583 100644 > --- a/src/mesa/main/macros.h > +++ b/src/mesa/main/macros.h > @@ -702,33 +702,6 @@ is_power_of_two(unsigned value) > return (value & (value - 1)) == 0; > } > > -/** > - * Align a value up to an alignment value > - * > - * If \c value is not already aligned to the requested alignment value, it > - * will be rounded up. > - * > - * \param value Value to be rounded > - * \param alignment Alignment value to be used. This must be a power of > two. > - * > - * \sa ROUND_DOWN_TO() > - */ > -#define ALIGN(value, alignment) (((value) + (alignment) - 1) & > ~((alignment) - 1)) > - > -/** > - * Align a value down to an alignment value > - * > - * If \c value is not already aligned to the requested alignment value, it > - * will be rounded down. > - * > - * \param value Value to be rounded > - * \param alignment Alignment value to be used. This must be a power of > two. > - * > - * \sa ALIGN() > - */ > -#define ROUND_DOWN_TO(value, alignment) ((value) & ~(alignment - 1)) > - > - > /** Cross product of two 3-element vectors */ > static inline void > CROSS3(GLfloat n[3], const GLfloat u[3], const GLfloat v[3]) > diff --git a/src/util/macros.h b/src/util/macros.h > index ff37a7d..1b750b6 100644 > --- a/src/util/macros.h > +++ b/src/util/macros.h > @@ -31,6 +31,33 @@ > > > /** > + * Align a value up to an alignment value > + * > + * If \c value is not already aligned to the requested alignment value, it > + * will be rounded up. > + * > + * \param value Value to be rounded > + * \param alignment Alignment value to be used. This must be a power of > two. > + * > + * \sa ROUND_DOWN_TO() > + */ > +#define ALIGN(value, alignment) (((value) + (alignment) - 1) & > ~((alignment) - 1)) > + > +/** > + * Align a value down to an alignment value > + * > + * If \c value is not already aligned to the requested alignment value, it > + * will be rounded down. > + * > + * \param value Value to be rounded > + * \param alignment Alignment value to be used. This must be a power of > two. > + * > + * \sa ALIGN() > + */ > +#define ROUND_DOWN_TO(value, alignment) ((value) & ~(alignment - 1)) > + > + > +/** > * __builtin_expect macros > */ > #if !defined(HAVE___BUILTIN_EXPECT) > _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev