From patchwork Mon Jul 30 11:43:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramana Radhakrishnan X-Patchwork-Id: 10353 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 0F29223E56 for ; Mon, 30 Jul 2012 11:43:03 +0000 (UTC) Received: from mail-gh0-f180.google.com (mail-gh0-f180.google.com [209.85.160.180]) by fiordland.canonical.com (Postfix) with ESMTP id B6581A18ACA for ; Mon, 30 Jul 2012 11:43:02 +0000 (UTC) Received: by ghbz12 with SMTP id z12so4575885ghb.11 for ; Mon, 30 Jul 2012 04:43:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :mime-version:date:message-id:subject:from:to:cc:content-type :x-gm-message-state; bh=vd9b6vUuYS/9CEMPcVn7l/kWq/iNZIP3HbLwLdB/59I=; b=d5QBePgWB8DdnpcHTOhfmvHog98BtOYf+WEgdGS0SbSwHjH8dCDOjiVT4RfvyOAS3K /zjbg+Bek5j0ihdyHu7GH11IRVs4V7vzcKlfPYsgM+iVa5q1Kg5M+uBvpTayhRoE0rHD PlyHsPq7chuQ4AxJXlk8cbgLRiC5tSyLP+CkltGJppizYpcsUjdGOMXZqOS4Rg5FA5cj lgpUT9ZoZsosLJGtxzysxs3IwD73nbo8FD3Z0Y0dq6CglpDo3Ye7zzKYwXI37T+FC9wh wPLScp4lyLj7/40gJt36NuPYOkMZYBNkUpjWwrs0foGsvDQ+HpRY7VALxeSj6tAcStfr IoVg== Received: by 10.50.46.132 with SMTP id v4mr7938981igm.25.1343648581998; Mon, 30 Jul 2012 04:43:01 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.87.40 with SMTP id u8csp83832igz; Mon, 30 Jul 2012 04:43:01 -0700 (PDT) Received: by 10.52.72.44 with SMTP id a12mr9304655vdv.124.1343648581320; Mon, 30 Jul 2012 04:43:01 -0700 (PDT) Received: from mail-vb0-f50.google.com (mail-vb0-f50.google.com [209.85.212.50]) by mx.google.com with ESMTPS id ez8si6508810vdb.115.2012.07.30.04.43.01 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 30 Jul 2012 04:43:01 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.50 is neither permitted nor denied by best guess record for domain of ramana.radhakrishnan@linaro.org) client-ip=209.85.212.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.50 is neither permitted nor denied by best guess record for domain of ramana.radhakrishnan@linaro.org) smtp.mail=ramana.radhakrishnan@linaro.org Received: by vbal1 with SMTP id l1so5495069vba.37 for ; Mon, 30 Jul 2012 04:43:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.95.203 with SMTP id dm11mr9371059vdb.70.1343648580795; Mon, 30 Jul 2012 04:43:00 -0700 (PDT) Received: by 10.58.210.194 with HTTP; Mon, 30 Jul 2012 04:43:00 -0700 (PDT) Date: Mon, 30 Jul 2012 12:43:00 +0100 Message-ID: Subject: [Patch ARM 1/6] Canonicalize neon_vaba and neon_vabal patterns. From: Ramana Radhakrishnan To: gcc-patches@gcc.gnu.org Cc: Patch Tracking , Richard Earnshaw X-Gm-Message-State: ALoCoQk8o9coSVLtMdpcQLPTVFVePJqvaloB3s7tDNTm1OY0L6Q6GXWf0AB6XBh8wnDw3ZK2aiZw > Patch 1 fixes up the vaba and vabal patterns to use a canonical RTL > form with the first operand to the plus being the more complex one. This patch canonicalizes the instruction patterns for the vaba and vabal intrinsics so that the more complex operand to plus is the first operand. This prevents needless splitting in combine. For reference, this was found by the new test in gcc.target/neon/vaba*.c and gcc.target/neon/vabal*.c from patch #4. Ok ? regards, Ramana 2012-07-27 Ramana Radhakrishnan * config/arm/neon.md (neon_vaba): Change to define_expand. (neon_vabal): Likewise. (neon_vaba_internal): New internal pattern. (neon_vabal_internal): New internal pattern. --- gcc/config/arm/neon.md | 61 ++++++++++++++++++++++++++++++++++++----------- 1 files changed, 46 insertions(+), 15 deletions(-) + "TARGET_NEON" + "vabal.%T3%#\t%q0, %P1, %P2" [(set_attr "neon_type" "neon_vaba")] ) diff --git a/gcc/config/arm/neon.md b/gcc/config/arm/neon.md index 7142c98..1ffbb7d 100644 --- a/gcc/config/arm/neon.md +++ b/gcc/config/arm/neon.md @@ -2335,29 +2335,60 @@ [(set_attr "neon_type" "neon_int_5")] ) -(define_insn "neon_vaba" +(define_expand "neon_vaba" + [(match_operand:VDQIW 0 "s_register_operand" "") + (match_operand:VDQIW 1 "s_register_operand" "") + (match_operand:VDQIW 2 "s_register_operand" "") + (match_operand:VDQIW 3 "s_register_operand" "") + (match_operand:SI 4 "immediate_operand" "")] + "TARGET_NEON" + "{ + emit_insn (gen_neon_vaba_internal (operands[0], operands[2], + operands[3], operands[4], + operands[1])); + DONE; + }" +) + +(define_insn "neon_vaba_internal" [(set (match_operand:VDQIW 0 "s_register_operand" "=w") - (plus:VDQIW (match_operand:VDQIW 1 "s_register_operand" "0") - (unspec:VDQIW [(match_operand:VDQIW 2 "s_register_operand" "w") - (match_operand:VDQIW 3 "s_register_operand" "w") - (match_operand:SI 4 "immediate_operand" "i")] - UNSPEC_VABD)))] + (plus:VDQIW (unspec:VDQIW + [(match_operand:VDQIW 1 "s_register_operand" "w") + (match_operand:VDQIW 2 "s_register_operand" "w") + (match_operand:SI 3 "immediate_operand" "i")] UNSPEC_VABD) + (match_operand:VDQIW 4 "s_register_operand" "0")))] "TARGET_NEON" - "vaba.%T4%#\t%0, %2, %3" + "vaba.%T3%#\t%0, %1, %2" [(set (attr "neon_type") (if_then_else (match_test "") (const_string "neon_vaba") (const_string "neon_vaba_qqq")))] ) -(define_insn "neon_vabal" +(define_expand "neon_vabal" + [(match_operand: 0 "s_register_operand" "") + (match_operand: 1 "s_register_operand" "") + (match_operand:VW 2 "s_register_operand" "") + (match_operand:VW 3 "s_register_operand" "") + (match_operand:SI 4 "immediate_operand" "")] + "TARGET_NEON" + "{ + emit_insn (gen_neon_vabal_internal (operands[0], operands[2], + operands[3], operands[4], + operands[1])); + DONE; + }" +) + +(define_insn "neon_vabal_internal" [(set (match_operand: 0 "s_register_operand" "=w") - (plus: (match_operand: 1 "s_register_operand" "0") - (unspec: [(match_operand:VW 2 "s_register_operand" "w") - (match_operand:VW 3 "s_register_operand" "w") - (match_operand:SI 4 "immediate_operand" "i")] - UNSPEC_VABDL)))] - "TARGET_NEON" - "vabal.%T4%#\t%q0, %P2, %P3" + (plus: (unspec: + [(match_operand:VW 1 "s_register_operand" "w") + (match_operand:VW 2 "s_register_operand" "w") + (match_operand:SI 3 "immediate_operand" "i")] + UNSPEC_VABDL) + (match_operand: 4 "s_register_operand" "0")))]