Commit f0e80e12 authored by Pierre Moreau's avatar Pierre Moreau Committed by Karol Herbst
Browse files

nv50/ir: Extend ImmediateValue::applyLog2 to 64-bit integers


Signed-off-by: default avatarKarol Herbst <kherbst@redhat.com>
Reviewed-by: default avatarKarol Herbst <kherbst@redhat.com>
Reviewed-by: default avatarIlia Mirkin <imirkin@alum.mit.edu>
parent 03f592a1
......@@ -423,7 +423,10 @@ ImmediateValue::isNegative() const
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
......@@ -440,6 +443,12 @@ ImmediateValue::applyLog2()
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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment