Optimize handling of invert gates / Tweak vvp_vector8_t performance

The process of inverting and copying can be collapsed into a single
operation that should run a little faster. Also, inverting readily
vectorizes itself. I've also possibly reduced useless vvp_not_fun
iterations.

Also, include some minor tweaks to the vvp_vector8_t handling of
vector copies. This is more to clean up code, although it should
slightly improve performance as well.
This commit is contained in:
Stephen Williams
2010-01-11 11:42:25 -08:00
parent 85e0f8a328
commit d0b1936fb5
4 changed files with 138 additions and 59 deletions
+2 -8
View File
@@ -399,7 +399,7 @@ void vvp_fun_not::recv_vec4(vvp_net_ptr_t ptr, const vvp_vector4_t&bit,
if (ptr.port() != 0)
return;
if (input_ .eeq( bit ))
if (input_ .eq_xz( bit ))
return;
input_ = bit;
@@ -414,13 +414,7 @@ void vvp_fun_not::run_run()
vvp_net_t*ptr = net_;
net_ = 0;
vvp_vector4_t result (input_);
for (unsigned idx = 0 ; idx < result.size() ; idx += 1) {
vvp_bit4_t bitbit = ~ result.value(idx);
result.set_bit(idx, bitbit);
}
vvp_vector4_t result (input_, true /* invert */);
ptr->send_vec4(result, 0);
}