Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/wolfpld/tracy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
authorBartosz Taudul <wolf.pld@gmail.com>2020-11-07 01:56:26 +0300
committerBartosz Taudul <wolf.pld@gmail.com>2020-11-07 01:56:26 +0300
commitda036bf32210411871c36cffe1c5819f87001278 (patch)
treebede1face7140ce00bcbd1225ff7232be5a57628 /extra
parentc9352ce2281411f2807950dcae377ed9243f731c (diff)
Save asm op description.
Diffstat (limited to 'extra')
-rw-r--r--extra/uarch/TracyMicroArchitecture.hpp1
-rw-r--r--extra/uarch/uarch.cpp14
2 files changed, 14 insertions, 1 deletions
diff --git a/extra/uarch/TracyMicroArchitecture.hpp b/extra/uarch/TracyMicroArchitecture.hpp
index 19a879e8..e48d14fa 100644
--- a/extra/uarch/TracyMicroArchitecture.hpp
+++ b/extra/uarch/TracyMicroArchitecture.hpp
@@ -22,6 +22,7 @@ struct AsmVar
struct AsmOp
{
int id;
+ int descId;
int numVariants;
const AsmVar*const* variant;
};
diff --git a/extra/uarch/uarch.cpp b/extra/uarch/uarch.cpp
index 504e9b93..44a8b3df 100644
--- a/extra/uarch/uarch.cpp
+++ b/extra/uarch/uarch.cpp
@@ -53,6 +53,7 @@ struct Variant
struct Op
{
std::vector<Variant> var;
+ int desc;
};
struct UArch
@@ -81,6 +82,7 @@ int main()
auto root = doc.child( "root" );
Dictionary ops;
+ Dictionary opsdesc;
Dictionary uarchs;
Dictionary ports;
Dictionary isas;
@@ -94,6 +96,7 @@ int main()
{
assert( strcmp( op.name(), "instruction" ) == 0 );
auto opstr = op.attribute( "asm" ).value();
+ auto opdesc = op.attribute( "summary" ).value();
bool magic = false;
if( opstr[0] == '{' )
{
@@ -125,6 +128,7 @@ int main()
}
}
const auto opidx = ops.Get( opstr );
+ const auto opdescidx = opsdesc.Get( opdesc );
int isaSet = isas.Get( op.attribute( "isa-set" ).value() );
@@ -151,6 +155,7 @@ int main()
if( uav.size() <= uaidx ) uav.emplace_back( UArch {} );
auto& uai = uav[uaidx];
auto& opi = uai.ops[opidx];
+ opi.desc = opdescidx;
float tp = -1;
if( measurement.attribute( "TP" ) ) tp = atof( measurement.attribute( "TP" ).value() );
@@ -228,6 +233,13 @@ int main()
}
printf( "};\n\n" );
+ printf( "const char* OpDescList[]={\n" );
+ for( auto& v : opsdesc.strlist )
+ {
+ printf( "\"%s\",\n", v.c_str() );
+ }
+ printf( "};\n\n" );
+
printf( "#define V static constexpr AsmVar\n" );
printf( "#define A static constexpr AsmVar const*\n\n" );
@@ -273,7 +285,7 @@ int main()
for( auto it = ua.ops.begin(); it != ua.ops.end(); ++it )
{
auto& op = *it;
- printf( "O x%x_%x={%i,%i,y%x_%x};\n", uaidx, op.first, op.first, (int)op.second.var.size(), uaidx, op.first );
+ printf( "O x%x_%x={%i,%i,%i,y%x_%x};\n", uaidx, op.first, op.first, op.second.desc, (int)op.second.var.size(), uaidx, op.first );
opsort.emplace_back( it );
}
std::sort( opsort.begin(), opsort.end(), []( const auto& l, const auto& r ) { return l->first < r->first; } );