From bd83ff2c6700863b92c59931c4ba4a1bef97a50f Mon Sep 17 00:00:00 2001 From: Ian Bolton Date: Tue, 19 Mar 2013 16:17:14 +0000 Subject: [PATCH] AArch64 backend support for EXTR instruction. From-SVN: r196795 --- gcc/ChangeLog | 5 +++++ gcc/config/aarch64/aarch64.md | 28 ++++++++++++++++++++++++++++ gcc/testsuite/ChangeLog | 4 ++++ 3 files changed, 37 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b55bc7f..4b2d216 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2013-03-19 Ian Bolton + + * config/aarch64/aarch64.md (*extr5_insn): New pattern. + (*extrsi5_insn_uxtw): Likewise. + 2013-03-19 Richard Biener PR tree-optimization/56273 diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md index 76a5125..8fc86d4 100644 --- a/gcc/config/aarch64/aarch64.md +++ b/gcc/config/aarch64/aarch64.md @@ -2703,6 +2703,34 @@ (set_attr "mode" "")] ) +(define_insn "*extr5_insn" + [(set (match_operand:GPI 0 "register_operand" "=r") + (ior:GPI (ashift:GPI (match_operand:GPI 1 "register_operand" "r") + (match_operand 3 "const_int_operand" "n")) + (lshiftrt:GPI (match_operand:GPI 2 "register_operand" "r") + (match_operand 4 "const_int_operand" "n"))))] + "UINTVAL (operands[3]) < GET_MODE_BITSIZE (mode) && + (UINTVAL (operands[3]) + UINTVAL (operands[4]) == GET_MODE_BITSIZE (mode))" + "extr\\t%0, %1, %2, %4" + [(set_attr "v8type" "shift") + (set_attr "mode" "")] +) + +;; zero_extend version of the above +(define_insn "*extrsi5_insn_uxtw" + [(set (match_operand:DI 0 "register_operand" "=r") + (zero_extend:DI + (ior:SI (ashift:SI (match_operand:SI 1 "register_operand" "r") + (match_operand 3 "const_int_operand" "n")) + (lshiftrt:SI (match_operand:SI 2 "register_operand" "r") + (match_operand 4 "const_int_operand" "n")))))] + "UINTVAL (operands[3]) < 32 && + (UINTVAL (operands[3]) + UINTVAL (operands[4]) == 32)" + "extr\\t%w0, %w1, %w2, %4" + [(set_attr "v8type" "shift") + (set_attr "mode" "SI")] +) + (define_insn "*_ashl" [(set (match_operand:GPI 0 "register_operand" "=r") (ANY_EXTEND:GPI diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5a65528..fa69025 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2013-03-19 Ian Bolton + + * gcc.target/aarch64/extr.c: New test. + 2013-03-19 Richard Biener PR tree-optimization/56273 -- 2.7.4