OLD | NEW |
---|---|
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 Loading... | |
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 __ Adc(i.OutputRegister(), i.OutputRegister(), Operand(0)); | |
Rodolph Perfetta (ARM)
2016/06/29 15:42:18
i.OutputRegister32(), I made the mistake in my pre
ahaas
2016/06/29 15:49:53
Done. Thanks for looking at it so carefully again.
| |
1332 break; | 1341 break; |
1333 case kArm64Float64ToUint32: | 1342 case kArm64Float64ToUint32: |
1334 __ Fcvtzu(i.OutputRegister32(), i.InputDoubleRegister(0)); | 1343 __ Fcvtzu(i.OutputRegister32(), i.InputDoubleRegister(0)); |
1335 break; | 1344 break; |
1336 case kArm64Float32ToInt64: | 1345 case kArm64Float32ToInt64: |
1337 __ Fcvtzs(i.OutputRegister64(), i.InputFloat32Register(0)); | 1346 __ Fcvtzs(i.OutputRegister64(), i.InputFloat32Register(0)); |
1338 if (i.OutputCount() > 1) { | 1347 if (i.OutputCount() > 1) { |
1339 __ Mov(i.OutputRegister(1), 1); | 1348 __ Mov(i.OutputRegister(1), 1); |
1340 Label done; | 1349 Label done; |
1341 __ Cmp(i.OutputRegister(0), 1); | 1350 __ Cmp(i.OutputRegister(0), 1); |
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1987 padding_size -= kInstructionSize; | 1996 padding_size -= kInstructionSize; |
1988 } | 1997 } |
1989 } | 1998 } |
1990 } | 1999 } |
1991 | 2000 |
1992 #undef __ | 2001 #undef __ |
1993 | 2002 |
1994 } // namespace compiler | 2003 } // namespace compiler |
1995 } // namespace internal | 2004 } // namespace internal |
1996 } // namespace v8 | 2005 } // namespace v8 |
OLD | NEW |