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

Unified Diff: src/IceAssemblerX86BaseImpl.h

Issue 1260093003: Introduce the ability to insert IACA (Intel Architecture Code Analyzer) marks to (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years, 4 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 | « src/IceAssemblerX86Base.h ('k') | src/IceClFlags.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceAssemblerX86BaseImpl.h
diff --git a/src/IceAssemblerX86BaseImpl.h b/src/IceAssemblerX86BaseImpl.h
index 5b853fdb2cc7cfa9c9fb358541df3ee080e9e0ac..191876c1b5f992b12343c699daeb5b683ad15f2f 100644
--- a/src/IceAssemblerX86BaseImpl.h
+++ b/src/IceAssemblerX86BaseImpl.h
@@ -3106,6 +3106,43 @@ void AssemblerX86Base<Machine>::xchg(Type Ty,
emitOperand(gprEncoding(reg), addr);
}
+template <class Machine> void AssemblerX86Base<Machine>::iaca_start() {
+ AssemblerBuffer::EnsureCapacity ensured(&Buffer);
+ emitUint8(0x0F);
+ emitUint8(0x0B);
+
+ // mov $111, ebx
+ constexpr typename Traits::GPRRegister dst =
+ Traits::GPRRegister::Encoded_Reg_ebx;
+ constexpr Type Ty = IceType_i32;
+ emitRexB(Ty, dst);
+ emitUint8(0xB8 + gprEncoding(dst));
+ emitImmediate(Ty, Immediate(111));
+
+ emitUint8(0x64);
+ emitUint8(0x67);
+ emitUint8(0x90);
+}
+
+template <class Machine> void AssemblerX86Base<Machine>::iaca_end() {
+ AssemblerBuffer::EnsureCapacity ensured(&Buffer);
+
+ // mov $222, ebx
+ constexpr typename Traits::GPRRegister dst =
+ Traits::GPRRegister::Encoded_Reg_ebx;
+ constexpr Type Ty = IceType_i32;
+ emitRexB(Ty, dst);
+ emitUint8(0xB8 + gprEncoding(dst));
+ emitImmediate(Ty, Immediate(222));
+
+ emitUint8(0x64);
+ emitUint8(0x67);
+ emitUint8(0x90);
+
+ emitUint8(0x0F);
+ emitUint8(0x0B);
+}
+
template <class Machine>
void AssemblerX86Base<Machine>::emitSegmentOverride(uint8_t prefix) {
AssemblerBuffer::EnsureCapacity ensured(&Buffer);
« no previous file with comments | « src/IceAssemblerX86Base.h ('k') | src/IceClFlags.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698