| 1 |
// { dg-do compile } |
| 2 |
|
| 3 |
struct HARD_REG_SET { |
| 4 |
HARD_REG_SET operator~() const { |
| 5 |
HARD_REG_SET res; |
| 6 |
for (unsigned int i = 0; i < (sizeof(elts) / sizeof((elts)[0])); ++i) |
| 7 |
res.elts[i] = ~elts[i]; |
| 8 |
return res; |
| 9 |
} |
| 10 |
HARD_REG_SET operator&(const HARD_REG_SET &other) const { |
| 11 |
HARD_REG_SET res; |
| 12 |
for (unsigned int i = 0; i < (sizeof(elts) / sizeof((elts)[0])); ++i) |
| 13 |
res.elts[i] = elts[i] & other.elts[i]; |
| 14 |
return res; |
| 15 |
} |
| 16 |
unsigned long elts[4]; |
| 17 |
}; |
| 18 |
typedef const HARD_REG_SET &const_hard_reg_set; |
| 19 |
inline bool hard_reg_set_subset_p(const_hard_reg_set x, const_hard_reg_set y) { |
| 20 |
unsigned long bad = 0; |
| 21 |
for (unsigned int i = 0; i < (sizeof(x.elts) / sizeof((x.elts)[0])); ++i) |
| 22 |
bad |= (x.elts[i] & ~y.elts[i]); |
| 23 |
return bad == 0; |
| 24 |
} |
| 25 |
inline bool hard_reg_set_empty_p(const_hard_reg_set x) { |
| 26 |
unsigned long bad = 0; |
| 27 |
for (unsigned int i = 0; i < (sizeof(x.elts) / sizeof((x.elts)[0])); ++i) |
| 28 |
bad |= x.elts[i]; |
| 29 |
return bad == 0; |
| 30 |
} |
| 31 |
extern HARD_REG_SET rr[2]; |
| 32 |
extern int t[2]; |
| 33 |
extern HARD_REG_SET nn; |
| 34 |
static HARD_REG_SET mm; |
| 35 |
void setup_reg_class_relations(void) { |
| 36 |
HARD_REG_SET intersection_set, union_set, temp_set2; |
| 37 |
for (int cl2 = 0; cl2 < 2; cl2++) { |
| 38 |
temp_set2 = rr[cl2] & ~nn; |
| 39 |
if (hard_reg_set_empty_p(mm) && hard_reg_set_empty_p(temp_set2)) { |
| 40 |
mm = rr[0] & nn; |
| 41 |
if (hard_reg_set_subset_p(mm, intersection_set)) |
| 42 |
if (!hard_reg_set_subset_p(mm, temp_set2) || |
| 43 |
hard_reg_set_subset_p(rr[0], rr[t[cl2]])) |
| 44 |
t[cl2] = 0; |
| 45 |
} |
| 46 |
} |
| 47 |
} |