From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9767 invoked by alias); 23 Oct 2017 17:10:42 -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 9747 invoked by uid 89); 23 Oct 2017 17:10:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.0 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3,KAM_ASCII_DIVIDERS,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=026 X-HELO: mail-wm0-f53.google.com Received: from mail-wm0-f53.google.com (HELO mail-wm0-f53.google.com) (74.125.82.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 23 Oct 2017 17:10:40 +0000 Received: by mail-wm0-f53.google.com with SMTP id u138so11225521wmu.4 for ; Mon, 23 Oct 2017 10:10:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:mail-followup-to:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=mvUrg+JvavuoIHbgMg9emGoStXJHuIc3C2vOx/W98TA=; b=II67b4MEEqOjfbPJDndnkAuBbb7phmX4cDI3zrkPvuBWoHaBP0/Ll2u2gmq8kqJys0 I7ocP51k/eNu2LT8EZ9F2z9GW6bsL2DEteuiTx9TMG1oMoVWM1uRlSRBqkQUrn1MeVfj W3+cQBuEibNxhZxvnxI3MteJabvE1Bahb/ZNJuUXbnblJeggHUSCiq8HKA2TmlLo7/Vm 31eQtfsU1/vpdVzLRwMI/G78G2KGA8Dhonv/f0NGG1GFyhhOHj3dyESkF5xlF57Kczhl cDywXLiFmPSwroOzPYKwmPwOMxl/rwfZVIXVncjAN57vw1ZIEHVkkdpeMTKDtdfedXDa PyCg== X-Gm-Message-State: AMCzsaXIMdHLLPXTVUiwgWDZig3AmXpg4NYHEmRWSRZRMbyYOQqRv/QE 91DTITARiyAgWcFXb+NOOH2C9fd435g= X-Google-Smtp-Source: ABhQp+Qgxtwp7AIC/Cu+/1jBX8Nr7wLt11Dw2pdCqYAP7tohOvN9aD/RvbFddCY/XpQiwS3HkPkjog== X-Received: by 10.28.193.136 with SMTP id r130mr3394445wmf.141.1508778637409; Mon, 23 Oct 2017 10:10:37 -0700 (PDT) Received: from localhost ([2.26.27.199]) by smtp.gmail.com with ESMTPSA id s67sm5344361wmd.23.2017.10.23.10.10.36 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Oct 2017 10:10:36 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: [026/nnn] poly_int: operand_subword References: <871sltvm7r.fsf@linaro.org> Date: Mon, 23 Oct 2017 17:11:00 -0000 In-Reply-To: <871sltvm7r.fsf@linaro.org> (Richard Sandiford's message of "Mon, 23 Oct 2017 17:54:32 +0100") Message-ID: <87r2ttpz77.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2017-10/txt/msg01527.txt.bz2 This patch makes operand_subword and operand_subword_force take polynomial offsets. This is a fairly old-school interface and these days should only be used when splitting multiword operations into word operations. It still doesn't hurt to support polynomial offsets and it helps make callers easier to write. 2017-10-23 Richard Sandiford Alan Hayward David Sherwood gcc/ * rtl.h (operand_subword, operand_subword_force): Take the offset as a poly_uint64 an unsigned int. * emit-rtl.c (operand_subword, operand_subword_force): Likewise. Index: gcc/rtl.h =================================================================== --- gcc/rtl.h 2017-10-23 17:16:50.374527737 +0100 +++ gcc/rtl.h 2017-10-23 17:16:55.754801166 +0100 @@ -3017,10 +3017,10 @@ extern rtx gen_lowpart_if_possible (mach /* In emit-rtl.c */ extern rtx gen_highpart (machine_mode, rtx); extern rtx gen_highpart_mode (machine_mode, machine_mode, rtx); -extern rtx operand_subword (rtx, unsigned int, int, machine_mode); +extern rtx operand_subword (rtx, poly_uint64, int, machine_mode); /* In emit-rtl.c */ -extern rtx operand_subword_force (rtx, unsigned int, machine_mode); +extern rtx operand_subword_force (rtx, poly_uint64, machine_mode); extern int subreg_lowpart_p (const_rtx); extern poly_uint64 subreg_size_lowpart_offset (poly_uint64, poly_uint64); Index: gcc/emit-rtl.c =================================================================== --- gcc/emit-rtl.c 2017-10-23 17:16:50.363529222 +0100 +++ gcc/emit-rtl.c 2017-10-23 17:16:55.754801166 +0100 @@ -1736,7 +1736,8 @@ subreg_lowpart_p (const_rtx x) */ rtx -operand_subword (rtx op, unsigned int offset, int validate_address, machine_mode mode) +operand_subword (rtx op, poly_uint64 offset, int validate_address, + machine_mode mode) { if (mode == VOIDmode) mode = GET_MODE (op); @@ -1745,12 +1746,12 @@ operand_subword (rtx op, unsigned int of /* If OP is narrower than a word, fail. */ if (mode != BLKmode - && (GET_MODE_SIZE (mode) < UNITS_PER_WORD)) + && may_lt (GET_MODE_SIZE (mode), UNITS_PER_WORD)) return 0; /* If we want a word outside OP, return zero. */ if (mode != BLKmode - && (offset + 1) * UNITS_PER_WORD > GET_MODE_SIZE (mode)) + && may_gt ((offset + 1) * UNITS_PER_WORD, GET_MODE_SIZE (mode))) return const0_rtx; /* Form a new MEM at the requested address. */ @@ -1784,7 +1785,7 @@ operand_subword (rtx op, unsigned int of MODE is the mode of OP, in case it is CONST_INT. */ rtx -operand_subword_force (rtx op, unsigned int offset, machine_mode mode) +operand_subword_force (rtx op, poly_uint64 offset, machine_mode mode) { rtx result = operand_subword (op, offset, 1, mode);