From 0f6ca79c15711e28ea7a6330fc9ac017077fbaad Mon Sep 17 00:00:00 2001 From: Renlin Li Date: Fri, 2 Oct 2015 12:52:36 +0000 Subject: [PATCH] [PATCH][AARCH64]Add csneg3_uxtw_insn pattern gcc/ 2015-10-02 Renlin Li * config/aarch64/aarch64.md (csneg3_uxtw_insn): New pattern. gcc/testsuite/ 2015-10-02 Renlin Li * gcc.target/aarch64/csneg-1.c: Update test. From-SVN: r228387 --- gcc/ChangeLog | 4 ++++ gcc/config/aarch64/aarch64.md | 12 ++++++++++++ gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.target/aarch64/csneg-1.c | 12 ++++++++++++ 4 files changed, 32 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a84b8a9f31f..57a5a43ffb9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -3,6 +3,10 @@ * config/sh/sh.md: Add new unnamed split pattern to handle movt-movt sequences. +2015-10-02 Renlin Li + + * config/aarch64/aarch64.md (csneg3_insn_uxtw): New pattern. + 2015-10-02 Renlin Li PR target/66776 diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md index 20681cda431..74522f86105 100644 --- a/gcc/config/aarch64/aarch64.md +++ b/gcc/config/aarch64/aarch64.md @@ -3144,6 +3144,18 @@ [(set_attr "type" "csel")] ) +(define_insn "csneg3_uxtw_insn" + [(set (match_operand:DI 0 "register_operand" "=r") + (zero_extend:DI + (if_then_else:SI + (match_operand 1 "aarch64_comparison_operation" "") + (neg:SI (match_operand:SI 2 "register_operand" "r")) + (match_operand:SI 3 "aarch64_reg_or_zero" "rZ"))))] + "" + "csneg\\t%w0, %w3, %w2, %M1" + [(set_attr "type" "csel")] +) + (define_insn "csneg3_insn" [(set (match_operand:GPI 0 "register_operand" "=r") (if_then_else:GPI diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 87bcd8b1256..c95cda9e0d9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2015-10-02 Renlin Li + + * gcc.target/aarch64/csneg-1.c: Update. + 2015-10-02 Renlin Li PR target/66776 diff --git a/gcc/testsuite/gcc.target/aarch64/csneg-1.c b/gcc/testsuite/gcc.target/aarch64/csneg-1.c index 29d4e4ee70f..4860d64c935 100644 --- a/gcc/testsuite/gcc.target/aarch64/csneg-1.c +++ b/gcc/testsuite/gcc.target/aarch64/csneg-1.c @@ -56,3 +56,15 @@ int test_csneg_cmp(int x) x = -x; return x; } + +unsigned long long +test_csneg_uxtw (unsigned int a, + unsigned int b, + unsigned int c) +{ + /* { dg-final { scan-assembler "csneg\tw\[0-9\]*.*ne" } } */ + /* { dg-final { scan-assembler-not "uxtw\tw\[0-9\]*.*" } } */ + unsigned int val; + val = a ? b: -c; + return val; +} -- 2.30.2