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

Unified Diff: syzygy/assm/assembler_base_impl.h

Issue 2868683002: adds 'mov reg32, fs:[imm]' and 'inc byte ptr [reg32]' to the assembler (Closed)
Patch Set: fix build break, simplify the encoding and test it with all gprs Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « syzygy/assm/assembler_base.h ('k') | syzygy/assm/assembler_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: syzygy/assm/assembler_base_impl.h
diff --git a/syzygy/assm/assembler_base_impl.h b/syzygy/assm/assembler_base_impl.h
index 8fc1004c07a3f4b28ebba743ed063acbf16e910e..3530ff63e9a2688e59cfd3c3c65daab1ae8c2a30 100644
--- a/syzygy/assm/assembler_base_impl.h
+++ b/syzygy/assm/assembler_base_impl.h
@@ -905,6 +905,22 @@ void AssemblerBase<ReferenceType>::mov_fs(const Register32& dst,
}
template <class ReferenceType>
+void AssemblerBase<ReferenceType>::mov_fs(const Register32& dst,
+ const Immediate& src) {
+ InstructionBuffer instr(this);
+ instr.EmitOpCodeByte(kFsSegmentPrefix);
+
+ if (dst.id() == kRegisterEax) {
+ // Special encoding for indirect displacement only to EAX.
+ instr.EmitOpCodeByte(0xA1);
+ } else {
+ instr.EmitOpCodeByte(0x8B);
+ instr.EmitOpCodeByte(0x1D);
+ }
+ instr.Emit32BitImmediate(src);
+}
+
+template <class ReferenceType>
void AssemblerBase<ReferenceType>::mov_fs(const Operand& dst,
const Register32& src) {
InstructionBuffer instr(this);
@@ -1164,6 +1180,13 @@ void AssemblerBase<ReferenceType>::add(const Operand& dst,
}
template <class ReferenceType>
+void AssemblerBase<ReferenceType>::inc(const Operand& dst) {
+ InstructionBuffer instr(this);
+ instr.EmitOpCodeByte(0xFE);
+ instr.EmitOperand(0, dst);
+}
+
+template <class ReferenceType>
void AssemblerBase<ReferenceType>::sub(const Register8& dst,
const Register8& src) {
InstructionBuffer instr(this);
« no previous file with comments | « syzygy/assm/assembler_base.h ('k') | syzygy/assm/assembler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698