fix weight calculation, improve assembly output efficiency, improve logging
This commit is contained in:
@@ -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
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user