On Wed, May 31, 2017 at 12:19 PM, Richard Biener <rguent...@suse.de> wrote:
> On Mon, 29 May 2017, Yuri Gribov wrote:
>
>> This no longer fixes the PR but still works in some cases as
>> demonstrated by the test. So I decided to keep it.
>
> As Richard noticed you don't need widest_ints but can use wide_ints.
> Please use == 0 instead of ! on wide-ints as well.
>
> +(for cmp (le gt)
> + (simplify
> ..
> +      (switch
> +       (if (cmp == LE_EXPR)
> +       (eq:type (bit_and @1 { wide_int_to_tree (ty, hi_bits); }) {
> build_zero_cst (ty); }))
> +       (if (cmp == GT_EXPR)
> +       (ne:type (bit_and @1 { wide_int_to_tree (ty, hi_bits); }) {
> build_zero_cst (ty); })))))))))
>
> long lines plus you can simplify this with using
>
>  (for cmp (le gt)
>       eqcmp (eq ne)
>  ...
>
>      (eqcmp (bit_and @1 { wide_int_to_tree (ty, hi_bits); })
> {build_zero_cst (ty); }))))
>
> no need to spell out :type on the result as well.

Hi Richard,

I fixed the issues (attached), rebased and retested on x64. Ok to commit?

-Yury

Attachment: 0003-Optimize-some-masked-comparisons-to-efficient-bittes.patch
Description: Binary data

Reply via email to