From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by sourceware.org (Postfix) with ESMTPS id A297A3858C41 for ; Fri, 19 May 2023 16:33:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A297A3858C41 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-64d293746e0so1878299b3a.2 for ; Fri, 19 May 2023 09:33:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684514016; x=1687106016; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=pmgdrZy+cn/XY5ezck/Gl0ltqD0XaDjSi/1d9Uw7a+I=; b=BAYA7TDdRdpR9zVvtJRWWaQdfn3pUSNgDcLQyNAPFteYigoGB4ZNyTMU7wWzfNHUno k9XpwYsoEKHqErnS5YQHB9bZRggPS53NJXU7ZWq+5Fu3vZE1yzjQwEhuT3Oomya7roeu ECVAf9Av1ucOk0QebnsQ3tP0yES+7GDNVbPa/Q2v13JIWfyu+YlGblK71dcWF0PM6k02 lJtH8eRNoBGn6iVGJS1ud/vRrrxFykOYSyCWSEhvXGPEBcfNSYohwJnusxEKsd6BJD+V /Oem7nOQrVaXlW41oJE2Maz7pqR53vOQDMWoB6j7DFEl+sSruizKQG0cNX6JmxUazsZR MxAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684514016; x=1687106016; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=pmgdrZy+cn/XY5ezck/Gl0ltqD0XaDjSi/1d9Uw7a+I=; b=Th9ZAZS51zUllk06E/+6fcqq3ai9I/nWowG59LslqHsDgmyLJuc9asenX47ko42ixE rlOnCOWugezgXerLtF6Qtjx7BxSjkhuVh9Y/uUkHnAB8givvs1baLZcuxRBxMkfd8nzv uEBqyiHCK5C6DHRhIVNhsPo08GsF3XIsl02BEvQ66P2XixhD3IXj22/n6U51boA7V1Mi yUra+YV+E9jL/Lx8p6gCZeMjCX3KUEfTC1VskRe+HI10DYpPXG6/jC5xbxklGBtjnPD3 dAVx62eiYipqQlP9N+evNaMXzo2D399V8QwqbN2azTTx0n0QpRol5SGamOW7w2t4NQPc 1olA== X-Gm-Message-State: AC+VfDwYqaF4Dqqik4EY3IJ2M1m9eIlmWqyzUAeCozsiXDfGGN4+zMYx TMhjatk8AdsYzqhkUDZYgBQ= X-Google-Smtp-Source: ACHHUZ7iPbYt7P8t6ZWWgLO7U/uYvdlRuVpXi6I0yXp+hZ0Wc1OBiI2a/gscPz9odQge5M/ZyvMpHQ== X-Received: by 2002:a05:6a00:2d28:b0:64a:f730:154b with SMTP id fa40-20020a056a002d2800b0064af730154bmr4099440pfb.5.1684514016219; Fri, 19 May 2023 09:33:36 -0700 (PDT) Received: from ?IPV6:2601:681:8d00:265::f0a? ([2601:681:8d00:265::f0a]) by smtp.gmail.com with ESMTPSA id c21-20020aa78c15000000b0063d2bb0d10asm3184510pfd.113.2023.05.19.09.33.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 19 May 2023 09:33:35 -0700 (PDT) Message-ID: Date: Fri, 19 May 2023 10:33:34 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: [PATCH] RISC-V: improve codegen for large constants with same 32-bit lo and hi parts [2] Content-Language: en-US To: Vineet Gupta , gcc-patches@gcc.gnu.org Cc: kito.cheng@gmail.com, Palmer Dabbelt , Christoph Mullner , gnu-toolchain@rivosinc.com References: <20230518205716.3258223-1-vineetg@rivosinc.com> From: Jeff Law In-Reply-To: <20230518205716.3258223-1-vineetg@rivosinc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A,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: On 5/18/23 14:57, Vineet Gupta wrote: > [part #2 of PR/109279] > > SPEC2017 deepsjeng uses large constants which currently generates less than > ideal code. This fix improves codegen for large constants which have > same low and hi parts: e.g. > > long long f(void) { return 0x0101010101010101ull; } > > Before > li a5,0x1010000 > addi a5,a5,0x101 > mv a0,a5 > slli a5,a5,32 > add a0,a5,a0 > ret > > With patch > li a5,0x1010000 > addi a5,a5,0x101 > slli a0,a5,32 > add a0,a0,a5 > ret > > This is testsuite clean. > > gcc/ChangeLog: > > * config/riscv/riscv.cc (riscv_split_integer): if loval is equal > to hival, ASHIFT the corresponding regs. LGTM. Please install. Thanks for taking care of this! The updated sequence looks good. Jeff