Lines Matching defs:Mask
28 // Mask manipulation functions.
35 static unsigned getMaskElt(unsigned Mask, unsigned Elt) {
36 return (Mask >> ((3-Elt)*4)) & 0xF;
39 static unsigned setMaskElt(unsigned Mask, unsigned Elt, unsigned NewVal) {
41 return (Mask & ~(0xF << FieldShift)) | (NewVal << FieldShift);
45 static bool isValidMask(unsigned short Mask) {
46 unsigned short UndefBits = Mask & 0x8888;
47 return (Mask & ((UndefBits >> 1)|(UndefBits>>2)|(UndefBits>>3))) == 0;
52 static bool hasUndefElements(unsigned short Mask) {
53 return (Mask & 0x8888) != 0;
58 static bool isOnlyLHSMask(unsigned short Mask) {
59 return (Mask & 0x4444) == 0;
66 static unsigned short getLHSOnlyMask(unsigned short Mask) {
67 return Mask & 0xBBBB; // Keep only LHS and Undefs.
73 static unsigned getCompressedMask(unsigned short Mask) {
74 return getMaskElt(Mask, 0)*9*9*9 + getMaskElt(Mask, 1)*9*9 +
75 getMaskElt(Mask, 2)*9 + getMaskElt(Mask, 3);