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

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

Issue 1845603002: [ia32] Byte and word memory operands in ia32 cmp/test. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Update. Created 4 years, 8 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/ia32/assembler-ia32.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. 1 // Copyright (c) 1994-2006 Sun Microsystems Inc.
2 // All Rights Reserved. 2 // All Rights Reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions 5 // modification, are permitted provided that the following conditions
6 // are met: 6 // are met:
7 // 7 //
8 // - Redistributions of source code must retain the above copyright notice, 8 // - Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer. 9 // this list of conditions and the following disclaimer.
10 // 10 //
(...skipping 1239 matching lines...) Expand 10 before | Expand all | Expand 10 after
1250 if (op.is_reg_only()) { 1250 if (op.is_reg_only()) {
1251 test_b(op.reg(), imm8); 1251 test_b(op.reg(), imm8);
1252 return; 1252 return;
1253 } 1253 }
1254 EnsureSpace ensure_space(this); 1254 EnsureSpace ensure_space(this);
1255 EMIT(0xF6); 1255 EMIT(0xF6);
1256 emit_operand(eax, op); 1256 emit_operand(eax, op);
1257 emit_b(imm8); 1257 emit_b(imm8);
1258 } 1258 }
1259 1259
1260 void Assembler::test_w(Register reg, Immediate imm16) {
1261 DCHECK(imm16.is_int16() || imm16.is_uint16());
1262 EnsureSpace ensure_space(this);
1263 if (reg.is(eax)) {
1264 EMIT(0xA9);
1265 emit_w(imm16);
1266 } else {
1267 EMIT(0x66);
1268 EMIT(0xF7);
1269 EMIT(0xc0 | reg.code());
1270 emit_w(imm16);
1271 }
1272 }
1273
1274 void Assembler::test_w(Register reg, const Operand& op) {
1275 EnsureSpace ensure_space(this);
1276 EMIT(0x66);
1277 EMIT(0x85);
1278 emit_operand(reg, op);
1279 }
1280
1281 void Assembler::test_w(const Operand& op, Immediate imm16) {
1282 DCHECK(imm16.is_int16() || imm16.is_uint16());
1283 if (op.is_reg_only()) {
1284 test_w(op.reg(), imm16);
1285 return;
1286 }
1287 EnsureSpace ensure_space(this);
1288 EMIT(0x66);
1289 EMIT(0xF7);
1290 emit_operand(eax, op);
1291 emit_w(imm16);
1292 }
1260 1293
1261 void Assembler::xor_(Register dst, int32_t imm32) { 1294 void Assembler::xor_(Register dst, int32_t imm32) {
1262 EnsureSpace ensure_space(this); 1295 EnsureSpace ensure_space(this);
1263 emit_arith(6, Operand(dst), Immediate(imm32)); 1296 emit_arith(6, Operand(dst), Immediate(imm32));
1264 } 1297 }
1265 1298
1266 1299
1267 void Assembler::xor_(Register dst, const Operand& src) { 1300 void Assembler::xor_(Register dst, const Operand& src) {
1268 EnsureSpace ensure_space(this); 1301 EnsureSpace ensure_space(this);
1269 EMIT(0x33); 1302 EMIT(0x33);
(...skipping 1710 matching lines...) Expand 10 before | Expand all | Expand 10 after
2980 fflush(coverage_log); 3013 fflush(coverage_log);
2981 } 3014 }
2982 } 3015 }
2983 3016
2984 #endif 3017 #endif
2985 3018
2986 } // namespace internal 3019 } // namespace internal
2987 } // namespace v8 3020 } // namespace v8
2988 3021
2989 #endif // V8_TARGET_ARCH_IA32 3022 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/assembler-ia32.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698