mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-08-22 13:57:18 +02:00
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:
+2
-8
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user