From patchwork Mon Jun 23 07:00:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhenqiang Chen X-Patchwork-Id: 362672 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 5EC3D140084 for ; Mon, 23 Jun 2014 17:01:27 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:content-type; q= dns; s=default; b=czwpt5KLLq9NWB/pJmLa339zKfVrQ4K47LRM5nS5UvH/RH hlPsHCKPTj5sXdFCUlgiGixSkXX+SviJaAWOaqhdqlz/yoRcEpO6FxOaSotKcotd IfPeC7vo36iLm9VuatuvUkB2YNf9tz+PbA1rJ9LSSafT+IsdzpfLhmhxOeC2Q= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:content-type; s= default; bh=YN9xsYcSGVHL/1xwFGS2nYiW0dM=; b=CPykbGfBMS0WKRLn9MbG sO7b5BBpslzndzrZiE8PH2TeTW3I25e16eV/rPenf3omRaAGgaCoKArAiak+7UvT GW91sOh7U7uhOHwGqpoDrpem7oHOeQCil7GZ+gXO5lBeCucO1u7ApK58Fyq6HzbB jFcqX18ab1zNLI8x8N9kwTw= Received: (qmail 18018 invoked by alias); 23 Jun 2014 07:01:20 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 18006 invoked by uid 89); 23 Jun 2014 07:01:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-lb0-f173.google.com Received: from mail-lb0-f173.google.com (HELO mail-lb0-f173.google.com) (209.85.217.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 23 Jun 2014 07:00:50 +0000 Received: by mail-lb0-f173.google.com with SMTP id s7so3895361lbd.18 for ; Mon, 23 Jun 2014 00:00:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=rQz10YdvoXMxzPcKks8dkbiwSb3kRdc7tgZZpdXcUdI=; b=kgSzq/aK/stRWJZ2Kzamywyct3EXBx4Lhfh9bslUF0PKvpmpJmdl5uXAP/X8ke+xbC HZ9oduXox5Icg3HIFoJoiquvvqNuSeh0s1z8dkqyAQ1gXg7po848jq9oA6tSPs/E1eHs ieD6vsu23y7sbFOMWK4dtCabCc1En9ncY1zXViYtrEYuOnKEo3nfYWUMuFAMnELB06Ts ZHJetk8jpSK8GOpRhFItorT8p71trV0ejLVrAWs4JVmu+y//HhEM+qegvXUDVohyCCHX kaOyth2GBegPWBPl35fwtzcngd3LmzBQItBYCzENkrF8lt5LetjZXR4/TuKr9y/u7C5V RJVA== X-Gm-Message-State: ALoCoQk2WB4C2veujdnx2MPyuJKCDfY5Lk6cEVqxERREH8FzHrKi7PWlgzouIsagXb/uLsA+TC2q MIME-Version: 1.0 X-Received: by 10.112.126.38 with SMTP id mv6mr10046649lbb.54.1403506847334; Mon, 23 Jun 2014 00:00:47 -0700 (PDT) Received: by 10.112.13.36 with HTTP; Mon, 23 Jun 2014 00:00:47 -0700 (PDT) Date: Mon, 23 Jun 2014 15:00:47 +0800 Message-ID: Subject: [PATCH, 8/10] aarch64: ccmp insn patterns From: Zhenqiang Chen To: "gcc-patches@gcc.gnu.org" X-IsSubscribed: yes Hi, The patch adds two insn patterns for ccmp instructions. cbranchcc4 is introduced to generate optimized conditional branch without an additional compare against the result of ccmp. OK for trunk? Thanks! -Zhenqiang ChangeLog: 2014-06-23 Zhenqiang Chen * config/aarch64/aarch64.md (cbranchcc4): New. (*ccmp_and, *ccmp_ior): New. diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md index a4d8887..c25d940 100644 --- a/gcc/config/aarch64/aarch64.md +++ b/gcc/config/aarch64/aarch64.md @@ -230,6 +230,52 @@ " ) +(define_expand "cbranchcc4" + [(set (pc) (if_then_else + (match_operator 0 "aarch64_comparison_operator" + [(match_operand 1 "cc_register" "") + (const_int 0)]) + (label_ref (match_operand 3 "" "")) + (pc)))] + "" + " ") + +(define_insn "*ccmp_and" + [(set (match_operand 6 "ccmp_cc_register" "") + (compare + (and:SI + (match_operator 4 "aarch64_comparison_operator" + [(match_operand 0 "ccmp_cc_register" "") + (match_operand 1 "aarch64_plus_operand" "")]) + (match_operator 5 "aarch64_comparison_operator" + [(match_operand:GPI 2 "register_operand" "r,r,r") + (match_operand:GPI 3 "aarch64_ccmp_operand" "r,Uss,Usn")])) + (const_int 0)))] + "" + { + return aarch64_output_ccmp (operands, true, which_alternative); + } + [(set_attr "type" "alus_reg,alus_imm,alus_imm")] +) + +(define_insn "*ccmp_ior" + [(set (match_operand 6 "ccmp_cc_register" "") + (compare + (ior:SI + (match_operator 4 "aarch64_comparison_operator" + [(match_operand 0 "ccmp_cc_register" "") + (match_operand 1 "aarch64_plus_operand" "")]) + (match_operator 5 "aarch64_comparison_operator" + [(match_operand:GPI 2 "register_operand" "r,r,r") + (match_operand:GPI 3 "aarch64_ccmp_operand" "r,Uss,Usn")])) + (const_int 0)))] + "" + { + return aarch64_output_ccmp (operands, false, which_alternative); + } + [(set_attr "type" "alus_reg,alus_imm,alus_imm")] +) + (define_insn "*condjump" [(set (pc) (if_then_else (match_operator 0 "aarch64_comparison_operator" [(match_operand 1 "cc_register" "") (const_int 0)]) 57,1