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

Side by Side Diff: src/assembler_ia32.cpp

Issue 1118353005: Subzero: Use a setcc sequence for better icmp lowering. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Cleanup 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 EmitUint8(0x61); 149 EmitUint8(0x61);
150 } 150 }
151 151
152 void AssemblerX8632::setcc(CondX86::BrCond condition, ByteRegister dst) { 152 void AssemblerX8632::setcc(CondX86::BrCond condition, ByteRegister dst) {
153 AssemblerBuffer::EnsureCapacity ensured(&buffer_); 153 AssemblerBuffer::EnsureCapacity ensured(&buffer_);
154 EmitUint8(0x0F); 154 EmitUint8(0x0F);
155 EmitUint8(0x90 + condition); 155 EmitUint8(0x90 + condition);
156 EmitUint8(0xC0 + dst); 156 EmitUint8(0xC0 + dst);
157 } 157 }
158 158
159 // TODO(stichnot): Upstream to Dart.
160 void AssemblerX8632::setcc(CondX86::BrCond condition, const Address &address) {
161 AssemblerBuffer::EnsureCapacity ensured(&buffer_);
162 EmitUint8(0x0F);
163 EmitUint8(0x90 + condition);
164 EmitOperand(0, address);
165 }
166
159 void AssemblerX8632::mov(Type Ty, GPRRegister dst, const Immediate &imm) { 167 void AssemblerX8632::mov(Type Ty, GPRRegister dst, const Immediate &imm) {
160 AssemblerBuffer::EnsureCapacity ensured(&buffer_); 168 AssemblerBuffer::EnsureCapacity ensured(&buffer_);
161 if (isByteSizedType(Ty)) { 169 if (isByteSizedType(Ty)) {
162 EmitUint8(0xB0 + dst); 170 EmitUint8(0xB0 + dst);
163 EmitUint8(imm.value() & 0xFF); 171 EmitUint8(imm.value() & 0xFF);
164 return; 172 return;
165 } 173 }
166 if (Ty == IceType_i16) 174 if (Ty == IceType_i16)
167 EmitOperandSizeOverride(); 175 EmitOperandSizeOverride();
168 EmitUint8(0xB8 + dst); 176 EmitUint8(0xB8 + dst);
(...skipping 2408 matching lines...) Expand 10 before | Expand all | Expand 10 after
2577 assert(shifter == RegX8632::Encoded_Reg_ecx); 2585 assert(shifter == RegX8632::Encoded_Reg_ecx);
2578 (void)shifter; 2586 (void)shifter;
2579 if (Ty == IceType_i16) 2587 if (Ty == IceType_i16)
2580 EmitOperandSizeOverride(); 2588 EmitOperandSizeOverride();
2581 EmitUint8(isByteSizedArithType(Ty) ? 0xD2 : 0xD3); 2589 EmitUint8(isByteSizedArithType(Ty) ? 0xD2 : 0xD3);
2582 EmitOperand(rm, operand); 2590 EmitOperand(rm, operand);
2583 } 2591 }
2584 2592
2585 } // end of namespace X8632 2593 } // end of namespace X8632
2586 } // end of namespace Ice 2594 } // 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