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 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/base/division-by-constant.h" | 8 #include "src/base/division-by-constant.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1107 xorl(dst, dst); | 1107 xorl(dst, dst); |
1108 } else if (is_uint32(x)) { | 1108 } else if (is_uint32(x)) { |
1109 movl(dst, Immediate(static_cast<uint32_t>(x))); | 1109 movl(dst, Immediate(static_cast<uint32_t>(x))); |
1110 } else if (is_int32(x)) { | 1110 } else if (is_int32(x)) { |
1111 movq(dst, Immediate(static_cast<int32_t>(x))); | 1111 movq(dst, Immediate(static_cast<int32_t>(x))); |
1112 } else { | 1112 } else { |
1113 movq(dst, x); | 1113 movq(dst, x); |
1114 } | 1114 } |
1115 } | 1115 } |
1116 | 1116 |
| 1117 void MacroAssembler::Set(Register dst, int64_t x, RelocInfo::Mode rmode) { |
| 1118 if (rmode == RelocInfo::WASM_MEMORY_REFERENCE) { |
| 1119 DCHECK(x != 0); |
| 1120 movq(dst, x, rmode); |
| 1121 } else { |
| 1122 DCHECK(RelocInfo::IsNone(rmode)); |
| 1123 } |
| 1124 } |
| 1125 |
1117 void MacroAssembler::Set(const Operand& dst, intptr_t x) { | 1126 void MacroAssembler::Set(const Operand& dst, intptr_t x) { |
1118 if (kPointerSize == kInt64Size) { | 1127 if (kPointerSize == kInt64Size) { |
1119 if (is_int32(x)) { | 1128 if (is_int32(x)) { |
1120 movp(dst, Immediate(static_cast<int32_t>(x))); | 1129 movp(dst, Immediate(static_cast<int32_t>(x))); |
1121 } else { | 1130 } else { |
1122 Set(kScratchRegister, x); | 1131 Set(kScratchRegister, x); |
1123 movp(dst, kScratchRegister); | 1132 movp(dst, kScratchRegister); |
1124 } | 1133 } |
1125 } else { | 1134 } else { |
1126 movp(dst, Immediate(static_cast<int32_t>(x))); | 1135 movp(dst, Immediate(static_cast<int32_t>(x))); |
(...skipping 4545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5672 movl(rax, dividend); | 5681 movl(rax, dividend); |
5673 shrl(rax, Immediate(31)); | 5682 shrl(rax, Immediate(31)); |
5674 addl(rdx, rax); | 5683 addl(rdx, rax); |
5675 } | 5684 } |
5676 | 5685 |
5677 | 5686 |
5678 } // namespace internal | 5687 } // namespace internal |
5679 } // namespace v8 | 5688 } // namespace v8 |
5680 | 5689 |
5681 #endif // V8_TARGET_ARCH_X64 | 5690 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |