From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sonicconh6003-vm1.mail.ssk.yahoo.co.jp (sonicconh6003-vm1.mail.ssk.yahoo.co.jp [182.22.37.42]) by sourceware.org (Postfix) with ESMTPS id E2C423858D35 for ; Thu, 12 Jan 2023 04:26:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E2C423858D35 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=yahoo.co.jp Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=yahoo.co.jp X-YMail-OSG: 8HmTiskVM1nigenpg1fdNph_BLWZ4YDnpieAX1jsrGVniCXCzji758C4Z05.r4i uAOJxTI7MboogQuhw2DdHSzEUwI2jFDO1iLE6ZTSzh5bV6reVjjtcjtcnFlD9mqRnJq_xP6BiJax Rum5NrqMQFTw0hxhx5ibTNPROnLvo2gDPGgSTlIlwSf2Ciq1mgARnxwJZmH7J5D0vSC1bZRH96N7 hklBo9yo7LwjAzr1.82q49iijIimAqeEsb0omJvDfTwzJJPFzu2zxUnuZE1BgeB0cDGjjPtG9rAQ cl0HWmDjFlSzwfaXrTnsh6zgHKqUeI1rRHRR_lSbUku.6XE.wkEs2ApujGejQN2tU0ZVTfJWzJlN VrLgbK8Pn.EYIEv.4KJinxgqrJbZMVFTUqPUrOOmpvnaLvP1i.0.E0iEVfeFxUkyA8E_Pz16Z.2J hhgK9DTIXjCL3P0tZXA7VYBLF54ZQWg6L0au1na2nhc7kC2UaluRhdNKy1EuCGwNhPzM_FgClQdy Wvc8OYwzUo.P7XwyHc.gGlVqU3k6ZtI5HB07V5op59jqswE0.xIbMcBEvFMvaxIGvVBo8HxGBEf5 TaruOErPEmW1ah2ychTO3Ar_RdnI4dVDtyOliZjQ_faTKDRIQGNjnbhbiiNzQTgnqq6K8yT3xWE2 ITVTa7HErQGCBXoFAQKvra2K_tb66uBx8AV8R5jporZPhkhKG.Q2roHqPCgXTw5gQ80wXRiLcES1 3I9LKnAIcuo._musWY1fvF31EOPNpXHcHXTji_jbu3nCOckW_Lk1Tcvx8VHbr8UVOKLZrS7E_O62 UZtnZHrVr7oN5j2mWQ.nKzwYyXCO0DFas0TuuNwQb5SlhFBMWAKGv7QE3EC7Rmub3MEKXwWcgd.N 1_0EmMzy.UFdRRgeT_ZAVONEim7rbL4ffdMuAy_AfNY83nUOS6ZiqOUk26FmRv51bWndtzOWmq1W RqkjXmik- Received: from sonicgw.mail.yahoo.co.jp by sonicconh6003.mail.ssk.yahoo.co.jp with HTTP; Thu, 12 Jan 2023 04:26:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1673497563; s=yj20110701; d=yahoo.co.jp; h=Message-ID:Date:MIME-Version:To:Cc:From:Subject:Content-Type:Content-Transfer-Encoding:References; bh=gMIMU6u2vBNKV4S0qFnjbdmWlR+TtB8QmkNIxWgtggo=; b=V5t6/FkNV/Aa5FaC9DoVJAG0HKTShAz1q8k0s4XtyKfrhZjXgfpjcEoLO/qHOLdt 9gKYRhBdhO2OzTOjziBtVvN0JKFG4bvOIWORcJs1ag3DwfUSPYsbBkAZrpiPOH4Bd+u KfIaPuhJiDk8NII01XTnshFKoOp8n5M5gQCusgSs= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=yj20110701; d=yahoo.co.jp; h=Message-ID:Date:MIME-Version:Cc:From:Content-Type:Content-Transfer-Encoding:References; b=kbeOJqhHRZy5NF9x9H1QQE5tpO7h6FyFJatOEqC5hC7SxGLqJlha+JYCOYF9ehaQ /Uup9P6zGUW6MJXAsD3X+xOy9QaOMg1U2jnXwNHpjs4D/QsGwRadO6c6woQa6kibEwv HBcLvgLhTB0N0X905IIbny30F/Jrt2qhfuYyKQdE=; Received: by smtphe5001.mail.kks.ynwp.yahoo.co.jp (YJ Hermes SMTP Server) with ESMTPA ID 3de18a13078614ebaf115c7a15cb6cd7; Thu, 12 Jan 2023 13:25:59 +0900 (JST) Message-ID: <92692f27-76e3-ce45-bc25-95b9a7d2b64f@yahoo.co.jp> Date: Thu, 12 Jan 2023 13:25:58 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 To: GCC Patches Cc: Max Filippov From: Takayuki 'January June' Suwa Subject: [PATCH 1/2] xtensa: Tune "*btrue" insn pattern Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit References: <92692f27-76e3-ce45-bc25-95b9a7d2b64f.ref@yahoo.co.jp> X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: This branch instruction has short encoding if EQ/NE comparison against immediate zero when the Code Density Option is enabled, but its "length" attribute was only for normal encoding. This patch fixes it. This patch also prevents undesireable replacement the comparison immediate zero of the instruction (short encoding, as mentioned above) with a register that has value of zero (normal encoding) by the postreload pass. gcc/ChangeLog: * config/xtensa/xtensa.md (*btrue): Correct value of the attribute "length" that depends on TARGET_DENSITY and operands, and add '?' character to the register constraint of the compared operand. --- gcc/config/xtensa/xtensa.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gcc/config/xtensa/xtensa.md b/gcc/config/xtensa/xtensa.md index db1d68ee658..b4989832169 100644 --- a/gcc/config/xtensa/xtensa.md +++ b/gcc/config/xtensa/xtensa.md @@ -1679,7 +1679,7 @@ [(set (pc) (if_then_else (match_operator 3 "branch_operator" [(match_operand:SI 0 "register_operand" "r,r") - (match_operand:SI 1 "branch_operand" "K,r")]) + (match_operand:SI 1 "branch_operand" "K,?r")]) (label_ref (match_operand 2 "" "")) (pc)))] "" @@ -1688,7 +1688,14 @@ } [(set_attr "type" "jump,jump") (set_attr "mode" "none") - (set_attr "length" "3,3")]) + (set (attr "length") + (if_then_else (match_test "TARGET_DENSITY + && CONST_INT_P (operands[1]) + && INTVAL (operands[1]) == 0 + && (GET_CODE (operands[3]) == EQ + || GET_CODE (operands[3]) == NE)") + (const_int 2) + (const_int 3)))]) (define_insn "*ubtrue" [(set (pc) -- 2.30.2