mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-22 14:44:34 +00:00
Save asm op description.
This commit is contained in:
parent
c9352ce228
commit
da036bf322
@ -22,6 +22,7 @@ struct AsmVar
|
||||
struct AsmOp
|
||||
{
|
||||
int id;
|
||||
int descId;
|
||||
int numVariants;
|
||||
const AsmVar*const* variant;
|
||||
};
|
||||
|
@ -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; } );
|
||||
|
Loading…
Reference in New Issue
Block a user