[PATCH][AARCH64][PR66776]Add cmovdi_insn_uxtw pattern.
authorRenlin Li <renlin.li@arm.com>
Fri, 2 Oct 2015 11:55:04 +0000 (11:55 +0000)
committerRenlin Li <renlin@gcc.gnu.org>
Fri, 2 Oct 2015 11:55:04 +0000 (11:55 +0000)
gcc/

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

PR target/66776
* config/aarch64/aarch64.md (cmovdi_insn_uxtw): New pattern.

gcc/testsuite/

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

PR target/66776
* gcc.target/aarch64/pr66776.c: New.

From-SVN: r228384

gcc/ChangeLog
gcc/config/aarch64/aarch64.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/aarch64/pr66776.c [new file with mode: 0644]

index 91c9972987962e570cc32fcebedf17c63c724ac7..c71a020ee50b7e2822ef8e68dc03d40121008979 100644 (file)
@@ -1,3 +1,8 @@
+2015-10-02  Renlin Li  <renlin.li@arm.com>
+
+       PR target/66776
+       * config/aarch64/aarch64.md (cmovdi_insn_uxtw): New pattern.
+
 2015-10-02  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
 
        PR rtl-optimization/67786
index c3cd58d7e4e14a5994832cc5b173a1073be3b6b1..20681cda431e34cb7e63339c580bdac843e12081 100644 (file)
   [(set_attr "type" "csel")]
 )
 
+(define_insn "*cmovdi_insn_uxtw"
+  [(set (match_operand:DI 0 "register_operand" "=r")
+       (if_then_else:DI
+        (match_operator 1 "aarch64_comparison_operator"
+         [(match_operand 2 "cc_register" "") (const_int 0)])
+        (zero_extend:DI (match_operand:SI 3 "register_operand" "r"))
+        (zero_extend:DI (match_operand:SI 4 "register_operand" "r"))))]
+  ""
+  "csel\\t%w0, %w3, %w4, %m1"
+  [(set_attr "type" "csel")]
+)
+
 (define_insn "*cmov<mode>_insn"
   [(set (match_operand:GPF 0 "register_operand" "=w")
        (if_then_else:GPF
index 169c0c4e218b117632dd62d45420d5ee96167119..87bcd8b1256e9f0b007ac19aeb87ba439e506cb2 100644 (file)
@@ -1,3 +1,8 @@
+2015-10-02  Renlin Li  <renlin.li@arm.com>
+
+       PR target/66776
+       * gcc.target/aarch64/pr66776.c: New.
+
 2015-10-02  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gnat.dg/warn13.adb: New test.
diff --git a/gcc/testsuite/gcc.target/aarch64/pr66776.c b/gcc/testsuite/gcc.target/aarch64/pr66776.c
new file mode 100644 (file)
index 0000000..a5c83b4
--- /dev/null
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 --save-temps" } */
+
+unsigned long long
+foo (unsigned int a, unsigned int b, unsigned int c)
+{
+  return a ? b : c;
+}
+
+/* { dg-final { scan-assembler-not "uxtw" } } */