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

Side by Side Diff: src/IceAssemblerARM32.cpp

Issue 1538443003: Add mls instruction to the ARM integrated assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Update DART sources. Created 5 years 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
OLDNEW
1 //===- subzero/src/IceAssemblerARM32.cpp - Assembler for ARM32 --*- C++ -*-===// 1 //===- subzero/src/IceAssemblerARM32.cpp - Assembler for ARM32 --*- C++ -*-===//
2 // 2 //
3 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 3 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
4 // for details. All rights reserved. Use of this source code is governed by a 4 // for details. All rights reserved. Use of this source code is governed by a
5 // BSD-style license that can be found in the LICENSE file. 5 // BSD-style license that can be found in the LICENSE file.
6 // 6 //
7 // Modified by the Subzero authors. 7 // Modified by the Subzero authors.
8 // 8 //
9 //===----------------------------------------------------------------------===// 9 //===----------------------------------------------------------------------===//
10 // 10 //
(...skipping 1735 matching lines...) Expand 10 before | Expand all | Expand 10 after
1746 constexpr const char *MlaName = "mla"; 1746 constexpr const char *MlaName = "mla";
1747 IValueT Rd = encodeRegister(OpRd, "Rd", MlaName); 1747 IValueT Rd = encodeRegister(OpRd, "Rd", MlaName);
1748 IValueT Rn = encodeRegister(OpRn, "Rn", MlaName); 1748 IValueT Rn = encodeRegister(OpRn, "Rn", MlaName);
1749 IValueT Rm = encodeRegister(OpRm, "Rm", MlaName); 1749 IValueT Rm = encodeRegister(OpRm, "Rm", MlaName);
1750 IValueT Ra = encodeRegister(OpRa, "Ra", MlaName); 1750 IValueT Ra = encodeRegister(OpRa, "Ra", MlaName);
1751 verifyRegNotPc(Rd, "Rd", MlaName); 1751 verifyRegNotPc(Rd, "Rd", MlaName);
1752 verifyRegNotPc(Rn, "Rn", MlaName); 1752 verifyRegNotPc(Rn, "Rn", MlaName);
1753 verifyRegNotPc(Rm, "Rm", MlaName); 1753 verifyRegNotPc(Rm, "Rm", MlaName);
1754 verifyRegNotPc(Ra, "Ra", MlaName); 1754 verifyRegNotPc(Ra, "Ra", MlaName);
1755 constexpr IValueT MlaOpcode = B21; 1755 constexpr IValueT MlaOpcode = B21;
1756 constexpr bool SetFlags = false; 1756 constexpr bool SetFlags = true;
1757 // Assembler registers rd, rn, rm, ra are encoded as rn, rm, rs, rd. 1757 // Assembler registers rd, rn, rm, ra are encoded as rn, rm, rs, rd.
1758 emitMulOp(Cond, MlaOpcode, Ra, Rd, Rn, Rm, SetFlags, MlaName); 1758 emitMulOp(Cond, MlaOpcode, Ra, Rd, Rn, Rm, !SetFlags, MlaName);
1759 }
1760
1761 void AssemblerARM32::mls(const Operand *OpRd, const Operand *OpRn,
1762 const Operand *OpRm, const Operand *OpRa,
1763 CondARM32::Cond Cond) {
1764 constexpr const char *MlsName = "mls";
1765 IValueT Rd = encodeRegister(OpRd, "Rd", MlsName);
1766 IValueT Rn = encodeRegister(OpRn, "Rn", MlsName);
1767 IValueT Rm = encodeRegister(OpRm, "Rm", MlsName);
1768 IValueT Ra = encodeRegister(OpRa, "Ra", MlsName);
1769 verifyRegNotPc(Rd, "Rd", MlsName);
1770 verifyRegNotPc(Rn, "Rn", MlsName);
1771 verifyRegNotPc(Rm, "Rm", MlsName);
1772 verifyRegNotPc(Ra, "Ra", MlsName);
1773 constexpr IValueT MlsOpcode = B22 | B21;
1774 constexpr bool SetFlags = true;
1775 // Assembler registers rd, rn, rm, ra are encoded as rn, rm, rs, rd.
1776 emitMulOp(Cond, MlsOpcode, Ra, Rd, Rn, Rm, !SetFlags, MlsName);
1759 } 1777 }
1760 1778
1761 void AssemblerARM32::mul(const Operand *OpRd, const Operand *OpRn, 1779 void AssemblerARM32::mul(const Operand *OpRd, const Operand *OpRn,
1762 const Operand *OpSrc1, bool SetFlags, 1780 const Operand *OpSrc1, bool SetFlags,
1763 CondARM32::Cond Cond) { 1781 CondARM32::Cond Cond) {
1764 // MUL - ARM section A8.8.114, encoding A1. 1782 // MUL - ARM section A8.8.114, encoding A1.
1765 // mul{s}<c> <Rd>, <Rn>, <Rm> 1783 // mul{s}<c> <Rd>, <Rn>, <Rm>
1766 // 1784 //
1767 // cccc0000000sdddd0000mmmm1001nnnn where cccc=Cond, dddd=Rd, nnnn=Rn, 1785 // cccc0000000sdddd0000mmmm1001nnnn where cccc=Cond, dddd=Rd, nnnn=Rn,
1768 // mmmm=Rm, and s=SetFlags. 1786 // mmmm=Rm, and s=SetFlags.
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
1956 1974
1957 void AssemblerARM32::uxt(const Operand *OpRd, const Operand *OpSrc0, 1975 void AssemblerARM32::uxt(const Operand *OpRd, const Operand *OpSrc0,
1958 CondARM32::Cond Cond) { 1976 CondARM32::Cond Cond) {
1959 constexpr const char *UxtName = "uxt"; 1977 constexpr const char *UxtName = "uxt";
1960 constexpr IValueT UxtOpcode = B26 | B25 | B23 | B22 | B21; 1978 constexpr IValueT UxtOpcode = B26 | B25 | B23 | B22 | B21;
1961 emitSignExtend(Cond, UxtOpcode, OpRd, OpSrc0, UxtName); 1979 emitSignExtend(Cond, UxtOpcode, OpRd, OpSrc0, UxtName);
1962 } 1980 }
1963 1981
1964 } // end of namespace ARM32 1982 } // end of namespace ARM32
1965 } // end of namespace Ice 1983 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceAssemblerARM32.h ('k') | src/IceInstARM32.cpp » ('j') | tests_lit/assembler/arm32/mls.ll » ('J')

Powered by Google App Engine
This is Rietveld 408576698