[AArch64] Add combiner patterns for FAC instructions
authorJames Greenhalgh <james.greenhalgh@arm.com>
Wed, 1 May 2013 10:46:00 +0000 (10:46 +0000)
committerJames Greenhalgh <jgreenhalgh@gcc.gnu.org>
Wed, 1 May 2013 10:46:00 +0000 (10:46 +0000)
gcc/
* config/aarch64/aarch64-simd.md (*aarch64_fac<optab><mode>): New.
* config/aarch64/iterators.md (FAC_COMPARISONS): New.

From-SVN: r198494

gcc/ChangeLog
gcc/config/aarch64/aarch64-simd.md
gcc/config/aarch64/iterators.md

index d0392c8..ccc1fc7 100644 (file)
@@ -1,5 +1,10 @@
 2013-05-01  James Greenhalgh  <james.greenhalgh@arm.com>
 
+       * config/aarch64/aarch64-simd.md (*aarch64_fac<optab><mode>): New.
+       * config/aarch64/iterators.md (FAC_COMPARISONS): New.
+
+2013-05-01  James Greenhalgh  <james.greenhalgh@arm.com>
+
        * config/aarch64/aarch64-simd.md
        (vcond<mode>_internal): Handle special cases for constant masks.
        (vcond<mode><mode>): Allow nonmemory_operands for outcome vectors.
index dfe4acb..21c2a68 100644 (file)
    (set_attr "simd_mode" "<MODE>")]
 )
 
+;; fac(ge|gt)
+;; Note we can also handle what would be fac(le|lt) by
+;; generating fac(ge|gt).
+
+(define_insn "*aarch64_fac<optab><mode>"
+  [(set (match_operand:<V_cmp_result> 0 "register_operand" "=w")
+       (neg:<V_cmp_result>
+         (FAC_COMPARISONS:<V_cmp_result>
+           (abs:VALLF (match_operand:VALLF 1 "register_operand" "w"))
+           (abs:VALLF (match_operand:VALLF 2 "register_operand" "w"))
+  )))]
+  "TARGET_SIMD"
+  "fac<n_optab>\t%<v>0<Vmtype>, %<v><cmp_1><Vmtype>, %<v><cmp_2><Vmtype>"
+  [(set_attr "simd_type" "simd_fcmp")
+   (set_attr "simd_mode" "<MODE>")]
+)
+
 ;; addp
 
 (define_insn "aarch64_addp<mode>"
index 0b9f9e8..00e315d 100644 (file)
 ;; Unsigned comparison operators.
 (define_code_iterator UCOMPARISONS [ltu leu geu gtu])
 
+;; Unsigned comparison operators.
+(define_code_iterator FAC_COMPARISONS [lt le ge gt])
+
 ;; -------------------------------------------------------------------
 ;; Code Attributes
 ;; -------------------------------------------------------------------