[ARC] Improve code gen when compiling for size

Programming / Compilers / GCC - claziss [138bc75d-0d04-0410-961f-82ee72b054a4] - 10 June 2019 08:25 EDT

When optimizing for size, try to avoid using long immediate by employing alternative instructions.

gcc/ xxxx-xx-xx Claudiu Zissulescu

- config/arc/arc-protos.h (arc_check_ior_const): Declare. (arc_split_ior): Likewise. (arc_check_mov_const): Likewise. (arc_split_mov_const): Likewise.
- config/arc/arc.c (arc_print_operand): Fix 'z' letter. (arc_rtx_costs): Replace check Crr with Cax constraint. (prepare_move_operands): Cleanup, remove unused code. (arc_split_ior): New function. (arc_check_ior_const): Likewise. (arc_split_mov_const): Likewise. (arc_check_mov_const): Likewise.
- config/arc/arc.md (movsi_insn): Restructure it, and convert it in define_insn_and_split pattern. (iorsi3): Likewise. (mulsi3_v2): Add new matching variant. (andsi3_i): Cleanup pattern. (rotrsi3_cnt1): Update pattern. (rotrsi3_cnt8): New pattern. (ashlsi2_cnt8): Likewise. (ashlsi2_cnt16): Likewise.
- config/arc/constraints.md (C0p): Update constraint. (Crr): Remove it. (C0x): New pattern. (Cax): New pattern.

testsuite/ xxxx-xx-xx Claudiu Zissulescu

- gcc.target/arc/and-cnst-size.c: New test.
- gcc.target/arc/mov-cnst-size.c: Likewise.
- gcc.target/arc/or-cnst-size.c: Likewise.
- gcc.target/arc/store-merge-1.c: Update test.
- gcc.target/arc/arc700-stld-hazard.c: Likewise.
- gcc.target/arc/cmem-1.c: Likewise.
- gcc.target/arc/cmem-2.c: Likewise.
- gcc.target/arc/cmem-3.c: Likewise.
- gcc.target/arc/cmem-4.c: Likewise.
- gcc.target/arc/cmem-5.c: Likewise.
- gcc.target/arc/cmem-6.c: Likewise.
- gcc.target/arc/loop-4.c: Likewise.
- gcc.target/arc/movh_cl-1.c: Likewise.
- gcc.target/arc/sdata-3.c: Likewise.

33e64c52b9f [ARC] Improve code gen when compiling for size
gcc/ChangeLog | 27 +++
gcc/config/arc/arc-protos.h | 4 +
gcc/config/arc/arc.c | 222 +++++++++++++++++++---
gcc/config/arc/arc.md | 215 ++++++++++++---------
gcc/config/arc/constraints.md | 22 ++-
gcc/testsuite/ChangeLog | 17 ++
gcc/testsuite/gcc.target/arc/and-cnst-size.c | 16 ++
gcc/testsuite/gcc.target/arc/arc700-stld-hazard.c | 5 +-
gcc/testsuite/gcc.target/arc/cmem-1.c | 6 +-
gcc/testsuite/gcc.target/arc/cmem-2.c | 6 +-
gcc/testsuite/gcc.target/arc/cmem-3.c | 6 +-
gcc/testsuite/gcc.target/arc/cmem-4.c | 6 +-
gcc/testsuite/gcc.target/arc/cmem-5.c | 6 +-
gcc/testsuite/gcc.target/arc/cmem-6.c | 6 +-
gcc/testsuite/gcc.target/arc/loop-4.c | 3 +-
gcc/testsuite/gcc.target/arc/mov-cnst-size.c | 42 ++++
gcc/testsuite/gcc.target/arc/movh_cl-1.c | 2 +-
gcc/testsuite/gcc.target/arc/or-cnst-size.c | 16 ++
gcc/testsuite/gcc.target/arc/sdata-3.c | 20 +-
gcc/testsuite/gcc.target/arc/store-merge-1.c | 2 +-
20 files changed, 495 insertions(+), 154 deletions(-)

Upstream: gcc.gnu.org


  • Share