bool IfInstruction::is_equal_to(const Instruction& lhs) const
{
assert(lhs.type() == cond_if);
- const IfInstruction& l = dynamic_cast<const IfInstruction&>(lhs);
+ const IfInstruction& l = static_cast<const IfInstruction&>(lhs);
return *l.m_pred == *m_pred;
}
{
if (lhs.type() != Instruction::mem_wr_scratch)
return false;
- const auto& other = dynamic_cast<const WriteScratchInstruction&>(lhs);
+ const auto& other = static_cast<const WriteScratchInstruction&>(lhs);
if (m_address) {
if (!other.m_address)
m_dest_swizzle({0,1,2,3})
{
if (src->type() == Value::literal) {
- const auto& lv = dynamic_cast<const LiteralValue&>(*src);
+ const auto& lv = static_cast<const LiteralValue&>(*src);
m_array_base = lv.value();
m_indexed = false;
m_src.reset(new GPRValue(0,0));
bool WaitAck::is_equal_to(const Instruction& lhs) const
{
- const auto& l = dynamic_cast<const WaitAck&>(lhs);
+ const auto& l = static_cast<const WaitAck&>(lhs);
return m_nack == l.m_nack;
}
if (addr) {
if (addr->type() == Value::literal) {
- const auto& boffs = dynamic_cast<const LiteralValue&>(*addr);
+ const auto& boffs = static_cast<const LiteralValue&>(*addr);
buffer_offset = boffs.value();
} else {
index_mode = bim_zero;
m_bc->index_loaded[1] = true;
}
} else {
- const LiteralValue& addr_reg = dynamic_cast<const LiteralValue&>(*addr);
+ const LiteralValue& addr_reg = static_cast<const LiteralValue&>(*addr);
uav_idx = addr_reg.value() >> 2;
}
}
} else {
- const LiteralValue& addr_reg = dynamic_cast<const LiteralValue&>(*addr);
+ const LiteralValue& addr_reg = static_cast<const LiteralValue&>(*addr);
rat_idx = addr_reg.value();
}
}
WriteScratchInstruction *ir = nullptr;
if (address->type() == Value::literal) {
- const auto& lv = dynamic_cast<const LiteralValue&>(*address);
+ const auto& lv = static_cast<const LiteralValue&>(*address);
ir = new WriteScratchInstruction(lv.value(), value, align, align_offset, writemask);
} else {
address = from_nir_with_fetch_constant(instr->src[1], 0);
bool GPRArray::is_equal_to(const Value& other) const
{
- const GPRArray& o = dynamic_cast<const GPRArray&>(other);
+ const GPRArray& o = static_cast<const GPRArray&>(other);
return o.sel() == sel() &&
o.m_values.size() == m_values.size() &&
o.m_component_mask == m_component_mask;
auto reg = lookup_register(idx, swizzled, false);
if (reg) {
if (reg->type() == Value::gpr_vector) {
- auto& array = dynamic_cast<GPRArray&>(*reg);
+ auto& array = static_cast<GPRArray&>(*reg);
reg = array.get_indirect(v.reg.base_offset,
v.reg.indirect ?
from_nir(*v.reg.indirect, 0, 0) : nullptr,
if (retval->type() == Value::gpr_vector) {
assert(!v.is_ssa);
- auto& array = dynamic_cast<GPRArray&>(*retval);
+ auto& array = static_cast<GPRArray&>(*retval);
retval = array.get_indirect(v.reg.base_offset,
v.reg.indirect ?
from_nir(*v.reg.indirect, 0, 0) : nullptr,
if (v.second->type() == Value::gpr)
result.insert(v.second);
else if (v.second->type() == Value::gpr_vector) {
- auto& array = dynamic_cast<GPRArray&>(*v.second);
+ auto& array = static_cast<GPRArray&>(*v.second);
array.collect_registers(result);
}
}