mirror of
https://github.com/open-goal/jak-project
synced 2026-09-06 19:21:00 -04:00
[decompiler] More inline vector functions (#3861)
This adds more recognition for inlined vector functions to the decompiler, which can clean up a bunch of ugly looking code/`rlet`s.  Unfortunately, this changes the numbering of ops in the decomp, since all the vector instructions get combined in a single "operation" by the decompiler. I really tried to avoid having this ever happen in the decompiler and this is one of the few cases where it has. So I had to update a bunch of type casts. For that reason I haven't turned this on in Jak 2 yet, although I am planning to do that at some point. (probably at the same time as porting back a bunch of jak 3 improvements to jak 2) --------- Co-authored-by: water111 <awaterford1111445@gmail.com>
This commit is contained in:
@@ -369,8 +369,12 @@ std::string get_simple_expression_op_name(SimpleExpression::Kind kind) {
|
||||
return "vec4dot";
|
||||
case SimpleExpression::Kind::VECTOR_LENGTH:
|
||||
return "veclength";
|
||||
case SimpleExpression::Kind::VECTOR_LENGTH_SQUARED:
|
||||
return "veclength-squared";
|
||||
case SimpleExpression::Kind::VECTOR_PLUS_FLOAT_TIMES:
|
||||
return "vecplusfloattimes";
|
||||
case SimpleExpression::Kind::VECTOR_PLUS_TIMES:
|
||||
return "vecplustimes";
|
||||
case SimpleExpression::Kind::SET_ON_LESS_THAN:
|
||||
case SimpleExpression::Kind::SET_ON_LESS_THAN_IMM:
|
||||
return "set-on-less-than";
|
||||
@@ -440,8 +444,10 @@ int get_simple_expression_arg_count(SimpleExpression::Kind kind) {
|
||||
case SimpleExpression::Kind::SET_ON_LESS_THAN_IMM:
|
||||
return 2;
|
||||
case SimpleExpression::Kind::VECTOR_LENGTH:
|
||||
case SimpleExpression::Kind::VECTOR_LENGTH_SQUARED:
|
||||
return 1;
|
||||
case SimpleExpression::Kind::VECTOR_PLUS_FLOAT_TIMES:
|
||||
case SimpleExpression::Kind::VECTOR_PLUS_TIMES:
|
||||
return 4;
|
||||
default:
|
||||
ASSERT(false);
|
||||
|
||||
Reference in New Issue
Block a user