From patchwork Thu Jan 5 19:17:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 711554 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 3tvcsP4d08z9s2Q for ; Fri, 6 Jan 2017 06:18:16 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="ib5mRaWy"; dkim-atps=neutral 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:in-reply-to:references:from:date:message-id :subject:to:content-type; q=dns; s=default; b=OP7roibGRQRsg5Dsyv s1HigV1M94YDCsp2oIRSa7Gle3+y+Z+D7Cd0KQVJwNfydzqFBeR2563yzZcrAWOP +9r8x5jr+rWpJ9VVu/Z7jztL0H89ZcYpP016616RPtQM23xmpeMjYM33f/1ypYmN L/CS1m5XqkMSd4AdP3Gj8Ktw0= 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:in-reply-to:references:from:date:message-id :subject:to:content-type; s=default; bh=YJbpaZoWdOasgFUx0GGOpGmE t/U=; b=ib5mRaWySLHmGxcPtZez2boVDBkhw7Fc7kn55uEE0bRZsGT/QiUufzTW 7PUg0eeorK4GtDvpM7NOlhDllrfGU/CCxxl3cyr/ONSbGKdTMWytAsvRNbGQZbjU KdenZp2gNyEl+AQ3MXn6D8j/Em2Tiqzs3KqaenjTqnrHXYl3LEI= Received: (qmail 74562 invoked by alias); 5 Jan 2017 19:18:05 -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 74545 invoked by uid 89); 5 Jan 2017 19:18:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=no version=3.3.2 spammy=assured, sk:GET_MOD, sk:get_mod, H*MI:sk:CAFULd4 X-HELO: mail-ua0-f169.google.com Received: from mail-ua0-f169.google.com (HELO mail-ua0-f169.google.com) (209.85.217.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 05 Jan 2017 19:17:54 +0000 Received: by mail-ua0-f169.google.com with SMTP id y9so56540891uae.2 for ; Thu, 05 Jan 2017 11:17:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=uW5sAIX8pj+Fb/z0AjGiEvvhoYDx11//O44Ekjp8JJ0=; b=fXrfqix3Ubeyx2UyMrIOByAcF/lMI+YSOwK3zDxywuL2nUGK5iRztMicgvLRWPUt1k NLib6DiZScUSKBmBqs93Bb+wubcofAZQwABdVocnUdbsq8LQtJs57G460P9ltseJ+aFA fwF4v4LM1OjPvY1tWDi6a6j6FOGwA4oEP+TCdAwb4OpBYX2Nije7hLOYoWfo56Mwww29 xFxWkr8oq+uU98iTv9cy2+cyswBgzNrjBHieeewq7oheK1uGswiwxY6A9e6MdIsvGIcF /Aap2SHVhSW4d1RBT5Yr75AX3/DP5hWKbTjmyXui6nrTwlTES73rpVQBd/91sFnrY7j0 XCTA== X-Gm-Message-State: AIkVDXIunWmLNUms9POvjckvhBp7VOUdvUqtyXxDmlIOPfUZp4nyrd2YUXgPVTzy12aeBv7ZP+1O21JmCb7eHg== X-Received: by 10.159.35.52 with SMTP id 49mr4551271uae.113.1483643872408; Thu, 05 Jan 2017 11:17:52 -0800 (PST) MIME-Version: 1.0 Received: by 10.103.87.11 with HTTP; Thu, 5 Jan 2017 11:17:51 -0800 (PST) In-Reply-To: References: From: Uros Bizjak Date: Thu, 5 Jan 2017 20:17:51 +0100 Message-ID: Subject: Fwd: [PATCH, i386]: Remove special handling of memory operands from *testqi_ext_3 To: "gcc-patches@gcc.gnu.org" Hello! It turned out that recent changes made special handling of memory operands in *testqi_ext_3 obsolete. Combine now always pass correct width of memory operands for the extraction, as assured by added assert. 2017-01-05 Uros Bizjak * config/i386/i386.md (*testqi_ext_3): No need to handle memory operands in a special way. Assert that pos+len <= mode precision. Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}. Committed to mainline SVN. Uros. Index: i386.md =================================================================== --- i386.md (revision 244058) +++ i386.md (working copy) @@ -8007,36 +8007,30 @@ rtx val = operands[2]; HOST_WIDE_INT len = INTVAL (operands[3]); HOST_WIDE_INT pos = INTVAL (operands[4]); - machine_mode mode, submode; + machine_mode mode = GET_MODE (val); - mode = GET_MODE (val); - if (MEM_P (val)) + if (SUBREG_P (val)) { - /* ??? Combine likes to put non-volatile mem extractions in QImode - no matter the size of the test. So find a mode that works. */ - if (! MEM_VOLATILE_P (val)) + machine_mode submode = GET_MODE (SUBREG_REG (val)); + + /* Narrow paradoxical subregs to prevent partial register stalls. */ + if (GET_MODE_BITSIZE (mode) > GET_MODE_BITSIZE (submode) + && GET_MODE_CLASS (submode) == MODE_INT) { - mode = smallest_mode_for_size (pos + len, MODE_INT); - val = adjust_address (val, mode, 0); + val = SUBREG_REG (val); + mode = submode; } } - else if (SUBREG_P (val) - && (submode = GET_MODE (SUBREG_REG (val)), - GET_MODE_BITSIZE (mode) > GET_MODE_BITSIZE (submode)) - && pos + len <= GET_MODE_BITSIZE (submode) - && GET_MODE_CLASS (submode) == MODE_INT) + + /* Small HImode tests can be converted to QImode. */ + if (register_operand (val, HImode) && pos + len <= 8) { - /* Narrow a paradoxical subreg to prevent partial register stalls. */ - mode = submode; - val = SUBREG_REG (val); - } - else if (mode == HImode && pos + len <= 8) - { - /* Small HImode tests can be converted to QImode. */ + val = gen_lowpart (QImode, val); mode = QImode; - val = gen_lowpart (QImode, val); } + gcc_assert (pos + len <= GET_MODE_PRECISION (mode)); + wide_int mask = wi::shifted_mask (pos, len, false, GET_MODE_PRECISION (mode));