From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omggw0021.mail.otm.yahoo.co.jp (omggw0021.mail.otm.yahoo.co.jp [182.22.18.37]) by sourceware.org (Postfix) with ESMTPS id 5C26B3858D39 for ; Sat, 1 Jul 2023 17:21:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5C26B3858D39 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: IUtn1.oVM1nkuot3CGXVd2V.UpnzaFPj3fGmPsqRD5fMJv2U03dqJefqG_GHzCe EwyGjAdV9WbA4L2baKusvsruCAH_vP.6g2RB0Oz.OOcFJwJ60VheeG4bpp1TSDUp3D0.ccAnoTfI CtH99brzQHXxCi4g5eI9dC69GVBYzLDYe2L_UCoA3AVbBJIYxsBxfdh9YqTkIKNHsDU2aJrcexLD O7KCzCv5zOAmrYfdm4id9hlCtlrCeo2rBzMCyEDOQoV.TIHFUUMZsNfiOfglEYUvCoKn4oDVbf_x JBztdCN5gxmsy6aw_KsFauJNO6t4CD7ZSmH7q08Wn22faMGNcRFNSRYqX10fvwYMSycT7PhrqZGJ vXSOExh.C1o3H.QWZrSEjE0wU9WI48PouQG1nhECEyegROZqd.VNXZRgjkHttRaJwSiTjtdOe4S. Yr3nclBWOuL8b8jADhjDj2sEp24fd1C6Up3RL7rO53eGkkfKY.GU1GUnEkvFbTiLT5kXrjOgqrLl lPSHuDItSlhaCSMCuym9O4Cy_pVq6p_PXeDBrL9Grqa.DGKe0qVpAKwpSwzOQg1TTLrc5YDlpamY 456hSnLi3rpJBZUO1A48XXWnqtjCVZOwrJRawBXMSof34bBjV3uR5OkkCJSuAUoHD48bn5rzde6l 4BING4OUxPPWTHh6Ihv_xGGO.3oXbCT513rL6AsO67JwSlUGEgik1TCuwKPp8womFFpzSMiTS1_B _ZV1_hymnEfL5rn_BOZdvEYI891l3J7CZ3U9E4wK5YpS0maIHhVKDoCdbpua3M1e6dEGNjs0HOel Mlg8E79uHM5ece1J4.q7uS9d0aCxc76r5ekt96eJwd0KvNdzSGopeknZ9QdSDQi1QwtccMAQRqtD SVcDQL4a.AHXzOmpa43v_bOewMUgC3ZPbhyaXbiflmvLe9hV8c91_5F5YpI1IysQ4xvA3Ej3JGqr 17C6CQqTyxVZjRaca.BmgCRemjaqI3QUhUR7GSfq_feonPu54q3XTj5viOLtaKm8AFA-- Received: from sonicgw.mail.yahoo.co.jp by sonicconh6003.mail.ssk.yahoo.co.jp with HTTP; Sat, 1 Jul 2023 17:21:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1688232078; s=yj20110701; d=yahoo.co.jp; h=Message-ID:Date:MIME-Version:To:Cc:From:Subject:Content-Type:Content-Transfer-Encoding:References; bh=AneKbtzJcO6N4sr7WUjgPd0cSDk+pz+lAFVbqSKlMvY=; b=Kz5nQKds/PaklvoQR16JkM4jA4U2nPFLzyBFTK69ZfXPEVMzI5XTT/KBsN02RQDA dHygQ3m6Xq19+B7t1OMcL24SWkO5sHXI0Be2h0xksotYUHNhCqjlhZLBTSMGf3lmxAw OABPf30H5JlHqLC4Iw5Bfm67TQU51fOOmNFje250= 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=fYTfvkJ2zQcRbpZa0FWkM85OI2JwH2BH11Hv0SCxsbj9pOOG01BXsH4/bsAhIepJ 7yHflIv37Q0c0rG9PWr8yJTVk2UvsQ1Ndcw+HSjgCskOQlygXDer/tAv1JyXCO1mf1X G02wr23qJ1Eezo2cqBXzIJ66qFyFkwm7cWEy4hAQ=; Received: by smtphe6005.mail.ssk.ynwp.yahoo.co.jp (YJ Hermes SMTP Server) with ESMTPA ID ed106e3c87e8a8e38d4dfe23d04cb3ae; Sun, 02 Jul 2023 02:21:13 +0900 (JST) Message-ID: Date: Sun, 2 Jul 2023 02:20:08 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 To: GCC Patches Cc: Max Filippov From: Takayuki 'January June' Suwa Subject: [PATCH 2/2] xtensa: The use of CLAMPS instruction also requires TARGET_MINMAX, as well as TARGET_CLAMPS Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit References: X-Spam-Status: No, score=-13.0 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,T_SCC_BODY_TEXT_LINE 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: Because both smin and smax requiring TARGET_MINMAX are essential to the RTL representation. gcc/ChangeLog: * config/xtensa/xtensa.cc (xtensa_match_CLAMPS_imms_p): Simplify. * config/xtensa/xtensa.md (*xtensa_clamps): Add TARGET_MINMAX to the condition. --- gcc/config/xtensa/xtensa.cc | 7 ++----- gcc/config/xtensa/xtensa.md | 4 ++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/gcc/config/xtensa/xtensa.cc b/gcc/config/xtensa/xtensa.cc index dd35e63c094..3298d53493c 100644 --- a/gcc/config/xtensa/xtensa.cc +++ b/gcc/config/xtensa/xtensa.cc @@ -2649,11 +2649,8 @@ xtensa_emit_add_imm (rtx dst, rtx src, HOST_WIDE_INT imm, rtx scratch, bool xtensa_match_CLAMPS_imms_p (rtx cst_max, rtx cst_min) { - int max, min; - - return IN_RANGE (max = exact_log2 (-INTVAL (cst_max)), 7, 22) - && IN_RANGE (min = exact_log2 (INTVAL (cst_min) + 1), 7, 22) - && max == min; + return IN_RANGE (exact_log2 (-INTVAL (cst_max)), 7, 22) + && (INTVAL (cst_max) + INTVAL (cst_min)) == -1; } diff --git a/gcc/config/xtensa/xtensa.md b/gcc/config/xtensa/xtensa.md index b1af08eba8a..664424f1239 100644 --- a/gcc/config/xtensa/xtensa.md +++ b/gcc/config/xtensa/xtensa.md @@ -522,7 +522,7 @@ (smax:SI (smin:SI (match_operand:SI 1 "register_operand" "r") (match_operand:SI 2 "const_int_operand" "i")) (match_operand:SI 3 "const_int_operand" "i")))] - "TARGET_CLAMPS + "TARGET_MINMAX && TARGET_CLAMPS && xtensa_match_CLAMPS_imms_p (operands[3], operands[2])" "#" "&& 1" @@ -540,7 +540,7 @@ (smin:SI (smax:SI (match_operand:SI 1 "register_operand" "r") (match_operand:SI 2 "const_int_operand" "i")) (match_operand:SI 3 "const_int_operand" "i")))] - "TARGET_CLAMPS + "TARGET_MINMAX && TARGET_CLAMPS && xtensa_match_CLAMPS_imms_p (operands[2], operands[3])" { static char result[64]; -- 2.30.2