[decomp] transformq-h, clean up trig, and offline test for trig (#485)

* clean up

* fix store vf fallback errors
This commit is contained in:
water111
2021-05-15 10:38:14 -04:00
committed by GitHub
parent c95e501cec
commit 613efbd768
12 changed files with 1284 additions and 343 deletions
+21 -2
View File
@@ -233,12 +233,31 @@ FormElement* StoreOp::get_vf_store_as_form(FormPool& pool, const Env& env) const
auto addr = pool.alloc_single_element_form<DerefElement>(nullptr, source, true, tokens);
return pool.alloc_element<VectorFloatLoadStoreElement>(m_value.var().reg(), addr, false);
} else {
// try again with no deref.
rd_in.deref = {};
auto rd_no_deref = env.dts->ts.reverse_field_lookup(rd_in);
if (rd_no_deref.success) {
auto source = pool.alloc_single_element_form<SimpleExpressionElement>(
nullptr, SimpleAtom::make_var(ro.var).as_expr(), m_my_idx);
std::vector<DerefToken> tokens;
for (auto& x : rd_no_deref.tokens) {
tokens.push_back(to_token(x));
}
auto addr = pool.alloc_single_element_form<DerefElement>(nullptr, source,
rd_no_deref.addr_of, tokens);
// this cast isn't required (.svf will take anything), but it makes it clear that there's
// some sketchy type stuff going on.
addr = pool.alloc_single_element_form<CastElement>(
nullptr, TypeSpec("pointer", {TypeSpec("uint128")}), addr);
return pool.alloc_element<VectorFloatLoadStoreElement>(m_value.var().reg(), addr, false);
}
}
}
}
// nothing worked.
throw std::runtime_error("NYI get_vf_store_as_form fallback");
return pool.alloc_element<StoreElement>(this);
}
FormElement* StoreOp::get_as_form(FormPool& pool, const Env& env) const {