On Tuesday, June 26, 2018 6:22:08 PM PDT Francisco Jerez wrote: > Allows to specify a bitfield based on its upper and lower bounds > instead of a symbolic field definition, kind of what the current > GET_BITS macro is to GET_FIELD. > --- > src/intel/compiler/brw_eu_defines.h | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/src/intel/compiler/brw_eu_defines.h > b/src/intel/compiler/brw_eu_defines.h > index ee306a6c2ce..565cba3d838 100644 > --- a/src/intel/compiler/brw_eu_defines.h > +++ b/src/intel/compiler/brw_eu_defines.h > @@ -46,6 +46,13 @@ > fieldval & field ## _MASK; \ > }) > > +#define SET_BITS(value, high, low) \ > + ({ \ > + const uint32_t fieldval = (value) << (low); \ > + assert((fieldval & ~INTEL_MASK(high, low)) == 0); \ > + fieldval & INTEL_MASK(high, low); \ > + }) > + > #define GET_BITS(data, high, low) ((data & INTEL_MASK((high), (low))) >> > (low)) > #define GET_FIELD(word, field) (((word) & field ## _MASK) >> field ## > _SHIFT)
Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev