Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
bool
ImmediateValue::isPow2() const
{
- return util_is_power_of_two_or_zero(reg.data.u32);
+ if (reg.type == TYPE_U64 || reg.type == TYPE_S64)
+ return util_is_power_of_two_or_zero64(reg.data.u64);
+ else
+ return util_is_power_of_two_or_zero(reg.data.u32);
}
void
case TYPE_U32:
reg.data.u32 = util_logbase2(reg.data.u32);
break;
+ case TYPE_S64:
+ assert(!this->isNegative());
+ // fall through
+ case TYPE_U64:
+ reg.data.u64 = util_logbase2_64(reg.data.u64);
+ break;
case TYPE_F32:
reg.data.f32 = log2f(reg.data.f32);
break;