[AArch64] Remove ashift pattern for QI/HI
authorJiong Wang <jiong.wang@arm.com>
Mon, 19 Jan 2015 14:13:33 +0000 (14:13 +0000)
committerJiong Wang <jiwang@gcc.gnu.org>
Mon, 19 Jan 2015 14:13:33 +0000 (14:13 +0000)
2015-01-19  Jiong Wang  <jiong.wang@arm.com>
    Andrew Pinski  <apinski@cavium.com>

  gcc/
    PR target/64304
    * config/aarch64/aarch64.md (define_insn "*ashl<mode>3_insn"): Deleted.
    (ashl<mode>3): Don't expand if operands[2] is not constant.

  gcc/testsuite/
    * gcc.target/aarch64/pr64304.c: New testcase.

Co-Authored-By: Andrew Pinski <apinski@cavium.com>
From-SVN: r219844

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

index 605b87e9070512b1b5a5695ce8fbc63dd8987206..4e03d90c1b520f31a94a23748c9e804d2c3da697 100644 (file)
@@ -1,3 +1,10 @@
+2015-01-19  Jiong Wang  <jiong.wang@arm.com>
+           Andrew Pinski  <apinski@cavium.com>
+
+       PR target/64304
+       * config/aarch64/aarch64.md (define_insn "*ashl<mode>3_insn"): Deleted.
+       (ashl<mode>3): Don't expand if operands[2] is not constant.
+
 2015-01-19  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
 
        PR target/64448
index fde5e4f0223bbee213ff5e8d8955ebf8ba5d053f..bc49fbe68a978b3ca069c6d084f542773df84bcb 100644 (file)
            DONE;
           }
       }
+    else
+      FAIL;
   }
 )
 
   [(set_attr "type" "shift_reg")]
 )
 
-(define_insn "*ashl<mode>3_insn"
-  [(set (match_operand:SHORT 0 "register_operand" "=r")
-       (ashift:SHORT (match_operand:SHORT 1 "register_operand" "r")
-                     (match_operand:QI 2 "aarch64_reg_or_shift_imm_si" "rUss")))]
-  ""
-  "lsl\\t%<w>0, %<w>1, %<w>2"
-  [(set_attr "type" "shift_reg")]
-)
-
 (define_insn "*<optab><mode>3_insn"
   [(set (match_operand:SHORT 0 "register_operand" "=r")
        (ASHIFT:SHORT (match_operand:SHORT 1 "register_operand" "r")
index 87017f73e12327f6685070bef00819f709097f56..7e1bcc42a8f7dde84dc2c64077f13ee1e9e29684 100644 (file)
@@ -1,3 +1,7 @@
+2015-01-19  Jiong Wang  <jiong.wang@arm.com>
+
+       * gcc.target/aarch64/pr64304.c: New testcase.
+
 2014-01-19  Igor Zamyatin  <igor.zamyatin@intel.com>
 
        PR rtl-optimization/64081
diff --git a/gcc/testsuite/gcc.target/aarch64/pr64304.c b/gcc/testsuite/gcc.target/aarch64/pr64304.c
new file mode 100644 (file)
index 0000000..5423bb3
--- /dev/null
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 --save-temps" } */
+
+unsigned char byte = 0;
+
+void
+set_bit (unsigned int bit, unsigned char value)
+{
+  unsigned char mask = (unsigned char) (1 << (bit & 7));
+
+  if (! value)
+    byte &= (unsigned char)~mask;
+  else
+    byte |= mask;
+  /* { dg-final { scan-assembler "and\tw\[0-9\]+, w\[0-9\]+, 7" } } */
+}
+
+/* { dg-final { cleanup-saved-temps } } */