Compute register class intersections.

Ensure that the set of register classes is closed under intersection.

Provide a RegClass::intersect() method which finds the register class
representing the intersection of two classes.

Generate a bit-mask of subclasses for each register class to be used by
the intersect() method.

Ensure that register classes are sorted topologically. This is also used
by the intersect() method.
This commit is contained in:
Jakob Stoklund Olesen
2017-01-25 13:57:43 -08:00
parent 2390e3e3f0
commit 130c4acf51
6 changed files with 200 additions and 13 deletions

View File

@@ -120,11 +120,13 @@ mod tests {
const GPR: RegClass = &RegClassData {
index: 0,
width: 1,
subclasses: 0,
mask: [0xf0000000, 0x0000000f, 0],
};
const DPR: RegClass = &RegClassData {
index: 0,
width: 2,
subclasses: 0,
mask: [0x50000000, 0x0000000a, 0],
};