bar_value(int size, uint64_t val)
{
	uint64_t mask;

	assert(size == 1 || size == 2 || size == 4 || size == 8);
	mask = (size < 8 ? 1UL << (size * 8) : 0UL) - 1;

	return val & mask;
}
bar_value(int size, uint64_t val)
{
	uint64_t mask;

	assert(size == 1 || size == 2 || size == 4 || size == 8);
	mask = (size < 8 ? 1UL << (size * 8) : 0UL) - 1;

	return val & mask;
}