Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 // tmpl can't be DTMP because we subsequently use STMP, but tmpr can be | |
| 1949 // DTMP because we do the divide immediately after writing it. | |
| 1950 ASSERT(tmpl != DTMP); | |
| 1951 if (CPUFeatures::integer_division_supported()) { | |
| 1952 sdiv(result, left, right); | |
| 1953 } else { | |
| 1954 vmovsr(STMP, left); | |
|
regis
2013/07/01 16:54:09
STMP -> static_cast<SRegister>(2 * tmpl)
ditto for
zra
2013/07/01 17:43:46
Done.
| |
| 1955 vcvtdi(tmpl, STMP); // left is in tmpl. | |
| 1956 vmovsr(STMP, right); | |
| 1957 vcvtdi(tmpr, STMP); // right is in tmpr. | |
| 1958 vdivd(tmpr, tmpl, tmpr); | |
| 1959 vcvtid(STMP, tmpr); | |
| 1960 vmovrs(result, STMP); | |
| 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 Loading... | |
| 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 |
| OLD | NEW |