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 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1049 | 1049 |
1050 | 1050 |
1051 void MacroAssembler::VmovLow(DwVfpRegister dst, Register src) { | 1051 void MacroAssembler::VmovLow(DwVfpRegister dst, Register src) { |
1052 if (dst.code() < 16) { | 1052 if (dst.code() < 16) { |
1053 const LowDwVfpRegister loc = LowDwVfpRegister::from_code(dst.code()); | 1053 const LowDwVfpRegister loc = LowDwVfpRegister::from_code(dst.code()); |
1054 vmov(loc.low(), src); | 1054 vmov(loc.low(), src); |
1055 } else { | 1055 } else { |
1056 vmov(dst, VmovIndexLo, src); | 1056 vmov(dst, VmovIndexLo, src); |
1057 } | 1057 } |
1058 } | 1058 } |
1059 void MacroAssembler::PairLsl(Register dst_low, Register dst_high, | |
1060 Register src_low, Register src_high, | |
1061 Register scratch, Register shift) { | |
1062 Label less_than_32; | |
martyn.capewell
2016/03/04 18:54:57
Add some register alias assertions: perhaps !AreAl
ahaas
2016/03/07 13:40:49
I enforced src_low == dst_low now in the register
| |
1063 Label done; | |
1064 cmp_raw_immediate(shift, 32); | |
1065 b(lt, &less_than_32); | |
1066 eor(dst_low, dst_low, Operand(dst_low)); | |
martyn.capewell
2016/03/04 18:54:57
mov(dst_low, Operand(0))
martyn.capewell
2016/03/04 18:54:57
Switching zero and shift operations here would all
ahaas
2016/03/07 13:40:48
Done.
| |
1067 and_(scratch, shift, Operand(0x1f)); | |
1068 lsl(dst_high, src_low, Operand(scratch)); | |
1069 jmp(&done); | |
1070 bind(&less_than_32); | |
1071 rsb(scratch, shift, Operand(32)); | |
1072 lsr(dst_low, src_low, Operand(scratch)); | |
1073 lsl(dst_high, src_high, Operand(shift)); | |
1074 orr(dst_high, dst_high, dst_low); | |
1075 lsl(dst_low, src_low, Operand(shift)); | |
martyn.capewell
2016/03/04 18:54:57
You can combine shift with orr here:
lsl(dst_hig
ahaas
2016/03/07 13:40:48
Thanks, that's really helpful.
| |
1076 bind(&done); | |
1077 } | |
1059 | 1078 |
1079 void MacroAssembler::PairLsl(Register dst_low, Register dst_high, | |
1080 Register src_low, Register src_high, | |
1081 Register scratch, uint32_t shift) { | |
martyn.capewell
2016/03/04 18:54:57
scratch isn't used.
ahaas
2016/03/07 13:40:49
I removed it.
| |
1082 Label less_than_32; | |
martyn.capewell
2016/03/04 18:54:57
Add some register alias assertions. At the top lev
ahaas
2016/03/07 13:40:49
Done.
| |
1083 Label done; | |
1084 if (shift >= 32) { | |
martyn.capewell
2016/03/04 18:54:57
Switch the zero and shift instructions here, so ds
ahaas
2016/03/07 13:40:49
Done.
| |
1085 eor(dst_low, dst_low, Operand(dst_low)); | |
martyn.capewell
2016/03/04 18:54:57
mov(dst_low, Operand(0))
ahaas
2016/03/07 13:40:48
Done.
| |
1086 shift &= 0x1f; | |
1087 lsl(dst_high, src_low, Operand(shift)); | |
1088 } else if (shift == 0) { | |
martyn.capewell
2016/03/04 18:54:57
Assert dst_low != src_high.
| |
1089 mov(dst_low, src_low); | |
martyn.capewell
2016/03/04 18:54:57
Use Move() here to eliminate redundant instruction
ahaas
2016/03/07 13:40:49
Aha, that's useful. Thanks.
| |
1090 mov(dst_high, src_high); | |
1091 } else { | |
1092 lsr(dst_low, src_low, Operand(32 - shift)); | |
1093 lsl(dst_high, src_high, Operand(shift)); | |
1094 orr(dst_high, dst_high, dst_low); | |
1095 lsl(dst_low, src_low, Operand(shift)); | |
martyn.capewell
2016/03/04 18:54:57
Combine shift with orr:
lsl(dst_high, src_high,
ahaas
2016/03/07 13:40:48
Done.
| |
1096 } | |
1097 } | |
1060 | 1098 |
1061 void MacroAssembler::LoadConstantPoolPointerRegisterFromCodeTargetAddress( | 1099 void MacroAssembler::LoadConstantPoolPointerRegisterFromCodeTargetAddress( |
1062 Register code_target_address) { | 1100 Register code_target_address) { |
1063 DCHECK(FLAG_enable_embedded_constant_pool); | 1101 DCHECK(FLAG_enable_embedded_constant_pool); |
1064 ldr(pp, MemOperand(code_target_address, | 1102 ldr(pp, MemOperand(code_target_address, |
1065 Code::kConstantPoolOffset - Code::kHeaderSize)); | 1103 Code::kConstantPoolOffset - Code::kHeaderSize)); |
1066 add(pp, pp, code_target_address); | 1104 add(pp, pp, code_target_address); |
1067 } | 1105 } |
1068 | 1106 |
1069 | 1107 |
(...skipping 2618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3688 } | 3726 } |
3689 } | 3727 } |
3690 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); | 3728 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); |
3691 add(result, result, Operand(dividend, LSR, 31)); | 3729 add(result, result, Operand(dividend, LSR, 31)); |
3692 } | 3730 } |
3693 | 3731 |
3694 } // namespace internal | 3732 } // namespace internal |
3695 } // namespace v8 | 3733 } // namespace v8 |
3696 | 3734 |
3697 #endif // V8_TARGET_ARCH_ARM | 3735 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |