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

Side by Side Diff: src/assembler_ia32.cpp

Issue 1125323004: Subzero: Use cmov to improve lowering for the select instruction. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Remove a rogue comment Created 5 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/assembler_ia32.h ('k') | tests_lit/assembler/x86/sandboxing.ll » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/assembler_ia32.cpp - Assembler for x86-32 -------------===// 1 //===- subzero/src/assembler_ia32.cpp - Assembler for x86-32 -------------===//
2 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 2 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
3 // for details. All rights reserved. Use of this source code is governed by a 3 // for details. All rights reserved. Use of this source code is governed by a
4 // BSD-style license that can be found in the LICENSE file. 4 // BSD-style license that can be found in the LICENSE file.
5 // 5 //
6 // Modified by the Subzero authors. 6 // Modified by the Subzero authors.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 // 9 //
10 // The Subzero Code Generator 10 // The Subzero Code Generator
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 265
266 void AssemblerX8632::lea(Type Ty, GPRRegister dst, const Address &src) { 266 void AssemblerX8632::lea(Type Ty, GPRRegister dst, const Address &src) {
267 AssemblerBuffer::EnsureCapacity ensured(&buffer_); 267 AssemblerBuffer::EnsureCapacity ensured(&buffer_);
268 assert(Ty == IceType_i16 || Ty == IceType_i32); 268 assert(Ty == IceType_i16 || Ty == IceType_i32);
269 if (Ty == IceType_i16) 269 if (Ty == IceType_i16)
270 EmitOperandSizeOverride(); 270 EmitOperandSizeOverride();
271 EmitUint8(0x8D); 271 EmitUint8(0x8D);
272 EmitOperand(dst, src); 272 EmitOperand(dst, src);
273 } 273 }
274 274
275 void AssemblerX8632::cmov(CondX86::BrCond cond, GPRRegister dst, 275 void AssemblerX8632::cmov(Type Ty, CondX86::BrCond cond, GPRRegister dst,
276 GPRRegister src) { 276 GPRRegister src) {
277 AssemblerBuffer::EnsureCapacity ensured(&buffer_); 277 AssemblerBuffer::EnsureCapacity ensured(&buffer_);
278 if (Ty == IceType_i16)
279 EmitOperandSizeOverride();
280 else
281 assert(Ty == IceType_i32);
278 EmitUint8(0x0F); 282 EmitUint8(0x0F);
279 EmitUint8(0x40 + cond); 283 EmitUint8(0x40 + cond);
280 EmitRegisterOperand(dst, src); 284 EmitRegisterOperand(dst, src);
281 } 285 }
282 286
287 void AssemblerX8632::cmov(Type Ty, CondX86::BrCond cond, GPRRegister dst,
288 const Address &src) {
289 AssemblerBuffer::EnsureCapacity ensured(&buffer_);
290 if (Ty == IceType_i16)
291 EmitOperandSizeOverride();
292 else
293 assert(Ty == IceType_i32);
294 EmitUint8(0x0F);
295 EmitUint8(0x40 + cond);
296 EmitOperand(dst, src);
297 }
298
283 void AssemblerX8632::rep_movsb() { 299 void AssemblerX8632::rep_movsb() {
284 AssemblerBuffer::EnsureCapacity ensured(&buffer_); 300 AssemblerBuffer::EnsureCapacity ensured(&buffer_);
285 EmitUint8(0xF3); 301 EmitUint8(0xF3);
286 EmitUint8(0xA4); 302 EmitUint8(0xA4);
287 } 303 }
288 304
289 void AssemblerX8632::movss(Type Ty, XmmRegister dst, const Address &src) { 305 void AssemblerX8632::movss(Type Ty, XmmRegister dst, const Address &src) {
290 AssemblerBuffer::EnsureCapacity ensured(&buffer_); 306 AssemblerBuffer::EnsureCapacity ensured(&buffer_);
291 EmitUint8(isFloat32Asserting32Or64(Ty) ? 0xF3 : 0xF2); 307 EmitUint8(isFloat32Asserting32Or64(Ty) ? 0xF3 : 0xF2);
292 EmitUint8(0x0F); 308 EmitUint8(0x0F);
(...skipping 2291 matching lines...) Expand 10 before | Expand all | Expand 10 after
2584 assert(shifter == RegX8632::Encoded_Reg_ecx); 2600 assert(shifter == RegX8632::Encoded_Reg_ecx);
2585 (void)shifter; 2601 (void)shifter;
2586 if (Ty == IceType_i16) 2602 if (Ty == IceType_i16)
2587 EmitOperandSizeOverride(); 2603 EmitOperandSizeOverride();
2588 EmitUint8(isByteSizedArithType(Ty) ? 0xD2 : 0xD3); 2604 EmitUint8(isByteSizedArithType(Ty) ? 0xD2 : 0xD3);
2589 EmitOperand(rm, operand); 2605 EmitOperand(rm, operand);
2590 } 2606 }
2591 2607
2592 } // end of namespace X8632 2608 } // end of namespace X8632
2593 } // end of namespace Ice 2609 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/assembler_ia32.h ('k') | tests_lit/assembler/x86/sandboxing.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698