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

Side by Side Diff: runtime/vm/assembler_arm.cc

Issue 18331006: Adds support for integer division for ARM chips without the sdiv instruction. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/assembler_arm.h ('k') | runtime/vm/assembler_arm_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" 5 #include "vm/globals.h"
6 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/simulator.h" 9 #include "vm/simulator.h"
10 #include "vm/runtime_entry.h" 10 #include "vm/runtime_entry.h"
(...skipping 1925 matching lines...) Expand 10 before | Expand all | Expand 10 after
1936 if (ShifterOperand::CanHold(value, &shifter_op)) { 1936 if (ShifterOperand::CanHold(value, &shifter_op)) {
1937 cmp(rn, shifter_op, cond); 1937 cmp(rn, shifter_op, cond);
1938 } else { 1938 } else {
1939 ASSERT(rn != IP); 1939 ASSERT(rn != IP);
1940 LoadImmediate(IP, value, cond); 1940 LoadImmediate(IP, value, cond);
1941 cmp(rn, ShifterOperand(IP), cond); 1941 cmp(rn, ShifterOperand(IP), cond);
1942 } 1942 }
1943 } 1943 }
1944 1944
1945 1945
1946 void Assembler::IntegerDivide(Register result, Register left, Register right,
1947 DRegister tmpl, DRegister tmpr) {
1948 ASSERT(tmpl != tmpr);
1949 if (CPUFeatures::integer_division_supported()) {
1950 sdiv(result, left, right);
1951 } else {
1952 SRegister stmpl = static_cast<SRegister>(2 * tmpl);
1953 SRegister stmpr = static_cast<SRegister>(2 * tmpr);
1954 vmovsr(stmpl, left);
1955 vcvtdi(tmpl, stmpl); // left is in tmpl.
1956 vmovsr(stmpr, right);
1957 vcvtdi(tmpr, stmpr); // right is in tmpr.
1958 vdivd(tmpr, tmpl, tmpr);
1959 vcvtid(stmpr, tmpr);
1960 vmovrs(result, stmpr);
1961 }
1962 }
1963
1964
1946 static int NumRegsBelowFP(RegList regs) { 1965 static int NumRegsBelowFP(RegList regs) {
1947 int count = 0; 1966 int count = 0;
1948 for (int i = 0; i < FP; i++) { 1967 for (int i = 0; i < FP; i++) {
1949 if ((regs & (1 << i)) != 0) { 1968 if ((regs & (1 << i)) != 0) {
1950 count++; 1969 count++;
1951 } 1970 }
1952 } 1971 }
1953 return count; 1972 return count;
1954 } 1973 }
1955 1974
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
2216 2235
2217 const char* Assembler::FpuRegisterName(FpuRegister reg) { 2236 const char* Assembler::FpuRegisterName(FpuRegister reg) {
2218 ASSERT((0 <= reg) && (reg < kNumberOfFpuRegisters)); 2237 ASSERT((0 <= reg) && (reg < kNumberOfFpuRegisters));
2219 return fpu_reg_names[reg]; 2238 return fpu_reg_names[reg];
2220 } 2239 }
2221 2240
2222 } // namespace dart 2241 } // namespace dart
2223 2242
2224 #endif // defined TARGET_ARCH_ARM 2243 #endif // defined TARGET_ARCH_ARM
2225 2244
OLDNEW
« 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