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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceAssemblerARM32.h ('k') | src/IceInstARM32.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceAssemblerARM32.cpp
diff --git a/src/IceAssemblerARM32.cpp b/src/IceAssemblerARM32.cpp
index a4d6253d417f74ab6d1732834b5e7498c7c77619..94b42b980ba3a9034240755544cb5e438276540f 100644
--- a/src/IceAssemblerARM32.cpp
+++ b/src/IceAssemblerARM32.cpp
@@ -1088,6 +1088,30 @@ void AssemblerARM32::bx(RegARM32::GPRRegister Rm, CondARM32::Cond Cond) {
emitInst(Encoding);
}
+void AssemblerARM32::clz(const Operand *OpRd, const Operand *OpSrc,
+ CondARM32::Cond Cond) {
+ // CLZ - ARM section A8.8.33, encoding A1:
+ // clz<c> <Rd> <Rm>
+ //
+ // cccc000101101111dddd11110001mmmm where cccc=Cond, dddd=Rd, and mmmm=Rm.
+ constexpr const char *ClzName = "clz";
+ constexpr const char *RdName = "Rd";
+ constexpr const char *RmName = "Rm";
+ IValueT Rd = encodeRegister(OpRd, RdName, ClzName);
+ verifyRegDefined(Rd, RdName, ClzName);
+ verifyRegNotPc(Rd, RdName, ClzName);
+ IValueT Rm = encodeRegister(OpSrc, RmName, ClzName);
+ verifyRegDefined(Rm, RmName, ClzName);
+ verifyRegNotPc(Rm, RmName, ClzName);
+ verifyCondDefined(Cond, ClzName);
+ AssemblerBuffer::EnsureCapacity ensured(&Buffer);
+ constexpr IValueT PredefinedBits =
+ B24 | B22 | B21 | (0xF << 16) | (0xf << 8) | B4;
+ const IValueT Encoding = PredefinedBits | (Cond << kConditionShift) |
+ (Rd << kRdShift) | (Rm << kRmShift);
+ emitInst(Encoding);
+}
+
void AssemblerARM32::cmn(const Operand *OpRn, const Operand *OpSrc1,
CondARM32::Cond Cond) {
// CMN (immediate) - ARM section A8.8.34, encoding A1:
« 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