tilegx.c (expand_set_cint64_one_inst): Inline tests for constraint J, K, N, P.
authorWalter Lee <walt@tilera.com>
Mon, 25 Mar 2013 23:59:38 +0000 (23:59 +0000)
committerWalter Lee <walt@gcc.gnu.org>
Mon, 25 Mar 2013 23:59:38 +0000 (23:59 +0000)
       * config/tilegx/tilegx.c (expand_set_cint64_one_inst): Inline
       tests for constraint J, K, N, P.

From-SVN: r197074

gcc/ChangeLog
gcc/config/tilegx/tilegx.c

index d163b48af582f4dd30eea599b1cced319f3147c3..fd59b8ebf9c8de4f26531db21c01524f8016ef5b 100644 (file)
@@ -1,3 +1,8 @@
+2013-03-25  Walter Lee  <walt@tilera.com>
+
+       * config/tilegx/tilegx.c (expand_set_cint64_one_inst): Inline
+       tests for constraint J, K, N, P.
+
 2013-03-25  Walter Lee  <walt@tilera.com>
 
        * config/tilegx/tilegx.c (tilegx_asm_preferred_eh_data_format):
index c6bdbe6028469a882e18b5481c6e55f0e473d9d7..d4136214327f911ebe7a4a36a4de966055fe9479 100644 (file)
@@ -1429,14 +1429,16 @@ expand_set_cint64_one_inst (rtx dest_reg,
     }
   else if (!three_wide_only)
     {
-      rtx imm_op = GEN_INT (val);
-
-      if (satisfies_constraint_J (imm_op)
-         || satisfies_constraint_K (imm_op)
-         || satisfies_constraint_N (imm_op)
-         || satisfies_constraint_P (imm_op))
+      /* Test for the following constraints: J, K, N, P.  We avoid
+        generating an rtx and using existing predicates because we
+        can be testing and rejecting a lot of constants, and GEN_INT
+        is O(N).  */
+      if ((val >= -32768 && val <= 65535)
+         || ((val == (val & 0xFF) * 0x0101010101010101LL))
+         || (val == ((trunc_int_for_mode (val, QImode) & 0xFFFF)
+                     * 0x0001000100010001LL)))
        {
-         emit_move_insn (dest_reg, imm_op);
+         emit_move_insn (dest_reg, GEN_INT (val));
          return true;
        }
     }