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

Side by Side Diff: src/arm/macro-assembler-arm.cc

Issue 648283002: [arm] Add support for SMMLA, SMMLS and SMMUL. (Closed) Base URL: git@github.com:v8/v8.git@master
Patch Set: Fix Created 6 years, 2 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
« no previous file with comments | « src/arm/disasm-arm.cc ('k') | src/arm/simulator-arm.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <limits.h> // For LONG_MIN, LONG_MAX. 5 #include <limits.h> // For LONG_MIN, LONG_MAX.
6 6
7 #include "src/v8.h" 7 #include "src/v8.h"
8 8
9 #if V8_TARGET_ARCH_ARM 9 #if V8_TARGET_ARCH_ARM
10 10
(...skipping 4053 matching lines...) Expand 10 before | Expand all | Expand 10 after
4064 } 4064 }
4065 4065
4066 4066
4067 void MacroAssembler::TruncatingDiv(Register result, 4067 void MacroAssembler::TruncatingDiv(Register result,
4068 Register dividend, 4068 Register dividend,
4069 int32_t divisor) { 4069 int32_t divisor) {
4070 DCHECK(!dividend.is(result)); 4070 DCHECK(!dividend.is(result));
4071 DCHECK(!dividend.is(ip)); 4071 DCHECK(!dividend.is(ip));
4072 DCHECK(!result.is(ip)); 4072 DCHECK(!result.is(ip));
4073 base::MagicNumbersForDivision<uint32_t> mag = 4073 base::MagicNumbersForDivision<uint32_t> mag =
4074 base::SignedDivisionByConstant(static_cast<uint32_t>(divisor)); 4074 base::SignedDivisionByConstant(bit_cast<uint32_t>(divisor));
4075 mov(ip, Operand(mag.multiplier)); 4075 mov(ip, Operand(mag.multiplier));
4076 smull(ip, result, dividend, ip); 4076 bool neg = (mag.multiplier & (1U << 31)) != 0;
4077 bool neg = (mag.multiplier & (static_cast<uint32_t>(1) << 31)) != 0;
4078 if (divisor > 0 && neg) { 4077 if (divisor > 0 && neg) {
4079 add(result, result, Operand(dividend)); 4078 smmla(result, dividend, ip, dividend);
4080 } 4079 } else {
4081 if (divisor < 0 && !neg && mag.multiplier > 0) { 4080 smmul(result, dividend, ip);
4082 sub(result, result, Operand(dividend)); 4081 if (divisor < 0 && !neg && mag.multiplier > 0) {
4082 sub(result, result, Operand(dividend));
4083 }
4083 } 4084 }
4084 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); 4085 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift));
4085 add(result, result, Operand(dividend, LSR, 31)); 4086 add(result, result, Operand(dividend, LSR, 31));
4086 } 4087 }
4087 4088
4088 4089 } // namespace internal
4089 } } // namespace v8::internal 4090 } // namespace v8
4090 4091
4091 #endif // V8_TARGET_ARCH_ARM 4092 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/disasm-arm.cc ('k') | src/arm/simulator-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698