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

Side by Side Diff: src/IceAssemblerX8632.cpp

Issue 1182603004: Subzero: Transform suitable Load/Arith/Store sequences into RMW ops. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Code review changes Created 5 years, 6 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/IceAssemblerX8632.h ('k') | src/IceCfg.cpp » ('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/IceAssemblerX8632.cpp - Assembler for x86-32 ----------===// 1 //===- subzero/src/IceAssemblerX8632.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 1741 matching lines...) Expand 10 before | Expand all | Expand 10 after
1752 AssemblerBuffer::EnsureCapacity ensured(&Buffer); 1752 AssemblerBuffer::EnsureCapacity ensured(&Buffer);
1753 if (isByteSizedArithType(Ty)) { 1753 if (isByteSizedArithType(Ty)) {
1754 emitComplexI8(0, Operand(reg), imm); 1754 emitComplexI8(0, Operand(reg), imm);
1755 return; 1755 return;
1756 } 1756 }
1757 if (Ty == IceType_i16) 1757 if (Ty == IceType_i16)
1758 emitOperandSizeOverride(); 1758 emitOperandSizeOverride();
1759 emitComplex(Ty, 0, Operand(reg), imm); 1759 emitComplex(Ty, 0, Operand(reg), imm);
1760 } 1760 }
1761 1761
1762 void AssemblerX8632::add(Type Ty, const Address &address, GPRRegister reg) {
1763 AssemblerBuffer::EnsureCapacity ensured(&Buffer);
1764 if (Ty == IceType_i16)
1765 emitOperandSizeOverride();
1766 if (isByteSizedArithType(Ty))
1767 emitUint8(0x00);
1768 else
1769 emitUint8(0x01);
1770 emitOperand(reg, address);
1771 }
1772
1773 void AssemblerX8632::add(Type Ty, const Address &address,
1774 const Immediate &imm) {
1775 AssemblerBuffer::EnsureCapacity ensured(&Buffer);
1776 if (isByteSizedArithType(Ty)) {
1777 emitComplexI8(0, address, imm);
1778 return;
1779 }
1780 if (Ty == IceType_i16)
1781 emitOperandSizeOverride();
1782 emitComplex(Ty, 0, address, imm);
1783 }
1784
1762 void AssemblerX8632::adc(Type Ty, GPRRegister dst, GPRRegister src) { 1785 void AssemblerX8632::adc(Type Ty, GPRRegister dst, GPRRegister src) {
1763 AssemblerBuffer::EnsureCapacity ensured(&Buffer); 1786 AssemblerBuffer::EnsureCapacity ensured(&Buffer);
1764 if (Ty == IceType_i16) 1787 if (Ty == IceType_i16)
1765 emitOperandSizeOverride(); 1788 emitOperandSizeOverride();
1766 if (isByteSizedArithType(Ty)) 1789 if (isByteSizedArithType(Ty))
1767 emitUint8(0x12); 1790 emitUint8(0x12);
1768 else 1791 else
1769 emitUint8(0x13); 1792 emitUint8(0x13);
1770 emitRegisterOperand(dst, src); 1793 emitRegisterOperand(dst, src);
1771 } 1794 }
(...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after
2600 assert(shifter == RegX8632::Encoded_Reg_ecx); 2623 assert(shifter == RegX8632::Encoded_Reg_ecx);
2601 (void)shifter; 2624 (void)shifter;
2602 if (Ty == IceType_i16) 2625 if (Ty == IceType_i16)
2603 emitOperandSizeOverride(); 2626 emitOperandSizeOverride();
2604 emitUint8(isByteSizedArithType(Ty) ? 0xD2 : 0xD3); 2627 emitUint8(isByteSizedArithType(Ty) ? 0xD2 : 0xD3);
2605 emitOperand(rm, operand); 2628 emitOperand(rm, operand);
2606 } 2629 }
2607 2630
2608 } // end of namespace X8632 2631 } // end of namespace X8632
2609 } // end of namespace Ice 2632 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceAssemblerX8632.h ('k') | src/IceCfg.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698