From 02c90db2e4f46b29a8f1a50de293661fb3aacc08 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 7 Nov 2020 00:16:10 +0100 Subject: [PATCH] Display op description, if available. --- server/TracySourceView.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server/TracySourceView.cpp b/server/TracySourceView.cpp index 0c13fd13..e2864fc5 100644 --- a/server/TracySourceView.cpp +++ b/server/TracySourceView.cpp @@ -2632,6 +2632,7 @@ void SourceView::RenderAsmLine( AsmLine& line, uint32_t ipcnt, uint32_t iptotal, ImGui::SameLine( 0, ty ); } + int opdesc = 0; const AsmVar* asmVar = nullptr; if( !m_atnt && ( m_cpuArch == CpuArchX64 || m_cpuArch == CpuArchX86 ) ) { @@ -2658,6 +2659,7 @@ void SourceView::RenderAsmLine( AsmLine& line, uint32_t ipcnt, uint32_t iptotal, if( oit != uarch->ops + uarch->numOps && (*oit)->id == opid ) { const auto& op = *oit; + opdesc = op->descId; std::vector> res; res.reserve( op->numVariants ); for( int i=0; inumVariants; i++ ) @@ -2769,6 +2771,11 @@ void SourceView::RenderAsmLine( AsmLine& line, uint32_t ipcnt, uint32_t iptotal, const auto& var = *asmVar; if( m_font ) ImGui::PopFont(); ImGui::BeginTooltip(); + if( opdesc != 0 ) + { + ImGui::TextUnformatted( OpDescList[opdesc] ); + ImGui::Separator(); + } TextFocused( "Throughput:", RealToString( var.tp ) ); ImGui::SameLine(); TextDisabledUnformatted( "(cycles per instruction, lower is better)" );