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

Side by Side Diff: src/compiler/arm64/code-generator-arm64.cc

Issue 2105313002: [wasm] Detect unrepresentability in the float32-to-int32 conversion correctly on arm. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Update bounds in test-run-machops Created 4 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
« no previous file with comments | « src/compiler/arm/code-generator-arm.cc ('k') | src/wasm/wasm-interpreter.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 #include "src/compiler/code-generator.h" 5 #include "src/compiler/code-generator.h"
6 6
7 #include "src/arm64/frames-arm64.h" 7 #include "src/arm64/frames-arm64.h"
8 #include "src/arm64/macro-assembler-arm64.h" 8 #include "src/arm64/macro-assembler-arm64.h"
9 #include "src/ast/scopes.h" 9 #include "src/ast/scopes.h"
10 #include "src/compiler/code-generator-impl.h" 10 #include "src/compiler/code-generator-impl.h"
(...skipping 1305 matching lines...) Expand 10 before | Expand all | Expand 10 after
1316 __ Fsqrt(i.OutputDoubleRegister(), i.InputDoubleRegister(0)); 1316 __ Fsqrt(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
1317 break; 1317 break;
1318 case kArm64Float32ToFloat64: 1318 case kArm64Float32ToFloat64:
1319 __ Fcvt(i.OutputDoubleRegister(), i.InputDoubleRegister(0).S()); 1319 __ Fcvt(i.OutputDoubleRegister(), i.InputDoubleRegister(0).S());
1320 break; 1320 break;
1321 case kArm64Float64ToFloat32: 1321 case kArm64Float64ToFloat32:
1322 __ Fcvt(i.OutputDoubleRegister().S(), i.InputDoubleRegister(0)); 1322 __ Fcvt(i.OutputDoubleRegister().S(), i.InputDoubleRegister(0));
1323 break; 1323 break;
1324 case kArm64Float32ToInt32: 1324 case kArm64Float32ToInt32:
1325 __ Fcvtzs(i.OutputRegister32(), i.InputFloat32Register(0)); 1325 __ Fcvtzs(i.OutputRegister32(), i.InputFloat32Register(0));
1326 // Avoid INT32_MAX as an overflow indicator and use INT32_MIN instead,
1327 // because INT32_MIN allows easier out-of-bounds detection.
1328 __ Cmn(i.OutputRegister32(), 1);
1329 __ Csinc(i.OutputRegister32(), i.OutputRegister32(), i.OutputRegister32(),
1330 vc);
1326 break; 1331 break;
1327 case kArm64Float64ToInt32: 1332 case kArm64Float64ToInt32:
1328 __ Fcvtzs(i.OutputRegister32(), i.InputDoubleRegister(0)); 1333 __ Fcvtzs(i.OutputRegister32(), i.InputDoubleRegister(0));
1329 break; 1334 break;
1330 case kArm64Float32ToUint32: 1335 case kArm64Float32ToUint32:
1331 __ Fcvtzu(i.OutputRegister32(), i.InputFloat32Register(0)); 1336 __ Fcvtzu(i.OutputRegister32(), i.InputFloat32Register(0));
1337 // Avoid UINT32_MAX as an overflow indicator and use 0 instead,
1338 // because 0 allows easier out-of-bounds detection.
1339 __ Cmn(i.OutputRegister32(), 1);
1340 __ Csinc(i.OutputRegister32(), i.OutputRegister32(), i.OutputRegister32(),
Rodolph Perfetta (ARM) 2016/06/29 14:45:09 as per arm32: __ Adc(i.OutputRegister(), i.Outp
ahaas 2016/06/29 15:07:33 Done.
1341 cc);
1332 break; 1342 break;
1333 case kArm64Float64ToUint32: 1343 case kArm64Float64ToUint32:
1334 __ Fcvtzu(i.OutputRegister32(), i.InputDoubleRegister(0)); 1344 __ Fcvtzu(i.OutputRegister32(), i.InputDoubleRegister(0));
1335 break; 1345 break;
1336 case kArm64Float32ToInt64: 1346 case kArm64Float32ToInt64:
1337 __ Fcvtzs(i.OutputRegister64(), i.InputFloat32Register(0)); 1347 __ Fcvtzs(i.OutputRegister64(), i.InputFloat32Register(0));
1338 if (i.OutputCount() > 1) { 1348 if (i.OutputCount() > 1) {
1339 __ Mov(i.OutputRegister(1), 1); 1349 __ Mov(i.OutputRegister(1), 1);
1340 Label done; 1350 Label done;
1341 __ Cmp(i.OutputRegister(0), 1); 1351 __ Cmp(i.OutputRegister(0), 1);
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after
1987 padding_size -= kInstructionSize; 1997 padding_size -= kInstructionSize;
1988 } 1998 }
1989 } 1999 }
1990 } 2000 }
1991 2001
1992 #undef __ 2002 #undef __
1993 2003
1994 } // namespace compiler 2004 } // namespace compiler
1995 } // namespace internal 2005 } // namespace internal
1996 } // namespace v8 2006 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/arm/code-generator-arm.cc ('k') | src/wasm/wasm-interpreter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698