On 06/10/11 16:01, Andrew Stubbs wrote:
  (define_special_predicate "shift_operator"
    (and (ior (ior (and (match_code "mult")
                      (match_test "power_of_two_operand (XEXP (op, 1), mode)"))
                 (and (match_code "rotate")
                      (match_test "GET_CODE (XEXP (op, 1)) == CONST_INT
                                &&  ((unsigned HOST_WIDE_INT) INTVAL (XEXP (op, 
1)))<  32")))
-           (match_code "ashift,ashiftrt,lshiftrt,rotatert"))
+           (and (match_code "ashift,ashiftrt,lshiftrt,rotatert")
+                (ior (match_test "GET_CODE (XEXP (op, 1)) == CONST_INT
+                               &&  ((unsigned HOST_WIDE_INT) INTVAL (XEXP (op, 
1)))<  32")
+                     (match_test "REG_P (XEXP (op, 1))"))))
         (match_test "mode == GET_MODE (op)")))

Oh, I forgot to say, I don't understand why the "rotate" operator is special cased?

If I understand it correctly, the effect of the (existing) rotate is both to check the constant range, AND to disallow registers as the shift amount. This difference has no effect on Thumb, but might cause ARM mode some troubles?

Is this likely to be deliberate, or an oversight? I can't see any reason in the ARM ARM why this should be the case.

Andrew

Reply via email to