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

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

Issue 1962563003: [x64] Fix testw with immediates. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 | « no previous file | test/cctest/test-assembler-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 2077 matching lines...) Expand 10 before | Expand all | Expand 10 after
2088 emit(0x85); 2088 emit(0x85);
2089 emit_modrm(src, dst); 2089 emit_modrm(src, dst);
2090 } 2090 }
2091 2091
2092 void Assembler::testw(Register reg, Immediate mask) { 2092 void Assembler::testw(Register reg, Immediate mask) {
2093 DCHECK(is_int16(mask.value_) || is_uint16(mask.value_)); 2093 DCHECK(is_int16(mask.value_) || is_uint16(mask.value_));
2094 EnsureSpace ensure_space(this); 2094 EnsureSpace ensure_space(this);
2095 emit(0x66); 2095 emit(0x66);
2096 if (reg.is(rax)) { 2096 if (reg.is(rax)) {
2097 emit(0xA9); 2097 emit(0xA9);
2098 emit(mask.value_); 2098 emitw(mask.value_);
2099 } else { 2099 } else {
2100 if (reg.low_bits() == 4) { 2100 if (reg.low_bits() == 4) {
2101 emit_rex_32(reg); 2101 emit_rex_32(reg);
2102 } 2102 }
2103 emit(0xF7); 2103 emit(0xF7);
2104 emit_modrm(0x0, reg); 2104 emit_modrm(0x0, reg);
2105 emit(mask.value_); 2105 emitw(mask.value_);
2106 } 2106 }
2107 } 2107 }
2108 2108
2109 void Assembler::testw(const Operand& op, Immediate mask) { 2109 void Assembler::testw(const Operand& op, Immediate mask) {
2110 DCHECK(is_int16(mask.value_) || is_uint16(mask.value_)); 2110 DCHECK(is_int16(mask.value_) || is_uint16(mask.value_));
2111 EnsureSpace ensure_space(this); 2111 EnsureSpace ensure_space(this);
2112 emit(0x66); 2112 emit(0x66);
2113 emit_optional_rex_32(rax, op); 2113 emit_optional_rex_32(rax, op);
2114 emit(0xF7); 2114 emit(0xF7);
2115 emit_operand(rax, op); 2115 emit_operand(rax, op);
2116 emit(mask.value_); 2116 emitw(mask.value_);
2117 } 2117 }
2118 2118
2119 void Assembler::testw(const Operand& op, Register reg) { 2119 void Assembler::testw(const Operand& op, Register reg) {
2120 EnsureSpace ensure_space(this); 2120 EnsureSpace ensure_space(this);
2121 emit(0x66); 2121 emit(0x66);
2122 emit_optional_rex_32(reg, op); 2122 emit_optional_rex_32(reg, op);
2123 emit(0x85); 2123 emit(0x85);
2124 emit_operand(rax, op); 2124 emit_operand(rax, op);
2125 } 2125 }
2126 2126
(...skipping 2131 matching lines...) Expand 10 before | Expand all | Expand 10 after
4258 4258
4259 bool RelocInfo::IsInConstantPool() { 4259 bool RelocInfo::IsInConstantPool() {
4260 return false; 4260 return false;
4261 } 4261 }
4262 4262
4263 4263
4264 } // namespace internal 4264 } // namespace internal
4265 } // namespace v8 4265 } // namespace v8
4266 4266
4267 #endif // V8_TARGET_ARCH_X64 4267 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698