GCC Wikia
登録
Advertisement

このページを編集する際は,編集に関する方針に従ってください.[]

概要[]

引数[]

実装[]

2125 /* Given a tree comparison code, return the code that is the logical inverse
2126    of the given code.  It is not safe to do this for floating-point
2127    comparisons, except for NE_EXPR and EQ_EXPR, so we receive a machine mode
2128    as well: if reversing the comparison is unsafe, return ERROR_MARK.  */
2129 
2130 enum tree_code
2131 invert_tree_comparison (enum tree_code code, bool honor_nans)
2132 {
2133   if (honor_nans && flag_trapping_math)
2134     return ERROR_MARK;
2135 
2136   switch (code)
2137     {
2138     case EQ_EXPR:
2139       return NE_EXPR;
2140     case NE_EXPR:
2141       return EQ_EXPR;
2142     case GT_EXPR:
2143       return honor_nans ? UNLE_EXPR : LE_EXPR;
2144     case GE_EXPR:
2145       return honor_nans ? UNLT_EXPR : LT_EXPR;
2146     case LT_EXPR:
2147       return honor_nans ? UNGE_EXPR : GE_EXPR;
2148     case LE_EXPR:
2149       return honor_nans ? UNGT_EXPR : GT_EXPR;
2150     case LTGT_EXPR:
2151       return UNEQ_EXPR;
2152     case UNEQ_EXPR:
2153       return LTGT_EXPR;
2154     case UNGT_EXPR:
2155       return LE_EXPR;
2156     case UNGE_EXPR:
2157       return LT_EXPR;
2158     case UNLT_EXPR:
2159       return GE_EXPR;
2160     case UNLE_EXPR:
2161       return GT_EXPR;
2162     case ORDERED_EXPR:
2163       return UNORDERED_EXPR;
2164     case UNORDERED_EXPR:
2165       return ORDERED_EXPR;
2166     default:
2167       gcc_unreachable ();
2168     }
2169 }



リンク元

Advertisement