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

Unified Diff: src/IceAssemblerARM32.cpp

Issue 1530233004: add RBIT instruction to the ARM integrated assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Update DART source. 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
Index: src/IceAssemblerARM32.cpp
diff --git a/src/IceAssemblerARM32.cpp b/src/IceAssemblerARM32.cpp
index cddc6c97909c0aa43f5a3b19a5f4ae96e033dbaa..6c9b1bccb02f8d9c7f45ae3ad28a4e00975d3ea4 100644
--- a/src/IceAssemblerARM32.cpp
+++ b/src/IceAssemblerARM32.cpp
@@ -1779,21 +1779,39 @@ void AssemblerARM32::mul(const Operand *OpRd, const Operand *OpRn,
MulName);
}
-void AssemblerARM32::rev(const Operand *OpRd, const Operand *OpSrc,
+void AssemblerARM32::emitRdRm(CondARM32::Cond Cond, IValueT Opcode,
+ const Operand *OpRd, const Operand *OpRm,
+ const char *InstName) {
+ IValueT Rd = encodeRegister(OpRd, "Rd", InstName);
+ IValueT Rm = encodeRegister(OpRm, "Rm", InstName);
+ AssemblerBuffer::EnsureCapacity ensured(&Buffer);
+ IValueT Encoding =
+ (Cond << kConditionShift) | Opcode | (Rd << kRdShift) | (Rm << kRmShift);
+ emitInst(Encoding);
+}
+
+void AssemblerARM32::rbit(const Operand *OpRd, const Operand *OpRm,
+ CondARM32::Cond Cond) {
+ // RBIT - ARM section A8.8.144, encoding A1:
+ // rbit<c> <Rd>, <Rm>
+ //
+ // cccc011011111111dddd11110011mmmm where cccc=Cond, dddd=Rn, and mmmm=Rm.
+ constexpr const char *RbitName = "rev";
+ constexpr IValueT RbitOpcode = B26 | B25 | B23 | B22 | B21 | B20 | B19 | B18 |
+ B17 | B16 | B11 | B10 | B9 | B8 | B5 | B4;
+ emitRdRm(Cond, RbitOpcode, OpRd, OpRm, RbitName);
+}
+
+void AssemblerARM32::rev(const Operand *OpRd, const Operand *OpRm,
CondARM32::Cond Cond) {
// REV - ARM section A8.8.145, encoding A1:
- // rev <Rd>, <Rm>
+ // rev<c> <Rd>, <Rm>
//
// cccc011010111111dddd11110011mmmm where cccc=Cond, dddd=Rn, and mmmm=Rm.
constexpr const char *RevName = "rev";
- IValueT Rd = encodeRegister(OpRd, "Rd", RevName);
- IValueT Rm = encodeRegister(OpSrc, "Rm", RevName);
- AssemblerBuffer::EnsureCapacity ensured(&Buffer);
- constexpr IValueT Opcode = B26 | B25 | B23 | B21 | B20 | B19 | B18 | B17 |
- B16 | B11 | B10 | B9 | B8 | B5 | B4;
- IValueT Encoding =
- (Cond << kConditionShift) | Opcode | (Rd << kRdShift) | (Rm << kRmShift);
- emitInst(Encoding);
+ constexpr IValueT RevOpcode = B26 | B25 | B23 | B21 | B20 | B19 | B18 | B17 |
+ B16 | B11 | B10 | B9 | B8 | B5 | B4;
+ emitRdRm(Cond, RevOpcode, OpRd, OpRm, RevName);
}
void AssemblerARM32::rsb(const Operand *OpRd, const Operand *OpRn,
« no previous file with comments | « src/IceAssemblerARM32.h ('k') | src/IceInstARM32.cpp » ('j') | tests_lit/assembler/arm32/rbit.ll » ('J')

Powered by Google App Engine
This is Rietveld 408576698