diff options
Diffstat (limited to 'gcc/optabs.c')
-rw-r--r-- | gcc/optabs.c | 121 |
1 files changed, 121 insertions, 0 deletions
diff --git a/gcc/optabs.c b/gcc/optabs.c index 0db33ca0667..94927b9b2fe 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -3399,6 +3399,7 @@ prepare_float_lib_cmp (px, py, pcomparison, pmode, punsignedp) int *punsignedp; { enum rtx_code comparison = *pcomparison; + rtx tmp; rtx x = *px = protect_from_queue (*px, 0); rtx y = *py = protect_from_queue (*py, 0); enum machine_mode mode = GET_MODE (x); @@ -3418,18 +3419,42 @@ prepare_float_lib_cmp (px, py, pcomparison, pmode, punsignedp) case GT: libfunc = gthf2_libfunc; + if (libfunc == NULL_RTX) + { + tmp = x; x = y; y = tmp; + *pcomparison = LT; + libfunc = lthf2_libfunc; + } break; case GE: libfunc = gehf2_libfunc; + if (libfunc == NULL_RTX) + { + tmp = x; x = y; y = tmp; + *pcomparison = LE; + libfunc = lehf2_libfunc; + } break; case LT: libfunc = lthf2_libfunc; + if (libfunc == NULL_RTX) + { + tmp = x; x = y; y = tmp; + *pcomparison = GT; + libfunc = gthf2_libfunc; + } break; case LE: libfunc = lehf2_libfunc; + if (libfunc == NULL_RTX) + { + tmp = x; x = y; y = tmp; + *pcomparison = GE; + libfunc = gehf2_libfunc; + } break; case UNORDERED: @@ -3452,18 +3477,42 @@ prepare_float_lib_cmp (px, py, pcomparison, pmode, punsignedp) case GT: libfunc = gtsf2_libfunc; + if (libfunc == NULL_RTX) + { + tmp = x; x = y; y = tmp; + *pcomparison = LT; + libfunc = ltsf2_libfunc; + } break; case GE: libfunc = gesf2_libfunc; + if (libfunc == NULL_RTX) + { + tmp = x; x = y; y = tmp; + *pcomparison = LE; + libfunc = lesf2_libfunc; + } break; case LT: libfunc = ltsf2_libfunc; + if (libfunc == NULL_RTX) + { + tmp = x; x = y; y = tmp; + *pcomparison = GT; + libfunc = gtsf2_libfunc; + } break; case LE: libfunc = lesf2_libfunc; + if (libfunc == NULL_RTX) + { + tmp = x; x = y; y = tmp; + *pcomparison = GE; + libfunc = gesf2_libfunc; + } break; case UNORDERED: @@ -3486,18 +3535,42 @@ prepare_float_lib_cmp (px, py, pcomparison, pmode, punsignedp) case GT: libfunc = gtdf2_libfunc; + if (libfunc == NULL_RTX) + { + tmp = x; x = y; y = tmp; + *pcomparison = LT; + libfunc = ltdf2_libfunc; + } break; case GE: libfunc = gedf2_libfunc; + if (libfunc == NULL_RTX) + { + tmp = x; x = y; y = tmp; + *pcomparison = LE; + libfunc = ledf2_libfunc; + } break; case LT: libfunc = ltdf2_libfunc; + if (libfunc == NULL_RTX) + { + tmp = x; x = y; y = tmp; + *pcomparison = GT; + libfunc = gtdf2_libfunc; + } break; case LE: libfunc = ledf2_libfunc; + if (libfunc == NULL_RTX) + { + tmp = x; x = y; y = tmp; + *pcomparison = GE; + libfunc = gedf2_libfunc; + } break; case UNORDERED: @@ -3520,18 +3593,42 @@ prepare_float_lib_cmp (px, py, pcomparison, pmode, punsignedp) case GT: libfunc = gtxf2_libfunc; + if (libfunc == NULL_RTX) + { + tmp = x; x = y; y = tmp; + *pcomparison = LT; + libfunc = ltxf2_libfunc; + } break; case GE: libfunc = gexf2_libfunc; + if (libfunc == NULL_RTX) + { + tmp = x; x = y; y = tmp; + *pcomparison = LE; + libfunc = lexf2_libfunc; + } break; case LT: libfunc = ltxf2_libfunc; + if (libfunc == NULL_RTX) + { + tmp = x; x = y; y = tmp; + *pcomparison = GT; + libfunc = gtxf2_libfunc; + } break; case LE: libfunc = lexf2_libfunc; + if (libfunc == NULL_RTX) + { + tmp = x; x = y; y = tmp; + *pcomparison = GE; + libfunc = gexf2_libfunc; + } break; case UNORDERED: @@ -3554,18 +3651,42 @@ prepare_float_lib_cmp (px, py, pcomparison, pmode, punsignedp) case GT: libfunc = gttf2_libfunc; + if (libfunc == NULL_RTX) + { + tmp = x; x = y; y = tmp; + *pcomparison = LT; + libfunc = lttf2_libfunc; + } break; case GE: libfunc = getf2_libfunc; + if (libfunc == NULL_RTX) + { + tmp = x; x = y; y = tmp; + *pcomparison = LE; + libfunc = letf2_libfunc; + } break; case LT: libfunc = lttf2_libfunc; + if (libfunc == NULL_RTX) + { + tmp = x; x = y; y = tmp; + *pcomparison = GT; + libfunc = gttf2_libfunc; + } break; case LE: libfunc = letf2_libfunc; + if (libfunc == NULL_RTX) + { + tmp = x; x = y; y = tmp; + *pcomparison = GE; + libfunc = getf2_libfunc; + } break; case UNORDERED: |