From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sonicconh6001-vm2.mail.ssk.yahoo.co.jp (sonicconh6001-vm2.mail.ssk.yahoo.co.jp [182.22.37.11]) by sourceware.org (Postfix) with ESMTPS id B99803858D28 for ; Wed, 18 Jan 2023 05:43:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B99803858D28 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: FrNGoqQVM1mtKdM0S6445DiJyhppk_qJwIUE.Aw3rSgk23i1FJOrwPP9ZflfhJU LZYwCx0tkTmqorV7uPtLAse1ghrtTtfpfbKi5jmiVEtmWRltyEgN2Xcm1RK9Bwhk_2vq1.ZkwOhp eV8cHpqmAMvOHz7G3vJOyrFR2xsPs7l4Zbt_AvMwuRMf2R4GGtZyf6G5KJFA0G95ok64My5urrA3 oIFwLAaW8sY.SNe5vyZtwzysg8TZONxeeVhoOsKt1H3H9UQ6GzxOTY4G0ajQpNe6j37GA1vSmaT5 PfidoeMfatBctRvZMyCuaxvYb2EH8_zRXky6bDX3EuuPbcNi1j6ZnmIypGGPaoq_YayaNBmirdDH ckRPxaoEKeYE0O1sBs60kvdIVRKrdbn7yvM8_3YdysLjUzgc3oA7lTyWZSjfGLzwD3EFexOxW67V KC1lDQMuNlmmeVFnIuXcBJ7P3FBC._u1G_lVzPQK12LYYqf7a.RSzR5RVOzdJ24ifpGqJTNJIjxD 6iQkcQLe70pbN4JjX0Oj9fwB3z3DxVhVd5SathCnUQLPI7LgeTFStW_XKmSWnoWBEo0Rr7mV48lD iFDXEdksby4P4fwqGLxSQCBIk09qFH2t75QMlUnv9nkXerdEfvPOGyZyM1.ecZ3ds4_mtrXaTpjd FZ20UHtSdER8yQctDbKixmgHdMbh.El40.eLMM9YU40rZ9cdsQbsbk7zp6eJ9RhHlFxPM5wuzFrp CdsfreeqB9T30VawNa4B0sTaj0Q3.GcfCjGjLaRmmY37jiDDpeBAweno.YQoGnm7F7QELq39XS_q 836tTOEj2XQBbk1pAREu.uGH3P7XxUAQsRNnhiNHEMJ6rHE.XYItt2FUTHRROOmxrEKioplKlsRP 084cPFKhBIYdziNEtLCS6jfYfo2pNyNgz1bP2Uxxu.F5eDPDnKDVaEuoq1VbR9zLhgQsZkZ6QbBw gqbctorkM Received: from sonicgw.mail.yahoo.co.jp by sonicconh6001.mail.ssk.yahoo.co.jp with HTTP; Wed, 18 Jan 2023 05:43:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1674020600; s=yj20110701; d=yahoo.co.jp; h=Message-ID:Date:MIME-Version:To:Cc:From:Subject:Content-Type:Content-Transfer-Encoding:References; bh=lpNLXwP69MnhT17+J4mkkB0fUZ5hTbwcEgle1cD7OSI=; b=RFQRYcz3IslUCo8VzqGwD7HEZ1KC1pWqAVpq50XWNE0Z6n93MtsXqjoWLBTdMALp H/+3OC83+4YRwishYL+6e7Yz7vAz3pEPFqJZo4OIHC8/tBCO8jZJiBlz7G/39H4kcT0 Lv1DqI94p+VNqCd5GpGa589Knw1dJeGaMDZinpa4= 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=oNuXQuJiM9g2B9yY/dbLER25N+gxgPcurC3auXgfZFedhL7h3K5mbjakYriuh6b2 IQuqww4r39QXluQppB1UyeVFtKgGBSEBlgL/TAmMBD7uK4VsTcPa0xJ/KlIisLoYL6H PvuU6wsl09lG1stQ1fwNwXFI8InjyTmuUQpvs+g4=; Received: by smtphe5009.mail.kks.ynwp.yahoo.co.jp (YJ Hermes SMTP Server) with ESMTPA ID d640ce4a1a251aa6fa387146a492f244; Wed, 18 Jan 2023 14:43:15 +0900 (JST) Message-ID: <5ced9419-7984-6592-fc99-3bb37ad81bab@yahoo.co.jp> Date: Wed, 18 Jan 2023 14:43:13 +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] xtensa: Optimize inversion of the MSB Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit References: <5ced9419-7984-6592-fc99-3bb37ad81bab.ref@yahoo.co.jp> X-Spam-Status: No, score=-12.5 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: Such operation can be done either bitwise-XOR or addition with -2147483648, but the latter is one byte less if TARGET_DENSITY. gcc/ChangeLog: * config/xtensa/xtensa.md (xorsi3_internal): Rename from the original of "xorsi3". (xorsi3): New expansion pattern that emits addition rather than bitwise-XOR when the second source is a constant of -2147483648 if TARGET_DENSITY. --- gcc/config/xtensa/xtensa.md | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/gcc/config/xtensa/xtensa.md b/gcc/config/xtensa/xtensa.md index 0a477e711..4b5899a4c 100644 --- a/gcc/config/xtensa/xtensa.md +++ b/gcc/config/xtensa/xtensa.md @@ -736,7 +736,31 @@ (set_attr "mode" "SI") (set_attr "length" "3")]) -(define_insn "xorsi3" +(define_expand "xorsi3" + [(set (match_operand:SI 0 "register_operand") + (xor:SI (match_operand:SI 1 "register_operand") + (match_operand:SI 2 "nonmemory_operand")))] + "" +{ + if (register_operand (operands[2], SImode)) + emit_insn (gen_xorsi3_internal (operands[0], operands[1], + operands[2])); + else + { + rtx (*gen_op)(rtx, rtx, rtx); + if (TARGET_DENSITY + && CONST_INT_P (operands[2]) + && INTVAL (operands[2]) == -2147483648L) + gen_op = gen_addsi3; + else + gen_op = gen_xorsi3_internal; + emit_insn (gen_op (operands[0], operands[1], + force_reg (SImode, operands[2]))); + } + DONE; +}) + +(define_insn "xorsi3_internal" [(set (match_operand:SI 0 "register_operand" "=a") (xor:SI (match_operand:SI 1 "register_operand" "%r") (match_operand:SI 2 "register_operand" "r")))] -- 2.30.2