DescriptionMIPS: 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}
Committed: https://chromium.googlesource.com/v8/v8/+/de14ba9fd2292a20f6b14d9cb7e0a625b855cfe0
Patch Set 1 #
Total comments: 2
Patch Set 2 : Add test labels to an array #Patch Set 3 : Move testcases to an array #
Messages
Total messages: 14 (7 generated)
|