From patchwork Thu Nov 24 21:50:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 699016 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 3tPtDb073Vz9s2G for ; Fri, 25 Nov 2016 08:50:38 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="NNsqcxbX"; 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:from:date:message-id:subject:to:content-type; q= dns; s=default; b=OUt4enrPnx76CxrUjFGUa3E2JgFLy+aDR7n4+SYQMJx98U HQGBgiFe/Ag+FQ2tIGS6rdfwszUfDFjJk3H31g8gjfzfwQaY2Zzclen1LjgXSY1k 01NWufmcaSGfim5fClr0lE5NADJYZ6AaV2Es5JbUc23j/vTR8IMgKTMpKeoKU= 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:from:date:message-id:subject:to:content-type; s= default; bh=lLmBykPyZcX8sACBbuA66DyR+3E=; b=NNsqcxbXqg6zwrAFjgta H7d2ojSNWBKimVFFc0eNwTXgJjXPH1zfmb7+s3SkF2g/cQ2JW13d0lEBmvrVKeBE DzW6N3RahPGvDVzZHjyAuBiGdoOQbIc4ILLvxeTLqwKoQbRi8GbbHkfUDLDDTl0o mBAPAOYVqLOm5p4xjLmase8= Received: (qmail 109801 invoked by alias); 24 Nov 2016 21:50:29 -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 109791 invoked by uid 89); 24 Nov 2016 21:50:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=7th, risk X-HELO: mail-ua0-f182.google.com Received: from mail-ua0-f182.google.com (HELO mail-ua0-f182.google.com) (209.85.217.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 24 Nov 2016 21:50:19 +0000 Received: by mail-ua0-f182.google.com with SMTP id 12so59056748uas.2 for ; Thu, 24 Nov 2016 13:50:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=P59YM1gdrvuUYoXOSC9shlfz80S0UxrGB8er8ndLn3o=; b=MPegxzD+r9LLpCUkKhA+HS586H6aFs4ryTDo1v7gWe3Eg5DSKTKjWO5wis2MWjLKOT mUqnphthty/uFP3gK2BRGibzqMAKEZpUg+3LPO1kgcWP3w/laeuqCRxodSLkTXOXTj1o ZzsCdb2K7SrKmOyfF9ZmYhjhvwiQuzOllFwGE0ZclaDRCpS9/KpOBpi5OsldHJs7j91y wJqETzZlHNgjg01TP6CfkFMDbLiwDXpqB1AiLmDxKrNndhCEWEkAzupBg82fL9kT5M4l 78bFO8KMsB7SekqvI4c0YTe5aaA5CNrz385guDNH9AUv1wd01ppRhZNzyxXOqm9kOjPF C8Tw== X-Gm-Message-State: AKaTC00jBFkCYgLHjvIrp6AKPLEmCCYJk8N1uxILMqiMpFFqM+ImnHbZkPGud5WTt+SVZKv/9tFg2egxkDHeTg== X-Received: by 10.159.35.118 with SMTP id 109mr3616905uae.113.1480024215697; Thu, 24 Nov 2016 13:50:15 -0800 (PST) MIME-Version: 1.0 Received: by 10.103.83.67 with HTTP; Thu, 24 Nov 2016 13:50:15 -0800 (PST) From: Uros Bizjak Date: Thu, 24 Nov 2016 22:50:15 +0100 Message-ID: Subject: [PATCH, i386]: Use explicit mode macros on wide-insn splitters To: "gcc-patches@gcc.gnu.org" 2016-11-24 Uros Bizjak * config/i386/i386.md (wide AND insn to QImode splitter): Use explicit mode macros. (wide OR insn to QImode splitter): Ditto. Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}. Committed to mainline SVN. Uros. Index: i386.md =================================================================== --- i386.md (revision 242850) +++ i386.md (working copy) @@ -8625,14 +8625,13 @@ ;; of memory mismatch stalls. We may want to do the splitting for optimizing ;; for size, but that can (should?) be handled by generic code instead. (define_split - [(set (match_operand 0 "QIreg_operand") - (and (match_operand 1 "register_operand") - (match_operand 2 "const_int_operand"))) + [(set (match_operand:SWI248 0 "QIreg_operand") + (and:SWI248 (match_operand:SWI248 1 "register_operand") + (match_operand:SWI248 2 "const_int_operand"))) (clobber (reg:CC FLAGS_REG))] "reload_completed && (!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun)) - && !(~INTVAL (operands[2]) & ~(255 << 8)) - && GET_MODE (operands[0]) != QImode" + && !(~INTVAL (operands[2]) & ~(255 << 8))" [(parallel [(set (zero_extract:SI (match_dup 0) (const_int 8) (const_int 8)) (and:SI (zero_extract:SI (match_dup 1) (const_int 8) (const_int 8)) @@ -8647,15 +8646,14 @@ ;; Since AND can be encoded with sign extended immediate, this is only ;; profitable when 7th bit is not set. (define_split - [(set (match_operand 0 "any_QIreg_operand") - (and (match_operand 1 "general_operand") - (match_operand 2 "const_int_operand"))) + [(set (match_operand:SWI248 0 "any_QIreg_operand") + (and:SWI248 (match_operand:SWI248 1 "general_operand") + (match_operand:SWI248 2 "const_int_operand"))) (clobber (reg:CC FLAGS_REG))] "reload_completed && (!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun)) && !(~INTVAL (operands[2]) & ~255) - && !(INTVAL (operands[2]) & 128) - && GET_MODE (operands[0]) != QImode" + && !(INTVAL (operands[2]) & 128)" [(parallel [(set (strict_low_part (match_dup 0)) (and:QI (match_dup 1) (match_dup 2))) @@ -9020,15 +9018,19 @@ (set_attr "length_immediate" "0") (set_attr "mode" "QI")]) +;; Convert wide OR instructions with immediate operand to shorter QImode +;; equivalents when possible. +;; Don't do the splitting with memory operands, since it introduces risk +;; of memory mismatch stalls. We may want to do the splitting for optimizing +;; for size, but that can (should?) be handled by generic code instead. (define_split - [(set (match_operand 0 "QIreg_operand") - (any_or (match_operand 1 "register_operand") - (match_operand 2 "const_int_operand"))) + [(set (match_operand:SWI248 0 "QIreg_operand") + (any_or:SWI248 (match_operand:SWI248 1 "register_operand") + (match_operand:SWI248 2 "const_int_operand"))) (clobber (reg:CC FLAGS_REG))] "reload_completed && (!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun)) - && !(INTVAL (operands[2]) & ~(255 << 8)) - && GET_MODE (operands[0]) != QImode" + && !(INTVAL (operands[2]) & ~(255 << 8))" [(parallel [(set (zero_extract:SI (match_dup 0) (const_int 8) (const_int 8)) (any_or:SI (zero_extract:SI (match_dup 1) (const_int 8) (const_int 8)) @@ -9043,15 +9045,14 @@ ;; Since OR can be encoded with sign extended immediate, this is only ;; profitable when 7th bit is set. (define_split - [(set (match_operand 0 "any_QIreg_operand") - (any_or (match_operand 1 "general_operand") - (match_operand 2 "const_int_operand"))) + [(set (match_operand:SWI248 0 "any_QIreg_operand") + (any_or:SWI248 (match_operand:SWI248 1 "general_operand") + (match_operand:SWI248 2 "const_int_operand"))) (clobber (reg:CC FLAGS_REG))] "reload_completed && (!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun)) && !(INTVAL (operands[2]) & ~255) - && (INTVAL (operands[2]) & 128) - && GET_MODE (operands[0]) != QImode" + && (INTVAL (operands[2]) & 128)" [(parallel [(set (strict_low_part (match_dup 0)) (any_or:QI (match_dup 1) (match_dup 2)))