[PATCH][AARCH64]Add csneg3_uxtw_insn pattern
authorRenlin Li <renlin.li@arm.com>
Fri, 2 Oct 2015 12:52:36 +0000 (12:52 +0000)
committerRenlin Li <renlin@gcc.gnu.org>
Fri, 2 Oct 2015 12:52:36 +0000 (12:52 +0000)
gcc/

2015-10-02  Renlin Li <renlin.li@arm.com>

* config/aarch64/aarch64.md (csneg3_uxtw_insn): New pattern.

gcc/testsuite/

2015-10-02  Renlin Li <renlin.li@arm.com>

* gcc.target/aarch64/csneg-1.c: Update test.

From-SVN: r228387

gcc/ChangeLog
gcc/config/aarch64/aarch64.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/aarch64/csneg-1.c

index a84b8a9f31f5ac4031e34a58918c1e7af98732e1..57a5a43ffb9aec555ba1cdd6b500920683e2c87d 100644 (file)
@@ -3,6 +3,10 @@
        * config/sh/sh.md: Add new unnamed split pattern to handle movt-movt
        sequences.
 
+2015-10-02  Renlin Li  <renlin.li@arm.com>
+
+       * config/aarch64/aarch64.md (csneg3_insn_uxtw): New pattern.
+
 2015-10-02  Renlin Li  <renlin.li@arm.com>
 
        PR target/66776
index 20681cda431e34cb7e63339c580bdac843e12081..74522f8610515cec3b1ae91d300f59cc16e2ff8e 100644 (file)
   [(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<mode>_insn"
   [(set (match_operand:GPI 0 "register_operand" "=r")
         (if_then_else:GPI
index 87bcd8b1256e9f0b007ac19aeb87ba439e506cb2..c95cda9e0d9b751225656c6cee611e70ebbd0676 100644 (file)
@@ -1,3 +1,7 @@
+2015-10-02  Renlin Li  <renlin.li@arm.com>
+
+       * gcc.target/aarch64/csneg-1.c: Update.
+
 2015-10-02  Renlin Li  <renlin.li@arm.com>
 
        PR target/66776
index 29d4e4ee70ff3e5bb67dec29ca5c4d5064877143..4860d64c93535d9f0488b93b389e3980c7de9223 100644 (file)
@@ -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;
+}