- {
- bool covered = true;
- for(unsigned j=0; (covered && j<a->target.chain_len && j<target.chain_len); ++j)
- {
- Assignment::Target::ChainType type1 = static_cast<Assignment::Target::ChainType>(a->target.chain[j]&0xC0);
- Assignment::Target::ChainType type2 = static_cast<Assignment::Target::ChainType>(target.chain[j]&0xC0);
- unsigned index1 = a->target.chain[j]&0x3F;
- unsigned index2 = target.chain[j]&0x3F;
- if(type1==Assignment::Target::SWIZZLE || type2==Assignment::Target::SWIZZLE)
- {
- if(type1==Assignment::Target::SWIZZLE && type2==Assignment::Target::SWIZZLE)
- covered = index1&index2;
- else if(type1==Assignment::Target::ARRAY && index1<4)
- covered = index2&(1<<index1);
- else if(type2==Assignment::Target::ARRAY && index2<4)
- covered = index1&(1<<index2);
- /* If it's some other combination (shouldn't happen), leave
- covered as true */
- }
- else
- covered = (type1==type2 && (index1==index2 || index1==0x3F || index2==0x3F));
- }
-
- if(covered)