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

Side by Side Diff: src/arm64/full-codegen-arm64.cc

Issue 487913005: ARM64: Fix SHR logic error. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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 | « no previous file | src/arm64/lithium-codegen-arm64.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_ARM64 7 #if V8_TARGET_ARCH_ARM64
8 8
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 2001 matching lines...) Expand 10 before | Expand all | Expand 10 after
2012 switch (op) { 2012 switch (op) {
2013 case Token::SAR: 2013 case Token::SAR:
2014 __ Ubfx(right, right, kSmiShift, 5); 2014 __ Ubfx(right, right, kSmiShift, 5);
2015 __ Asr(result, left, right); 2015 __ Asr(result, left, right);
2016 __ Bic(result, result, kSmiShiftMask); 2016 __ Bic(result, result, kSmiShiftMask);
2017 break; 2017 break;
2018 case Token::SHL: 2018 case Token::SHL:
2019 __ Ubfx(right, right, kSmiShift, 5); 2019 __ Ubfx(right, right, kSmiShift, 5);
2020 __ Lsl(result, left, right); 2020 __ Lsl(result, left, right);
2021 break; 2021 break;
2022 case Token::SHR: { 2022 case Token::SHR:
2023 Label right_not_zero; 2023 // If `left >>> right` >= 0x80000000, the result is not representable in a
2024 __ Cbnz(right, &right_not_zero); 2024 // signed 32-bit smi.
2025 __ Tbnz(left, kXSignBit, &stub_call);
2026 __ Bind(&right_not_zero);
2027 __ Ubfx(right, right, kSmiShift, 5); 2025 __ Ubfx(right, right, kSmiShift, 5);
2028 __ Lsr(result, left, right); 2026 __ Lsr(x10, left, right);
2029 __ Bic(result, result, kSmiShiftMask); 2027 __ Tbnz(x10, kXSignBit, &stub_call);
2028 __ Bic(result, x10, kSmiShiftMask);
2030 break; 2029 break;
2031 }
2032 case Token::ADD: 2030 case Token::ADD:
2033 __ Adds(x10, left, right); 2031 __ Adds(x10, left, right);
2034 __ B(vs, &stub_call); 2032 __ B(vs, &stub_call);
2035 __ Mov(result, x10); 2033 __ Mov(result, x10);
2036 break; 2034 break;
2037 case Token::SUB: 2035 case Token::SUB:
2038 __ Subs(x10, left, right); 2036 __ Subs(x10, left, right);
2039 __ B(vs, &stub_call); 2037 __ B(vs, &stub_call);
2040 __ Mov(result, x10); 2038 __ Mov(result, x10);
2041 break; 2039 break;
(...skipping 2870 matching lines...) Expand 10 before | Expand all | Expand 10 after
4912 return previous_; 4910 return previous_;
4913 } 4911 }
4914 4912
4915 4913
4916 #undef __ 4914 #undef __
4917 4915
4918 4916
4919 } } // namespace v8::internal 4917 } } // namespace v8::internal
4920 4918
4921 #endif // V8_TARGET_ARCH_ARM64 4919 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « no previous file | src/arm64/lithium-codegen-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698