[arm] Early split addvdi4

Programming / Compilers / GCC - rearnsha [138bc75d-0d04-0410-961f-82ee72b054a4] - 18 October 2019 19:04 EDT

This patch adds early splitting for addvdi4; it's very similar to the uaddvdi4 splitter, but the details are just different enough in places, especially for the patterns that match the splitting, where we have to compare against the non-widened version to detect if overflow occurred.

I've also added a testcase to the testsuite for a couple of constants that caught me out during the development of this patch. They're probably arm-specific values, but the test is generic enough that I've included it for all targets.

- config/arm/arm.c (arm_select_cc_mode): Allow either the first or second operand of the PLUS inside a DImode equality test to be sign-extend when selecting CC_Vmode.
- config/arm/arm.md (addvdi4): Early-split the operation into SImode instructions. (addsi3_cin_vout_reg, addsi3_cin_vout_imm, addsi3_cin_vout_0): New expand patterns. (addsi3_cin_vout_reg_insn, addsi3_cin_vout_imm_insn): New patterns. (addsi3_cin_vout_0): Likewise. (adddi3_compareV): Delete.

- gcc.dg/builtin-arith-overflow-3.c: New test.

8414e41f6fe [arm] Early split addvdi4
gcc/ChangeLog | 13 ++
gcc/config/arm/arm.c | 3 +-
gcc/config/arm/arm.md | 181 +++++++++++++++++++++---
gcc/testsuite/ChangeLog | 4 +
gcc/testsuite/gcc.dg/builtin-arith-overflow-3.c | 41 ++++++
5 files changed, 220 insertions(+), 22 deletions(-)

Upstream: gcc.gnu.org

  • Share