Chromium Code Reviews

Unified Diff: src/mips/macro-assembler-mips.cc

Issue 1185143002: MIPS: Remove unsafe EmitLoadRegister usage in AddI/SubI for constant right operand. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « src/mips/lithium-codegen-mips.cc ('k') | test/mjsunit/regress/regress-500176.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips/macro-assembler-mips.cc
diff --git a/src/mips/macro-assembler-mips.cc b/src/mips/macro-assembler-mips.cc
index 8b6c4a44970ce54e7228deeb405d94bcc1c4ebe1..190af3b8768e87831e0e7fbf12c96e3d860b382f 100644
--- a/src/mips/macro-assembler-mips.cc
+++ b/src/mips/macro-assembler-mips.cc
@@ -4452,17 +4452,17 @@ void MacroAssembler::AdduAndCheckForOverflow(Register dst, Register left,
} else {
if (dst.is(left)) {
mov(scratch, left); // Preserve left.
- addiu(dst, left, right.immediate()); // Left is overwritten.
+ Addu(dst, left, right.immediate()); // Left is overwritten.
xor_(scratch, dst, scratch); // Original left.
// Load right since xori takes uint16 as immediate.
- addiu(t9, zero_reg, right.immediate());
+ Addu(t9, zero_reg, right);
xor_(overflow_dst, dst, t9);
and_(overflow_dst, overflow_dst, scratch);
} else {
addiu(dst, left, right.immediate());
xor_(overflow_dst, dst, left);
// Load right since xori takes uint16 as immediate.
- addiu(t9, zero_reg, right.immediate());
+ Addu(t9, zero_reg, right);
xor_(scratch, dst, t9);
and_(overflow_dst, scratch, overflow_dst);
}
@@ -4520,17 +4520,17 @@ void MacroAssembler::SubuAndCheckForOverflow(Register dst, Register left,
} else {
if (dst.is(left)) {
mov(scratch, left); // Preserve left.
- addiu(dst, left, -(right.immediate())); // Left is overwritten.
+ Subu(dst, left, right); // Left is overwritten.
xor_(overflow_dst, dst, scratch); // scratch is original left.
// Load right since xori takes uint16 as immediate.
- addiu(t9, zero_reg, right.immediate());
+ Addu(t9, zero_reg, right);
xor_(scratch, scratch, t9); // scratch is original left.
and_(overflow_dst, scratch, overflow_dst);
} else {
- addiu(dst, left, -(right.immediate()));
+ Subu(dst, left, right);
xor_(overflow_dst, dst, left);
// Load right since xori takes uint16 as immediate.
- addiu(t9, zero_reg, right.immediate());
+ Addu(t9, zero_reg, right);
xor_(scratch, left, t9);
and_(overflow_dst, scratch, overflow_dst);
}
« no previous file with comments | « src/mips/lithium-codegen-mips.cc ('k') | test/mjsunit/regress/regress-500176.js » ('j') | no next file with comments »

Powered by Google App Engine