From patchwork Wed Oct 3 18:38:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Koning X-Patchwork-Id: 978484 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-486900-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=comcast.net Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="vm1qVqKF"; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=comcast.net header.i=@comcast.net header.b="Q6kxmBRZ"; dkim-atps=neutral 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 42QPsx0Z3Kz9s7W for ; Thu, 4 Oct 2018 04:38:28 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :content-type:content-transfer-encoding:mime-version:subject :message-id:date:to; q=dns; s=default; b=mrbVNaGDbleBwTJ+0BIGP4D wqi/bpwTeIvkpKQ2C9VFZSsZmhZQOxCQUMiF7cH38lMPSlXr8m3YBim0/rxMgnrJ sLIUXXsKJQrEyqbXM/ZtuEbzqccnDM4+RXkz+TMBSGJN9UyX2cFaevEQM4UgfeKv 8U6un3czbJKB+UJly4I0= 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:from :content-type:content-transfer-encoding:mime-version:subject :message-id:date:to; s=default; bh=5zE/gYD2sLxmrqbDqwmXywAcdPY=; b= vm1qVqKFNeIEw69nYTnCI4ic2EYTCanBz25r8VNLO7nRihhDuLiLPafVi260DkEz 6rnLZPLa9hA4gShChjT9xD0CN899ANHgRvm8gVfMP12/nSyaZyM6nn7H9jpHxI6U tdfOX4NwQG36MgIdb39+mKpb1WWMh/ZofejtDp2JAnQ= Received: (qmail 20816 invoked by alias); 3 Oct 2018 18:38:15 -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 20706 invoked by uid 89); 3 Oct 2018 18:38:14 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-15.1 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, KAM_NUMSUBJECT, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=H*r:192.168.10, UD:comcast.net, H*F:D*comcast.net, Memory X-HELO: resqmta-po-12v.sys.comcast.net Received: from resqmta-po-12v.sys.comcast.net (HELO resqmta-po-12v.sys.comcast.net) (96.114.154.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 03 Oct 2018 18:38:12 +0000 Received: from resomta-po-18v.sys.comcast.net ([96.114.154.242]) by resqmta-po-12v.sys.comcast.net with ESMTP id 7j8xgziQtWxvn7m2EgTTpu; Wed, 03 Oct 2018 18:38:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20161114; t=1538591890; bh=S3HhxjAWobzjTDeZu4byedmUMDiIO9jYMwb1KjCfDKs=; h=Received:Received:From:Content-Type:Mime-Version:Subject: Message-Id:Date:To; b=Q6kxmBRZl4hh2Pl2ymZY2jOcmSKTlIjSCYXpv+C2GWojhVcl3lWOdKm9CHKvFEfR1 ahkRjoqd4aIpUZXBZR1rp2yz87mF201/yKFTEdikJ7ioyIAKGsUrq24WnzZU/2iTBa Hzn/+687wa/VhbdaGzDa9CbrDj9yOxrYMtIF1NVpDZBvPpqgHWtbXNIVBuPTD36HMP QsEZTnhZNPIM2eOwC8ebgLrEAfkXd5ybT4Fux6LxM4C6k8IyyNbFSkX9p+BMReN8lM vCQNkWJh4rO74qmtyQRv2g7XmCKqAWHj4AQ6UFHHQAgAfOnzgJv4DtIcHifrNYP/Ck 8Wn0xUvo5Lu+g== Received: from [192.168.10.125] ([73.60.223.101]) by resomta-po-18v.sys.comcast.net with ESMTPSA id 7m2Dgez8RYE2u7m2EgkxzQ; Wed, 03 Oct 2018 18:38:10 +0000 From: Paul Koning Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: [PATCH, pdp11] Enable LRA for pdp11 Message-Id: <37884A4B-1108-4FDF-9720-82E076C30A2A@comcast.net> Date: Wed, 3 Oct 2018 14:38:07 -0400 To: GCC patches This patch enables LRA register allocator support for pdp11. For the moment, it is invoked via a switch (-mlra) as is done by a few other targets. There are some code quality issues and test suite rejects to be looked at, but it's close enough for initial delivery. Thanks to Segher for pointing out that LRA requires define_memory_constraint, while the old allocator is happy when memory operands use define_constraint. Committed. paul ChangeLog: 2018-10-03 Paul Koning Enable LRA register allocator for PDP11. * config/pdp11/constraints.md (Q): Use define_memory_constraints. (R): Likewise. (D): Likewise. * config/pdp11/pdp11.c (pdp11_lra_p): New function. * config/pdp11/pdp11.opt (-mlra): New option. * doc/invoke.texi (PDP-11 Options): Document -mlra. Index: doc/invoke.texi =================================================================== --- doc/invoke.texi (revision 264818) +++ doc/invoke.texi (revision 264819) @@ -1007,7 +1007,7 @@ Objective-C and Objective-C++ Dialects}. @gccoptlist{-mfpu -msoft-float -mac0 -mno-ac0 -m40 -m45 -m10 @gol -mint32 -mno-int16 -mint16 -mno-int32 @gol -mfloat32 -mno-float64 -mfloat64 -mno-float32 @gol --msplit -munix-asm -mdec-asm -mgnu-asm} +-msplit -munix-asm -mdec-asm -mgnu-asm -mlra} @emph{picoChip Options} @gccoptlist{-mae=@var{ae_type} -mvliw-lookahead=@var{N} @gol @@ -22721,6 +22721,11 @@ Use DEC assembler syntax. @item -mgnu-asm @opindex mgnu-asm Use GNU assembler syntax. This is the default. + +@item -mlra +@opindex mlra +Use the new LRA register allocator. By default, the old ``reload'' +allocator is used. @end table @node picoChip Options Index: config/pdp11/constraints.md =================================================================== --- config/pdp11/constraints.md (revision 264818) +++ config/pdp11/constraints.md (revision 264819) @@ -70,19 +70,19 @@ (and (match_code "const_double") (match_test "op == CONST0_RTX (GET_MODE (op))"))) -(define_constraint "Q" +(define_memory_constraint "Q" "Memory reference that requires an additional word after the opcode" (and (match_code "mem") (match_test "memory_address_p (GET_MODE (op), XEXP (op, 0)) && !simple_memory_operand (op, GET_MODE (op))"))) -(define_constraint "R" +(define_memory_constraint "R" "Memory reference that is encoded within the opcode" (and (match_code "mem") (match_test "memory_address_p (GET_MODE (op), XEXP (op, 0)) && simple_memory_operand (op, GET_MODE (op))"))) -(define_constraint "D" +(define_memory_constraint "D" "Memory reference that is encoded within the opcode, and not push or pop" (and (match_code "mem") (match_test "memory_address_p (GET_MODE (op), XEXP (op, 0)) Index: config/pdp11/pdp11.c =================================================================== --- config/pdp11/pdp11.c (revision 264818) +++ config/pdp11/pdp11.c (revision 264819) @@ -230,7 +230,7 @@ static bool pdp11_scalar_mode_supported_p (scalar_ #define TARGET_PREFERRED_OUTPUT_RELOAD_CLASS pdp11_preferred_output_reload_class #undef TARGET_LRA_P -#define TARGET_LRA_P hook_bool_void_false +#define TARGET_LRA_P pdp11_lra_p #undef TARGET_LEGITIMATE_ADDRESS_P #define TARGET_LEGITIMATE_ADDRESS_P pdp11_legitimate_address_p @@ -991,6 +991,12 @@ pdp11_assemble_integer (rtx x, unsigned int size, } +static bool +pdp11_lra_p (void) +{ + return TARGET_LRA; +} + /* Register to register moves are cheap if both are general registers. */ static int Index: config/pdp11/pdp11.opt =================================================================== --- config/pdp11/pdp11.opt (revision 264818) +++ config/pdp11/pdp11.opt (revision 264819) @@ -73,3 +73,7 @@ Target has split I&D. munix-asm Target RejectNegative Report Mask(UNIX_ASM) Negative(mdec-asm) Use UNIX assembler syntax. + +mlra +Target Report Mask(LRA) +Use LRA register allocator