diff options
author | Walter Lee <walt@tilera.com> | 2013-03-25 23:59:38 +0000 |
---|---|---|
committer | Walter Lee <walt@gcc.gnu.org> | 2013-03-25 23:59:38 +0000 |
commit | 5b2a3c829cf6285411876eb72069a224ff79151d (patch) | |
tree | 17fc992445ce76d6934c83b36a2af3c8dcac3e69 | |
parent | 192ea533bec3909472c092822e1ca4b379dd6b2e (diff) | |
download | gcc-5b2a3c829cf6285411876eb72069a224ff79151d.zip gcc-5b2a3c829cf6285411876eb72069a224ff79151d.tar.gz gcc-5b2a3c829cf6285411876eb72069a224ff79151d.tar.bz2 |
tilegx.c (expand_set_cint64_one_inst): Inline tests for constraint J, K, N, P.
* config/tilegx/tilegx.c (expand_set_cint64_one_inst): Inline
tests for constraint J, K, N, P.
From-SVN: r197074
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/tilegx/tilegx.c | 16 |
2 files changed, 14 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d163b48..fd59b8e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 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): Use indirect/pcrel encoding. * config/tilepro/tilepro.c (tilepro_asm_preferred_eh_data_format): diff --git a/gcc/config/tilegx/tilegx.c b/gcc/config/tilegx/tilegx.c index c6bdbe6..d413621 100644 --- a/gcc/config/tilegx/tilegx.c +++ b/gcc/config/tilegx/tilegx.c @@ -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; } } |