From patchwork Tue May 5 09:36:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 1283394 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=FPy5yYEN; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49GZNk4Wxxz9sSs for ; Tue, 5 May 2020 19:36:21 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 38364388E825; Tue, 5 May 2020 09:36:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 38364388E825 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1588671379; bh=fVj8ghPEyoLJTI6U/NTTKhECMVacGAOkBGClMwxq6V0=; h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=FPy5yYENDk643IoGUyggMy/rB1A41UUyp5amtN7WU1pAfey45XhYvmNr+osnxM7DL M3r3Awzdcm/bEhSAvUImRuLWpe0R7iZ+A3TaOi181E2p0ANIgfR7Vji5MG2hAaDuAb tMUwDt289C+DHsW5BvO5kEWDCq70cIC3ZYaAA+1E= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-io1-xd35.google.com (mail-io1-xd35.google.com [IPv6:2607:f8b0:4864:20::d35]) by sourceware.org (Postfix) with ESMTPS id C1590388E81A for ; Tue, 5 May 2020 09:36:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C1590388E81A Received: by mail-io1-xd35.google.com with SMTP id k6so858142iob.3 for ; Tue, 05 May 2020 02:36:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=fVj8ghPEyoLJTI6U/NTTKhECMVacGAOkBGClMwxq6V0=; b=JSfdyuIYXk70MIQEtUc8JGHp61DTlpIvBrhZbgyQDdWF4nezLFEIoJWLYYXua44Crd +UE2MR9uVuUheLHCcrAczyjChy84zpl+smmhsAStOOeSwub2rcHsUgiG78cYmvAbQ0pM dweCZ8JzQlbYhAED8lHyPhVWKDwab7CGHgStGxkHxObHhL5Oi+09sPF8nF5OqsEp+v8J nu4DNW6/1gJqQTA0rZeUB2Oo3xJbS8Va1BhKPxiykopgybbtJ/6d4vjwIOfdsfoOzvWp uD2P6sYrKryAzbObCOH9D8NPwnshrhC7YnrMTKkhK+8pqq4aUXsuiNyTB8XUth0fyVfG AdqA== X-Gm-Message-State: AGi0PuZc11Iqmn1Pd5EB+ezHz5VyyLk4yLadbnQUETQxUEEffeBMzMpZ W6uYnR6W2zaz72fpEVW7o1he4NE4dFuB720L2xWC6fUYIRQ= X-Google-Smtp-Source: APiQypKziRR3DjIOickhCj/N0zh6UvrlIB63d7ScVQ3Gez+h7eczqv3wfQijk1SaV1ldbVRhhDgbfxme/U2OJMxnWhY= X-Received: by 2002:a02:c998:: with SMTP id b24mr2591142jap.23.1588671374984; Tue, 05 May 2020 02:36:14 -0700 (PDT) MIME-Version: 1.0 Date: Tue, 5 May 2020 11:36:03 +0200 Message-ID: Subject: [committed] i386: Use int_nonimmediate_operand more To: "gcc-patches@gcc.gnu.org" X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Uros Bizjak via Gcc-patches From: Uros Bizjak Reply-To: Uros Bizjak Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Pattern explosing and manual mode checks can be avoided by using int_nonimmediate_operand special predicate. While there, rewrite *x86_movcc_0_m1_neg_leu to a combine pass splitter. 2020-05-05 Uroš Bizjak * config/i386/i386.md (*testqi_ext_3): Use int_nonimmediate_operand instead of manual mode checks. (*x86_movcc_0_m1_neg_leu): Use int_nonimmediate_operand predicate. Rewrite define_insn_and_split pattern to a combine pass splitter. Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}. Committed to mainline. Uros. diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 76c00867231..5cad481fd9f 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -8714,16 +8714,12 @@ [(set (match_operand 0 "flags_reg_operand") (match_operator 1 "compare_operator" [(zero_extract:SWI248 - (match_operand 2 "nonimmediate_operand" "rm") + (match_operand 2 "int_nonimmediate_operand" "rm") (match_operand 3 "const_int_operand" "n") (match_operand 4 "const_int_operand" "n")) (const_int 0)]))] - "((TARGET_64BIT && GET_MODE (operands[2]) == DImode) - || GET_MODE (operands[2]) == SImode - || GET_MODE (operands[2]) == HImode - || GET_MODE (operands[2]) == QImode) - /* Ensure that resulting mask is zero or sign extended operand. */ - && INTVAL (operands[4]) >= 0 + "/* Ensure that resulting mask is zero or sign extended operand. */ + INTVAL (operands[4]) >= 0 && ((INTVAL (operands[3]) > 0 && INTVAL (operands[3]) + INTVAL (operands[4]) <= 32) || (mode == DImode @@ -18038,18 +18034,15 @@ (set_attr "mode" "") (set_attr "length_immediate" "0")]) -(define_insn_and_split "*x86_movcc_0_m1_neg_leu" - [(set (match_operand:SWI48 0 "register_operand" "=r") +(define_split + [(set (match_operand:SWI48 0 "register_operand") (neg:SWI48 (leu:SWI48 - (match_operand:SWI 1 "nonimmediate_operand" "m") - (match_operand:SWI 2 "" "")))) - (clobber (reg:CC FLAGS_REG))] - "CONST_INT_P (operands[2]) + (match_operand 1 "int_nonimmediate_operand") + (match_operand 2 "const_int_operand"))))] + "x86_64_immediate_operand (operands[2], VOIDmode) && INTVAL (operands[2]) != -1 && INTVAL (operands[2]) != 2147483647" - "#" - "" [(set (reg:CC FLAGS_REG) (compare:CC (match_dup 1) (match_dup 2))) (parallel [(set (match_dup 0) (neg:SWI48 (ltu:SWI48 (reg:CC FLAGS_REG) (const_int 0))))