MIPS: Fix Subu and add optimization
For int16 imm values Subu would emit addiu with -imm value, but doing this with min_int16 would overflow and produce incorrect result. This is fixed by checking if -imm is int16. A test for this case is created. An optimization is also added for values imm where we cannot just emit addiu and loading -imm to a register takes one instruction using ori. Then instead of loading imm with lui;ori and subtracting with subu, we can load -imm with ori and add with addu. BUG= TEST=cctest/test-assembler-mips/Subu Review-Url: https://codereview.chromium.org/2845043002 Cr-Commit-Position: refs/heads/master@{#44932}
Showing
Please
register
or
sign in
to comment