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

Side by Side Diff: src/base/bits.h

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/simulator-arm.cc ('k') | src/base/bits.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 #ifndef V8_BASE_BITS_H_ 5 #ifndef V8_BASE_BITS_H_
6 #define V8_BASE_BITS_H_ 6 #define V8_BASE_BITS_H_
7 7
8 #include "include/v8stdint.h" 8 #include "include/v8stdint.h"
9 #include "src/base/macros.h" 9 #include "src/base/macros.h"
10 #if V8_CC_MSVC 10 #if V8_CC_MSVC
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 inline bool SignedSubOverflow32(int32_t lhs, int32_t rhs, int32_t* val) { 180 inline bool SignedSubOverflow32(int32_t lhs, int32_t rhs, int32_t* val) {
181 #if V8_HAS_BUILTIN_SSUB_OVERFLOW 181 #if V8_HAS_BUILTIN_SSUB_OVERFLOW
182 return __builtin_ssub_overflow(lhs, rhs, val); 182 return __builtin_ssub_overflow(lhs, rhs, val);
183 #else 183 #else
184 uint32_t res = static_cast<uint32_t>(lhs) - static_cast<uint32_t>(rhs); 184 uint32_t res = static_cast<uint32_t>(lhs) - static_cast<uint32_t>(rhs);
185 *val = bit_cast<int32_t>(res); 185 *val = bit_cast<int32_t>(res);
186 return ((res ^ lhs) & (res ^ ~rhs) & (1U << 31)) != 0; 186 return ((res ^ lhs) & (res ^ ~rhs) & (1U << 31)) != 0;
187 #endif 187 #endif
188 } 188 }
189 189
190
191 // SignedMulHigh32(lhs, rhs) multiplies two signed 32-bit values |lhs| and
192 // |rhs|, extracts the most significant 32 bits of the result, and returns
193 // those.
194 int32_t SignedMulHigh32(int32_t lhs, int32_t rhs);
195
196
197 // SignedMulHighAndAdd32(lhs, rhs, acc) multiplies two signed 32-bit values
198 // |lhs| and |rhs|, extracts the most significant 32 bits of the result, and
199 // adds the accumulate value |acc|.
200 int32_t SignedMulHighAndAdd32(int32_t lhs, int32_t rhs, int32_t acc);
201
202
203 // SignedMulHighAndAdd32(lhs, rhs, acc) multiplies two signed 32-bit values
204 // |lhs| and |rhs|, extracts the most significant 32 bits of the result, and
205 // subtracts it from the accumulate value |acc|.
206 int32_t SignedMulHighAndSub32(int32_t lhs, int32_t rhs, int32_t acc);
207
190 } // namespace bits 208 } // namespace bits
191 } // namespace base 209 } // namespace base
192 } // namespace v8 210 } // namespace v8
193 211
194 #endif // V8_BASE_BITS_H_ 212 #endif // V8_BASE_BITS_H_
OLDNEW
« no previous file with comments | « src/arm/simulator-arm.cc ('k') | src/base/bits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698