Dávid Balatoni

Results 46 comments of Dávid Balatoni

For low level replacements we have ASM and IR patterns, what do we have for higher level simplifications?

I checked 255 different combinations of optimization levels and compiler versions for division by two. The problem only exists in version 1.3.2. When the output is not simplified, it's always...

I tried adding ``` if ( expr.op == ">>" and isinstance(left_expr, BinaryOp) and left_expr.op == "+" and isinstance(left_expr.left, Expression) ): left_left_expr = early_unwrap_ints(left_expr.left) if ( isinstance(left_left_expr, BinaryOp) and left_left_expr.op ==...

I will try to implement your suggestions. > oh, and don't you need to check that `left_left_expr.left` matches `left_expr.right`? I wanted to do that but they didn't match because of...

Unfortunately the registers used in asm seem to be jambled a lot in mod by power two, I can't find a pattern that matches all cases, meanwhile the final expression...

> And maybe handle both a + b and b + a (i.e., do a,b = b,a if a is a Literal). I unfortunately don't quite get what you mean...

> Those look reasonable to me; what goes wrong with them? For example if you look at the d variable, it doesn't quiet match up for all cases

dtk asm files include [macros.inc](https://github.com/encounter/decomp-toolkit/blob/main/assets/macros.inc) which does not contain this directive. My question is: even if it did, would the include be needed to be manually pasted into the file...

I'll add a comment about the version info and flags.

> That's just a case of "try all the patterns one at a time", first fold_divmod, then replace_clz_shift, then (newly added) replace_or_shift. The way you've added it looks good to...