From patchwork Thu May 15 00:10:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kugan Vivekanandarajah X-Patchwork-Id: 30211 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f69.google.com (mail-pa0-f69.google.com [209.85.220.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6C90920446 for ; Thu, 15 May 2014 00:10:46 +0000 (UTC) Received: by mail-pa0-f69.google.com with SMTP id ey11sf1790830pad.0 for ; Wed, 14 May 2014 17:10:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mailing-list:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:sender :delivered-to:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:x-original-sender :x-original-authentication-results:content-type; bh=ZyBq/MteBjfLqCE7BVEnyeKGIrcc5vkGiZSenuYQErw=; b=enZTODVAMWCSlBfvRyCMGWIaxoAxW8PZboMf8kiTc+4my9y9dJISVlGLM/ZfV2VbRI otVjfg9P2JK2/FBDJdDh7YloTKHHp8+T8VYGnrF7tMrocppLWABv+8l+fGDFx/V5i1gU dW0ZINIw3810TlJ5uhGSsi/5cvpggTiStCYiBa9IL/or2FC2FgawaTsJA3/oHzYTTrt5 jBjccH3Trhn+KN0biGu+itOVFX83xtJ75uM09AjA7tDScN2Eb7VT/cZxhFtviM+3gyqA SEEZyYn+QWLBvgGQWmaWW3hr75Fs6IrX+36x5bUxHu0iQ4Blx/7Fn6RxEmjf1lGzhnnC mWgw== X-Gm-Message-State: ALoCoQnV/ilihprTrg/spT2nVJMdBcUXFho/VrB96XZs9orxlvn/0Tp3N5JrmLxkhgszJF24Eq+9 X-Received: by 10.66.216.130 with SMTP id oq2mr3405633pac.44.1400112645679; Wed, 14 May 2014 17:10:45 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.104.49 with SMTP id z46ls5795qge.50.gmail; Wed, 14 May 2014 17:10:45 -0700 (PDT) X-Received: by 10.220.190.197 with SMTP id dj5mr5459815vcb.19.1400112645386; Wed, 14 May 2014 17:10:45 -0700 (PDT) Received: from mail-vc0-x22f.google.com (mail-vc0-x22f.google.com [2607:f8b0:400c:c03::22f]) by mx.google.com with ESMTPS id he19si606082veb.66.2014.05.14.17.10.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 14 May 2014 17:10:45 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c03::22f as permitted sender) client-ip=2607:f8b0:400c:c03::22f; Received: by mail-vc0-f175.google.com with SMTP id hu19so3441672vcb.20 for ; Wed, 14 May 2014 17:10:45 -0700 (PDT) X-Received: by 10.52.94.6 with SMTP id cy6mr4600545vdb.15.1400112644912; Wed, 14 May 2014 17:10:44 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp280301vcb; Wed, 14 May 2014 17:10:43 -0700 (PDT) X-Received: by 10.66.66.108 with SMTP id e12mr8238233pat.35.1400112643159; Wed, 14 May 2014 17:10:43 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id rw8si1738301pbc.233.2014.05.14.17.10.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 May 2014 17:10:43 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-367523-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 7027 invoked by alias); 15 May 2014 00:10:28 -0000 Mailing-List: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org Precedence: list 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 7014 invoked by uid 89); 15 May 2014 00:10:26 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pb0-f52.google.com Received: from mail-pb0-f52.google.com (HELO mail-pb0-f52.google.com) (209.85.160.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 15 May 2014 00:10:23 +0000 Received: by mail-pb0-f52.google.com with SMTP id rr13so281231pbb.11 for ; Wed, 14 May 2014 17:10:21 -0700 (PDT) X-Received: by 10.66.180.200 with SMTP id dq8mr8244166pac.104.1400112621646; Wed, 14 May 2014 17:10:21 -0700 (PDT) Received: from [10.1.1.2] (58-6-183-210.dyn.iinet.net.au. [58.6.183.210]) by mx.google.com with ESMTPSA id yv7sm13586215pac.33.2014.05.14.17.10.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 14 May 2014 17:10:19 -0700 (PDT) Message-ID: <537405E1.8020000@linaro.org> Date: Thu, 15 May 2014 10:10:09 +1000 From: Kugan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" Subject: [RFC][AArch64] Remove CORE_REGS form reg_class References: <5373FA98.1050806@linaro.org> In-Reply-To: <5373FA98.1050806@linaro.org> X-Forwarded-Message-Id: <5373FA98.1050806@linaro.org> X-IsSubscribed: yes X-Original-Sender: kugan.vivekanandarajah@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c03::22f as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@gcc.gnu.org X-Google-Group-Id: 836684582541 Hi All, AAarch64 back-end defines GENERAL_REGS and CORE_REGS with the same set of register. Is there any reason why we need this? target hooks like aarch64_register_move_cost doesn’t handle CORE_REGS. In addition, IRA cost calculation also has logics like make common class biggest of best and alternate; this might get confused with this. Attached RFC patch removes it. regression tested for aarch64-none-linux-gnu on qemu-aarch64 with now new regression. Is this OK ? Thanks, Kugan gcc/ 2014-05-14 Kugan Vivekanandarajah * config/aarch64/aarch64.c (aarch64_regno_regclass) : Change CORE_REGS to GENERAL_REGS. (aarch64_secondary_reload) : LikeWise. (aarch64_class_max_nregs) : Remove CORE_REGS. * config/aarch64/aarch64.h (enum reg_class) : Remove CORE_REGS. (REG_CLASS_NAMES) : Likewise. (REG_CLASS_CONTENTS) : LikeWise. (INDEX_REG_CLASS) : Change CORE_REGS to GENERAL_REGS. diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index a3147ee..eee36ba 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -3951,7 +3951,7 @@ enum reg_class aarch64_regno_regclass (unsigned regno) { if (GP_REGNUM_P (regno)) - return CORE_REGS; + return GENERAL_REGS; if (regno == SP_REGNUM) return STACK_REG; @@ -4102,12 +4102,12 @@ aarch64_secondary_reload (bool in_p ATTRIBUTE_UNUSED, rtx x, /* A TFmode or TImode memory access should be handled via an FP_REGS because AArch64 has richer addressing modes for LDR/STR instructions than LDP/STP instructions. */ - if (!TARGET_GENERAL_REGS_ONLY && rclass == CORE_REGS + if (!TARGET_GENERAL_REGS_ONLY && rclass == GENERAL_REGS && GET_MODE_SIZE (mode) == 16 && MEM_P (x)) return FP_REGS; if (rclass == FP_REGS && (mode == TImode || mode == TFmode) && CONSTANT_P(x)) - return CORE_REGS; + return GENERAL_REGS; return NO_REGS; } @@ -4239,7 +4239,6 @@ aarch64_class_max_nregs (reg_class_t regclass, enum machine_mode mode) { switch (regclass) { - case CORE_REGS: case POINTER_REGS: case GENERAL_REGS: case ALL_REGS: diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h index 7962aa4..3455ecc 100644 --- a/gcc/config/aarch64/aarch64.h +++ b/gcc/config/aarch64/aarch64.h @@ -409,7 +409,6 @@ extern unsigned long aarch64_tune_flags; enum reg_class { NO_REGS, - CORE_REGS, GENERAL_REGS, STACK_REG, POINTER_REGS, @@ -424,7 +423,6 @@ enum reg_class #define REG_CLASS_NAMES \ { \ "NO_REGS", \ - "CORE_REGS", \ "GENERAL_REGS", \ "STACK_REG", \ "POINTER_REGS", \ @@ -436,7 +434,6 @@ enum reg_class #define REG_CLASS_CONTENTS \ { \ { 0x00000000, 0x00000000, 0x00000000 }, /* NO_REGS */ \ - { 0x7fffffff, 0x00000000, 0x00000003 }, /* CORE_REGS */ \ { 0x7fffffff, 0x00000000, 0x00000003 }, /* GENERAL_REGS */ \ { 0x80000000, 0x00000000, 0x00000000 }, /* STACK_REG */ \ { 0xffffffff, 0x00000000, 0x00000003 }, /* POINTER_REGS */ \ @@ -447,7 +444,7 @@ enum reg_class #define REGNO_REG_CLASS(REGNO) aarch64_regno_regclass (REGNO) -#define INDEX_REG_CLASS CORE_REGS +#define INDEX_REG_CLASS GENERAL_REGS #define BASE_REG_CLASS POINTER_REGS /* Register pairs used to eliminate unneeded registers that point into