From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2384 invoked by alias); 17 Dec 2015 15:07:26 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 2374 invoked by uid 89); 17 Dec 2015 15:07:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.1 required=5.0 tests=BAYES_50,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=Classes, 0xFFFF, FNDECL, sk:FIRST_P X-HELO: mail-qg0-f48.google.com Received: from mail-qg0-f48.google.com (HELO mail-qg0-f48.google.com) (209.85.192.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 17 Dec 2015 15:07:24 +0000 Received: by mail-qg0-f48.google.com with SMTP id c96so9520119qgd.3 for ; Thu, 17 Dec 2015 07:07:24 -0800 (PST) X-Received: by 10.140.133.144 with SMTP id 138mr5697469qhf.0.1450364842064; Thu, 17 Dec 2015 07:07:22 -0800 (PST) Received: from ?IPv6:2601:181:c000:c497:a2a8:cdff:fe3e:b48? ([2601:181:c000:c497:a2a8:cdff:fe3e:b48]) by smtp.googlemail.com with ESMTPSA id z72sm4842192qkz.46.2015.12.17.07.07.21 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 17 Dec 2015 07:07:21 -0800 (PST) To: GCC Patches From: Nathan Sidwell Subject: [PTX] Reorder hard regs Message-ID: <5672CFA8.8000902@acm.org> Date: Thu, 17 Dec 2015 15:07:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------010002080708070400090502" X-SW-Source: 2015-12/txt/msg01774.txt.bz2 This is a multi-part message in MIME format. --------------010002080708070400090502 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-length: 176 This reorders the hardregs to be a contiguous block, and names them somewhat more conventionally. (I had considered %sp, %fp etc, but went with the longer names). nathan --------------010002080708070400090502 Content-Type: text/x-patch; name="trunk-ptx-regs.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="trunk-ptx-regs.patch" Content-length: 3090 2015-12-17 Nathan Sidwell * config/nvptx/nvptx.h (NVPTX_RETURN_REGNUM, FRAME_POINTER_REGNUM, ARG_POINTER_REGNUM, STATIC_CHAIN_REGNUM): Renumber. (REGISTER_NAMES): Update and rename. (FIXED_REGISTERS, CALL_USED_REGISTERS): Update. (enum_reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS): Reformat. Index: config/nvptx/nvptx.h =================================================================== --- config/nvptx/nvptx.h (revision 231769) +++ config/nvptx/nvptx.h (working copy) @@ -78,19 +78,15 @@ #define PTRDIFF_TYPE (TARGET_ABI64 ? "long int" : "int") #define POINTER_SIZE (TARGET_ABI64 ? 64 : 32) - #define Pmode (TARGET_ABI64 ? DImode : SImode) /* Registers. Since ptx is a virtual target, we just define a few - hard registers for special purposes and leave pseudos unallocated. */ - -#define FIRST_PSEUDO_REGISTER 16 -/* We have to have some available hard registers, to keep gcc setup + hard registers for special purposes and leave pseudos unallocated. + We have to have some available hard registers, to keep gcc setup happy. */ -#define FIXED_REGISTERS \ - { 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1 } -#define CALL_USED_REGISTERS \ - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } +#define FIRST_PSEUDO_REGISTER 16 +#define FIXED_REGISTERS { 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +#define CALL_USED_REGISTERS { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } #define HARD_REGNO_NREGS(REG, MODE) \ ((void)(REG), (void)(MODE), 1) @@ -100,32 +96,13 @@ ((void)(REG), (void)(MODE), true) /* Register Classes. */ - -enum reg_class - { - NO_REGS, - ALL_REGS, - LIM_REG_CLASSES - }; - +enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES }; +#define REG_CLASS_NAMES { "NO_REGS", "ALL_REGS" } +#define REG_CLASS_CONTENTS { { 0x0000 }, { 0xFFFF } } #define N_REG_CLASSES (int) LIM_REG_CLASSES -#define REG_CLASS_NAMES { \ - "NO_REGS", \ - "ALL_REGS" } - -#define REG_CLASS_CONTENTS \ -{ \ - /* NO_REGS. */ \ - { 0x0000 }, \ - /* ALL_REGS. */ \ - { 0xFFFF }, \ -} - #define GENERAL_REGS ALL_REGS - #define REGNO_REG_CLASS(R) ((void)(R), ALL_REGS) - #define BASE_REG_CLASS ALL_REGS #define INDEX_REG_CLASS NO_REGS @@ -151,17 +128,16 @@ enum reg_class #define FRAME_GROWS_DOWNWARD 0 #define STACK_GROWS_DOWNWARD 1 +#define NVPTX_RETURN_REGNUM 0 #define STACK_POINTER_REGNUM 1 -#define NVPTX_RETURN_REGNUM 4 -#define FRAME_POINTER_REGNUM 15 -#define ARG_POINTER_REGNUM 14 - -#define STATIC_CHAIN_REGNUM 12 +#define FRAME_POINTER_REGNUM 2 +#define ARG_POINTER_REGNUM 3 +#define STATIC_CHAIN_REGNUM 4 #define REGISTER_NAMES \ { \ - "%hr0", "%outargs", "%hfp", "%hr3", "%retval", "%hr5", "%hr6", "%hr7", \ - "%hr8", "%hr9", "%hr10", "%hr11", "%chain_in", "%hr13", "%argp", "%frame" \ + "%value", "%stack", "%frame", "%args", "%chain", "%hr5", "%hr6", "%hr7", \ + "%hr8", "%hr9", "%hr10", "%hr11", "%hr12", "%hr13", "%hr14", "%hr15" \ } #define FIRST_PARM_OFFSET(FNDECL) ((void)(FNDECL), 0) --------------010002080708070400090502--