fix weight calculation, improve assembly output efficiency, improve logging

This commit is contained in:
2026-11-08 15:03:23 +02:00
parent 81deb637c0
commit e8f3f76117
4 changed files with 47 additions and 12 deletions
+2 -1
View File
@@ -8,7 +8,7 @@
namespace DynamicPipeline {
enum CommandType : char
enum CommandType : uint16_t
{
ADD,
SUB,
@@ -47,6 +47,7 @@ private:
unsigned int pc {0};
unsigned int system_time;
void print_program_memory(void) const;
void print_pipeline(void) const;
bool pipeline_empty(void) const;
bool next_instruction(void) const;
+3 -3
View File
@@ -30,7 +30,7 @@ public:
NOP // not an operator
};
static int weight_op(Operator o)
[[nodiscard]] static int weight_op(Operator o)
{
switch (o)
{
@@ -408,7 +408,7 @@ public:
}
}
int weight()
int weight() const
{
int w = 0;
@@ -424,7 +424,7 @@ public:
if (o.t == Token::OPERATOR)
{
Token::weight_op(o.v.o);
w += Token::weight_op(o.v.o);
}
return w;