OLD | NEW |
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 #if V8_TARGET_ARCH_ARM | 7 #if V8_TARGET_ARCH_ARM |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/base/division-by-constant.h" | 10 #include "src/base/division-by-constant.h" |
(...skipping 3360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3371 b(&align_loop_1); | 3371 b(&align_loop_1); |
3372 // Copy bytes in word size chunks. | 3372 // Copy bytes in word size chunks. |
3373 bind(&word_loop); | 3373 bind(&word_loop); |
3374 if (emit_debug_code()) { | 3374 if (emit_debug_code()) { |
3375 tst(src, Operand(kPointerSize - 1)); | 3375 tst(src, Operand(kPointerSize - 1)); |
3376 Assert(eq, kExpectingAlignmentForCopyBytes); | 3376 Assert(eq, kExpectingAlignmentForCopyBytes); |
3377 } | 3377 } |
3378 cmp(length, Operand(kPointerSize)); | 3378 cmp(length, Operand(kPointerSize)); |
3379 b(lt, &byte_loop); | 3379 b(lt, &byte_loop); |
3380 ldr(scratch, MemOperand(src, kPointerSize, PostIndex)); | 3380 ldr(scratch, MemOperand(src, kPointerSize, PostIndex)); |
3381 if (CpuFeatures::IsSupported(UNALIGNED_ACCESSES)) { | 3381 str(scratch, MemOperand(dst, kPointerSize, PostIndex)); |
3382 str(scratch, MemOperand(dst, kPointerSize, PostIndex)); | |
3383 } else { | |
3384 strb(scratch, MemOperand(dst, 1, PostIndex)); | |
3385 mov(scratch, Operand(scratch, LSR, 8)); | |
3386 strb(scratch, MemOperand(dst, 1, PostIndex)); | |
3387 mov(scratch, Operand(scratch, LSR, 8)); | |
3388 strb(scratch, MemOperand(dst, 1, PostIndex)); | |
3389 mov(scratch, Operand(scratch, LSR, 8)); | |
3390 strb(scratch, MemOperand(dst, 1, PostIndex)); | |
3391 } | |
3392 sub(length, length, Operand(kPointerSize)); | 3382 sub(length, length, Operand(kPointerSize)); |
3393 b(&word_loop); | 3383 b(&word_loop); |
3394 | 3384 |
3395 // Copy the last bytes if any left. | 3385 // Copy the last bytes if any left. |
3396 bind(&byte_loop); | 3386 bind(&byte_loop); |
3397 cmp(length, Operand::Zero()); | 3387 cmp(length, Operand::Zero()); |
3398 b(eq, &done); | 3388 b(eq, &done); |
3399 bind(&byte_loop_1); | 3389 bind(&byte_loop_1); |
3400 ldrb(scratch, MemOperand(src, 1, PostIndex)); | 3390 ldrb(scratch, MemOperand(src, 1, PostIndex)); |
3401 strb(scratch, MemOperand(dst, 1, PostIndex)); | 3391 strb(scratch, MemOperand(dst, 1, PostIndex)); |
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4038 } | 4028 } |
4039 } | 4029 } |
4040 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); | 4030 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); |
4041 add(result, result, Operand(dividend, LSR, 31)); | 4031 add(result, result, Operand(dividend, LSR, 31)); |
4042 } | 4032 } |
4043 | 4033 |
4044 } // namespace internal | 4034 } // namespace internal |
4045 } // namespace v8 | 4035 } // namespace v8 |
4046 | 4036 |
4047 #endif // V8_TARGET_ARCH_ARM | 4037 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |