the compress and expand instructions match the apl operations of the same name. they use the opmask in a slightly different way from other avx-512 instructions. compress only saves the values marked in the mask, but saves them compacted by skipping and not reserving space for unmarked values. expand operates in the opposite way, by loading as many values as indicated in the mask and then spreading them to the selected positions.