- case iro_Proj: {
- ir_node *pred = get_Proj_pred(node);
-
- if (is_Cmp(pred)) {
- ir_node *left = get_Cmp_left(pred);
- ir_node *right = get_Cmp_right(pred);
- ir_mode *cmp_mode = get_irn_mode(left);
-
- if ((mode_is_int(cmp_mode) || mode_is_reference(cmp_mode)) &&
- (get_mode_size_bits(cmp_mode) < get_mode_size_bits(mode) ||
- (mode_is_signed(cmp_mode) && is_Const(right) && is_Const_null(right)))) {
- int pnc = get_Proj_proj(node);
- int need_not = 0;
- ir_node *a = NULL;
- ir_node *b = NULL;
- int bits;
- tarval *tv;
- ir_node *shift_cnt;
-
- if (pnc == pn_Cmp_Lt) {
- /* a < b -> (a - b) >> 31 */
- a = left;
- b = right;
- } else if (pnc == pn_Cmp_Le) {
- /* a <= b -> ~(a - b) >> 31 */
- a = right;
- b = left;
- need_not = 1;
- } else if (pnc == pn_Cmp_Gt) {
- /* a > b -> (b - a) >> 31 */
- a = right;
- b = left;
- } else if (pnc == pn_Cmp_Ge) {
- /* a >= b -> ~(a - b) >> 31 */
- a = left;
- b = right;
- need_not = 1;
- } else {
- goto synth_zero_one;
- }
+ case iro_Cmp: {
+ ir_node *left = get_Cmp_left(node);
+ ir_node *right = get_Cmp_right(node);
+ ir_mode *cmp_mode = get_irn_mode(left);
+
+ if ((mode_is_int(cmp_mode) || mode_is_reference(cmp_mode)) &&
+ (get_mode_size_bits(cmp_mode) < get_mode_size_bits(mode) ||
+ (mode_is_signed(cmp_mode) && is_Const(right) && is_Const_null(right)))) {
+ ir_relation relation = get_Cmp_relation(node);
+ int need_not = 0;
+ ir_node *a = NULL;
+ ir_node *b = NULL;
+ int bits;
+ ir_tarval *tv;
+ ir_node *shift_cnt;
+
+ if (relation == ir_relation_less) {
+ /* a < b -> (a - b) >> 31 */
+ a = left;
+ b = right;
+ } else if (relation == ir_relation_less_equal) {
+ /* a <= b -> ~(a - b) >> 31 */
+ a = right;
+ b = left;
+ need_not = 1;
+ } else if (relation == ir_relation_greater) {
+ /* a > b -> (b - a) >> 31 */
+ a = right;
+ b = left;
+ } else if (relation == ir_relation_greater_equal) {
+ /* a >= b -> ~(a - b) >> 31 */
+ a = left;
+ b = right;
+ need_not = 1;
+ } else {
+ goto synth_zero_one;
+ }