finally got around to replacing this with a suitable intrinsic
// NOTE! returns 1 when value_in==0
#if 0
return value;
return value_in==0 ? 0 : value;
#else
uint valpw2 = value_in==0 ? 0 : (1<<firstbithigh(value_in)); // firstbithigh(0) returns -1
return max(valpw2, valpw2<<(valpw2!=value_in ? 1 : 0)); // max() just in case of overflow
#endif
}