Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Unified Diff: src/arm/simulator-arm.cc

Issue 1778893005: [wasm] Int64Lowering of Int64Sub on ia32 and arm. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@wasm-add
Patch Set: copy paste mistake Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/arm/simulator-arm.cc
diff --git a/src/arm/simulator-arm.cc b/src/arm/simulator-arm.cc
index 7687bbbe7c91f123db176c08f5a78f26df477142..490d9617ada877641eae503803ad5a8bc8d1d1a9 100644
--- a/src/arm/simulator-arm.cc
+++ b/src/arm/simulator-arm.cc
@@ -1333,11 +1333,12 @@ bool Simulator::CarryFrom(int32_t left, int32_t right, int32_t carry) {
// Calculate C flag value for subtractions.
-bool Simulator::BorrowFrom(int32_t left, int32_t right) {
+bool Simulator::BorrowFrom(int32_t left, int32_t right, int32_t carry) {
uint32_t uleft = static_cast<uint32_t>(left);
uint32_t uright = static_cast<uint32_t>(right);
- return (uright > uleft);
+ return (uright > uleft) ||
+ (carry && (((uright + 1) > uleft) || (uright > (uleft - 1))));
}
@@ -2493,8 +2494,15 @@ void Simulator::DecodeType01(Instruction* instr) {
}
case SBC: {
- Format(instr, "sbc'cond's 'rd, 'rn, 'shift_rm");
- Format(instr, "sbc'cond's 'rd, 'rn, 'imm");
+ // Format(instr, "sbc'cond's 'rd, 'rn, 'shift_rm");
+ // Format(instr, "sbc'cond's 'rd, 'rn, 'imm");
+ alu_out = (rn_val - shifter_operand) - (GetCarry() ? 0 : 1);
titzer 2016/03/14 09:36:06 Why is carry inverted here?
ahaas 2016/03/15 11:01:43 Because the arm instruction manual says so.
+ set_register(rd, alu_out);
+ if (instr->HasS()) {
+ SetNZFlags(alu_out);
+ SetCFlag(!BorrowFrom(rn_val, shifter_operand, GetCarry()));
+ SetVFlag(OverflowFrom(alu_out, rn_val, shifter_operand, false));
+ }
break;
}

Powered by Google App Engine
This is Rietveld 408576698