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

Side by Side Diff: src/IceAssemblerARM32.cpp

Issue 1521133002: Add CLZ instruction to the ARM integrated assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Remove comment in test case. 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
« no previous file with comments | « src/IceAssemblerARM32.h ('k') | src/IceInstARM32.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/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 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after
1081 constexpr const char *BxName = "bx"; 1081 constexpr const char *BxName = "bx";
1082 verifyCondDefined(Cond, BxName); 1082 verifyCondDefined(Cond, BxName);
1083 verifyRegDefined(Rm, "Rm", BxName); 1083 verifyRegDefined(Rm, "Rm", BxName);
1084 AssemblerBuffer::EnsureCapacity ensured(&Buffer); 1084 AssemblerBuffer::EnsureCapacity ensured(&Buffer);
1085 const IValueT Encoding = (encodeCondition(Cond) << kConditionShift) | B24 | 1085 const IValueT Encoding = (encodeCondition(Cond) << kConditionShift) | B24 |
1086 B21 | (0xfff << 8) | B4 | 1086 B21 | (0xfff << 8) | B4 |
1087 (encodeGPRRegister(Rm) << kRmShift); 1087 (encodeGPRRegister(Rm) << kRmShift);
1088 emitInst(Encoding); 1088 emitInst(Encoding);
1089 } 1089 }
1090 1090
1091 void AssemblerARM32::clz(const Operand *OpRd, const Operand *OpSrc,
1092 CondARM32::Cond Cond) {
1093 // CLZ - ARM section A8.8.33, encoding A1:
1094 // clz<c> <Rd> <Rm>
1095 //
1096 // cccc000101101111dddd11110001mmmm where cccc=Cond, dddd=Rd, and mmmm=Rm.
1097 constexpr const char *ClzName = "clz";
1098 constexpr const char *RdName = "Rd";
1099 constexpr const char *RmName = "Rm";
1100 IValueT Rd = encodeRegister(OpRd, RdName, ClzName);
1101 verifyRegDefined(Rd, RdName, ClzName);
1102 verifyRegNotPc(Rd, RdName, ClzName);
1103 IValueT Rm = encodeRegister(OpSrc, RmName, ClzName);
1104 verifyRegDefined(Rm, RmName, ClzName);
1105 verifyRegNotPc(Rm, RmName, ClzName);
1106 verifyCondDefined(Cond, ClzName);
1107 AssemblerBuffer::EnsureCapacity ensured(&Buffer);
1108 constexpr IValueT PredefinedBits =
1109 B24 | B22 | B21 | (0xF << 16) | (0xf << 8) | B4;
1110 const IValueT Encoding = PredefinedBits | (Cond << kConditionShift) |
1111 (Rd << kRdShift) | (Rm << kRmShift);
1112 emitInst(Encoding);
1113 }
1114
1091 void AssemblerARM32::cmn(const Operand *OpRn, const Operand *OpSrc1, 1115 void AssemblerARM32::cmn(const Operand *OpRn, const Operand *OpSrc1,
1092 CondARM32::Cond Cond) { 1116 CondARM32::Cond Cond) {
1093 // CMN (immediate) - ARM section A8.8.34, encoding A1: 1117 // CMN (immediate) - ARM section A8.8.34, encoding A1:
1094 // cmn<c> <Rn>, #<RotatedImm8> 1118 // cmn<c> <Rn>, #<RotatedImm8>
1095 // 1119 //
1096 // cccc00110111nnnn0000iiiiiiiiiiii where cccc=Cond, dddd=Rd, nnnn=Rn, 1120 // cccc00110111nnnn0000iiiiiiiiiiii where cccc=Cond, dddd=Rd, nnnn=Rn,
1097 // s=SetFlags and iiiiiiiiiiii=Src1Value defining RotatedImm8. 1121 // s=SetFlags and iiiiiiiiiiii=Src1Value defining RotatedImm8.
1098 // 1122 //
1099 // CMN (register) - ARM section A8.8.35, encodeing A1: 1123 // CMN (register) - ARM section A8.8.35, encodeing A1:
1100 // cmn<c> <Rn>, <Rm>{, <shift>} 1124 // cmn<c> <Rn>, <Rm>{, <shift>}
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after
1779 1803
1780 void AssemblerARM32::uxt(const Operand *OpRd, const Operand *OpSrc0, 1804 void AssemblerARM32::uxt(const Operand *OpRd, const Operand *OpSrc0,
1781 CondARM32::Cond Cond) { 1805 CondARM32::Cond Cond) {
1782 constexpr const char *UxtName = "uxt"; 1806 constexpr const char *UxtName = "uxt";
1783 constexpr IValueT UxtOpcode = B26 | B25 | B23 | B22 | B21; 1807 constexpr IValueT UxtOpcode = B26 | B25 | B23 | B22 | B21;
1784 emitSignExtend(Cond, UxtOpcode, OpRd, OpSrc0, UxtName); 1808 emitSignExtend(Cond, UxtOpcode, OpRd, OpSrc0, UxtName);
1785 } 1809 }
1786 1810
1787 } // end of namespace ARM32 1811 } // end of namespace ARM32
1788 } // end of namespace Ice 1812 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceAssemblerARM32.h ('k') | src/IceInstARM32.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698