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

Side by Side Diff: src/x64/assembler-x64.cc

Issue 1986113004: Add cmpxchg and lock instructions to x64 and ia32 {dis,}assemblers (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: merge master Created 4 years, 7 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/x64/assembler-x64.h ('k') | src/x64/disasm-x64.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 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 "src/x64/assembler-x64.h" 5 #include "src/x64/assembler-x64.h"
6 6
7 #include <cstring> 7 #include <cstring>
8 8
9 #if V8_TARGET_ARCH_X64 9 #if V8_TARGET_ARCH_X64
10 10
(...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after
1009 } 1009 }
1010 1010
1011 1011
1012 void Assembler::cmpb_al(Immediate imm8) { 1012 void Assembler::cmpb_al(Immediate imm8) {
1013 DCHECK(is_int8(imm8.value_) || is_uint8(imm8.value_)); 1013 DCHECK(is_int8(imm8.value_) || is_uint8(imm8.value_));
1014 EnsureSpace ensure_space(this); 1014 EnsureSpace ensure_space(this);
1015 emit(0x3c); 1015 emit(0x3c);
1016 emit(imm8.value_); 1016 emit(imm8.value_);
1017 } 1017 }
1018 1018
1019 void Assembler::lock() {
1020 EnsureSpace ensure_space(this);
1021 emit(0xf0);
1022 }
1023
1024 void Assembler::cmpxchgb(const Operand& dst, Register src) {
1025 EnsureSpace ensure_space(this);
1026 if (!src.is_byte_register()) {
1027 // Register is not one of al, bl, cl, dl. Its encoding needs REX.
1028 emit_rex_32(src, dst);
1029 } else {
1030 emit_optional_rex_32(src, dst);
1031 }
1032 emit(0x0f);
1033 emit(0xb0);
1034 emit_operand(src, dst);
1035 }
1036
1037 void Assembler::cmpxchgw(const Operand& dst, Register src) {
1038 EnsureSpace ensure_space(this);
1039 emit(0x66);
1040 emit_optional_rex_32(src, dst);
1041 emit(0x0f);
1042 emit(0xb1);
1043 emit_operand(src, dst);
1044 }
1045
1046 void Assembler::emit_cmpxchg(const Operand& dst, Register src, int size) {
1047 EnsureSpace ensure_space(this);
1048 emit_rex(src, dst, size);
1049 emit(0x0f);
1050 emit(0xb1);
1051 emit_operand(src, dst);
1052 }
1019 1053
1020 void Assembler::cpuid() { 1054 void Assembler::cpuid() {
1021 EnsureSpace ensure_space(this); 1055 EnsureSpace ensure_space(this);
1022 emit(0x0F); 1056 emit(0x0F);
1023 emit(0xA2); 1057 emit(0xA2);
1024 } 1058 }
1025 1059
1026 1060
1027 void Assembler::cqo() { 1061 void Assembler::cqo() {
1028 EnsureSpace ensure_space(this); 1062 EnsureSpace ensure_space(this);
(...skipping 3229 matching lines...) Expand 10 before | Expand all | Expand 10 after
4258 4292
4259 bool RelocInfo::IsInConstantPool() { 4293 bool RelocInfo::IsInConstantPool() {
4260 return false; 4294 return false;
4261 } 4295 }
4262 4296
4263 4297
4264 } // namespace internal 4298 } // namespace internal
4265 } // namespace v8 4299 } // namespace v8
4266 4300
4267 #endif // V8_TARGET_ARCH_X64 4301 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/assembler-x64.h ('k') | src/x64/disasm-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698