Lines Matching refs:field
112 static __always_inline u64 field_multiplier(u64 field) in field_multiplier() argument
114 if ((field | (field - 1)) & ((field | (field - 1)) + 1)) in field_multiplier()
116 return field & -field; in field_multiplier()
119 static __always_inline u64 field_mask(u64 field) in field_mask() argument
121 return field / field_multiplier(field); in field_mask()
125 static __always_inline __##type type##_encode_bits(base v, base field) \
127 if (__builtin_constant_p(v) && (v & ~field_mask(field))) \
129 return to((v & field_mask(field)) * field_multiplier(field)); \
132 base val, base field) \
134 return (old & ~to(field)) | type##_encode_bits(val, field); \
137 base val, base field) \
139 *p = (*p & ~to(field)) | type##_encode_bits(val, field); \
141 static __always_inline base type##_get_bits(__##type v, base field) \
143 return (from(v) & field) / field_multiplier(field); \