1. An apparatus comprising: a multiplexer comprising: a plurality of inputs configured to receive a first plurality of data words and a data mask, wherein the data mask comprises a plurality of mask bits, and wherein each mask bit of the plurality of mask bits corresponds to a respective data word of the first plurality of data words and each mask bit of the plurality of mask bits identifies whether the respective data word of the first plurality of data words is masked or unmasked; and a plurality of outputs configured to output a second plurality of data words and a first count of the data words of the first plurality of data words that are unmasked; wherein the multiplexer is configured to form the second plurality of data words by grouping together the data words of the first plurality of data words that are unmasked by: calculating a plurality of sums of data words that are unmasked, wherein: each sum corresponds to a respective data word of the first plurality of data words and comprises a number of data words that are unmasked of a current data word and any preceding data words; and a last sum of the plurality of sums comprises the first count of the data words of the first plurality of data words that are unmasked; and iterating through the plurality of sums while removing data words that are masked, by: removing a first data word from the first plurality of data words to form the second plurality of data words when a first sum indicates that the first data word is masked; and removing each successive data word from the first plurality of data words to form the second plurality of data words when a sum following the first sum corresponding to the successive data word is the same as an immediately preceding sum.