diff options
Diffstat (limited to 'rtl/gfx/gfx_sp_select.sv')
| -rw-r--r-- | rtl/gfx/gfx_sp_select.sv | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/rtl/gfx/gfx_sp_select.sv b/rtl/gfx/gfx_sp_select.sv new file mode 100644 index 0000000..46b23c9 --- /dev/null +++ b/rtl/gfx/gfx_sp_select.sv @@ -0,0 +1,25 @@ +`include "gfx/gfx_defs.sv" + +module gfx_sp_select +( + input logic clk, + + input vec4 a, + b, + input shuffler_deco deco, + input logic stall, + + output vec4 out +); + + always_ff @(posedge clk) + if (!stall) + for (integer i = 0; i < `FLOATS_PER_VEC; ++i) + if (deco.is_broadcast) + out[i] <= deco.imm; + else if (deco.select_mask[i]) + out[i] <= b[i]; + else + out[i] <= a[i]; + +endmodule |
