From: Eric Botcazou Date: Wed, 20 Dec 2017 09:52:15 +0000 (+0000) Subject: constraints.md (J, K, L): Use IN_RANGE macro. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=98f8b67f2202c0f81fdacf661c1fa51f2ecb80fb;p=gcc.git constraints.md (J, K, L): Use IN_RANGE macro. * config/visium/constraints.md (J, K, L): Use IN_RANGE macro. * config/visium/predicates.md (const_shift_operand): Likewise. * config/visium/visium.c (visium_legitimize_address): Fix oversight. (visium_legitimize_reload_address): Likewise. From-SVN: r255856 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bc881e5f6ca..3fac117f893 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,8 +1,14 @@ +2017-12-20 Eric Botcazou + + * config/visium/constraints.md (J, K, L): Use IN_RANGE macro. + * config/visium/predicates.md (const_shift_operand): Likewise. + * config/visium/visium.c (visium_legitimize_address): Fix oversight. + (visium_legitimize_reload_address): Likewise. + 2017-12-20 Kyrylo Tkachov PR target/82975 - * config/arm/arm.h (TEST_REGNO): Adjust comment as expected in - r255830. + * config/arm/arm.h (TEST_REGNO): Adjust comment as expected in r255830. 2017-12-20 Jakub Jelinek diff --git a/gcc/config/visium/constraints.md b/gcc/config/visium/constraints.md index 15e0bebc085..053f1ef67ad 100644 --- a/gcc/config/visium/constraints.md +++ b/gcc/config/visium/constraints.md @@ -48,17 +48,17 @@ (define_constraint "J" "Integer constant in the range 0 .. 65535 (16-bit immediate)" (and (match_code "const_int") - (match_test "ival >= 0 && ival <= 65535"))) + (match_test "IN_RANGE (ival, 0, 65535)"))) (define_constraint "K" "Integer constant in the range 1 .. 31 (5-bit immediate)" (and (match_code "const_int") - (match_test "ival >= 1 && ival <= 31"))) + (match_test "IN_RANGE (ival, 1, 31)"))) (define_constraint "L" "Integer constant in the range -65535 .. -1 (16-bit negative immediate)" (and (match_code "const_int") - (match_test "ival >= -65535 && ival <= -1"))) + (match_test "IN_RANGE (ival, -65535, -1)"))) (define_constraint "M" "Integer constant -1" diff --git a/gcc/config/visium/predicates.md b/gcc/config/visium/predicates.md index e1dd29cb8fb..ebfe4bc0b09 100644 --- a/gcc/config/visium/predicates.md +++ b/gcc/config/visium/predicates.md @@ -25,7 +25,7 @@ ;; Return true if OP is a constant in the range 1 .. 31. (define_predicate "const_shift_operand" (and (match_code "const_int") - (match_test "INTVAL (op) >= 1 && INTVAL (op) <= 31"))) + (match_test "IN_RANGE (INTVAL (op), 1, 31)"))) ;; Return true if OP is either a register or the constant 0. (define_predicate "reg_or_0_operand" diff --git a/gcc/config/visium/visium.c b/gcc/config/visium/visium.c index 58c4e572623..1e3549d721a 100644 --- a/gcc/config/visium/visium.c +++ b/gcc/config/visium/visium.c @@ -1922,7 +1922,7 @@ visium_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, int offset_base = offset & ~mask; /* Check that all of the words can be accessed. */ - if (size > 4 && 0x80 < size + offset - offset_base) + if (size > 4 && size + offset - offset_base > 0x80) offset_base = offset & ~0x3f; if (offset_base != 0 && offset_base != offset && (offset & mask1) == 0) { @@ -1968,7 +1968,7 @@ visium_legitimize_reload_address (rtx x, machine_mode mode, int opnum, int offset_base = offset & ~mask; /* Check that all of the words can be accessed. */ - if (size > 4 && 0x80 < size + offset - offset_base) + if (size > 4 && size + offset - offset_base > 0x80) offset_base = offset & ~0x3f; if (offset_base && (offset & mask1) == 0)