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

Unified Diff: runtime/vm/assembler_arm.cc

Issue 12459005: Adds muls, sdiv, udiv instructions to ARM simulator, assembler, disassembler (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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
« no previous file with comments | « runtime/vm/assembler_arm.h ('k') | runtime/vm/assembler_arm_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_arm.cc
===================================================================
--- runtime/vm/assembler_arm.cc (revision 19488)
+++ runtime/vm/assembler_arm.cc (working copy)
@@ -459,6 +459,13 @@
}
+// Like mul, but sets condition flags.
+void Assembler::muls(Register rd, Register rn,
+ Register rm, Condition cond) {
+ EmitMulOp(cond, B20, R0, rd, rn, rm);
+}
+
+
void Assembler::mla(Register rd, Register rn,
Register rm, Register ra, Condition cond) {
// Assembler registers rd, rn, rm, ra are encoded as rn, rm, rs, rd.
@@ -480,6 +487,33 @@
}
+void Assembler::EmitDivOp(Condition cond, int32_t opcode,
+ Register rd, Register rn, Register rm) {
+ ASSERT(CPUFeatures::integer_division_supported());
+ ASSERT(rd != kNoRegister);
+ ASSERT(rn != kNoRegister);
+ ASSERT(rm != kNoRegister);
+ ASSERT(cond != kNoCondition);
+ int32_t encoding = opcode |
+ (static_cast<int32_t>(cond) << kConditionShift) |
+ (static_cast<int32_t>(rn) << kRnShift) |
+ (static_cast<int32_t>(rd) << kRdShift) |
+ B26 | B25 | B24 | B20 | B4 |
+ (static_cast<int32_t>(rm) << kRmShift);
+ Emit(encoding);
+}
+
+
+void Assembler::sdiv(Register rd, Register rn, Register rm, Condition cond) {
+ EmitDivOp(cond, 0, rd, rn, rm);
+}
+
+
+void Assembler::udiv(Register rd, Register rn, Register rm, Condition cond) {
+ EmitDivOp(cond, B21 , rd, rn, rm);
+}
+
+
void Assembler::ldr(Register rd, Address ad, Condition cond) {
EmitMemOp(cond, true, false, rd, ad);
}
« no previous file with comments | « runtime/vm/assembler_arm.h ('k') | runtime/vm/assembler_arm_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698