- ir_node *block, *lol, *hil, *cmp, *c, *p;
-
- mode = find_unsigned_mode(mode);
- if (! mode)
- return NULL;
- tv_lo = tarval_convert_to(tv_lo, mode);
- if (tv_lo == tarval_bad)
- return NULL;
- block = get_nodes_block(cmp_lo);
- lol = get_Cmp_left(cmp_lo);
- lol = new_r_Conv(block, lol, mode);
- hil = get_Cmp_left(cmp_hi);
- hil = new_r_Conv(block, hil, mode);
- p = new_r_Or(block, lol, hil, mode);
- c = new_Const(tv_lo);
- cmp = new_r_Cmp(block, p, c);
- p = new_r_Proj(block, cmp, mode_b, pn_Cmp_Lg);
- return p;
+ ir_node *lol, *hil, *cmp, *c, *p;
+
+ if (mode_is_reference(mode)) {
+ mode = find_unsigned_mode(mode);
+ if (! mode)
+ return NULL;
+ tv_lo = tarval_convert_to(tv_lo, mode);
+ if (tv_lo == tarval_bad)
+ return NULL;
+ }
+ if (mode_is_int(mode)) {
+ lol = get_Cmp_left(cmp_lo);
+ lol = new_r_Conv(dst_block, lol, mode);
+ hil = get_Cmp_left(cmp_hi);
+ hil = new_r_Conv(dst_block, hil, mode);
+ p = new_r_Or(dst_block, lol, hil, mode);
+ c = new_r_Const(irg, tv_lo);
+ cmp = new_r_Cmp(dst_block, p, c, ir_relation_less_greater);
+ return cmp;
+ }