From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by sourceware.org (Postfix) with ESMTPS id D4E1D3858C1F for ; Wed, 14 Jun 2023 19:07:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D4E1D3858C1F 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-x436.google.com with SMTP id d2e1a72fcca58-653436fcc1bso5807840b3a.2 for ; Wed, 14 Jun 2023 12:07:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686769653; x=1689361653; 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=dBVTYycIkuI/qRJYCpa9zEfs6O3abIwD4lFSl1JiWTc=; b=aLuQ9PP9ErEgSTVI2Q2zzBsMW3ZhmgBChVGyayN0GHwd3JPeuG5xuA0qAADGYUWOsO oDrRz11sYrM0VywxbDvPyjlLQO1uEoCY1md2WmLW+2I4MZ8dn6ZrhesNvWHCsFC0VmzN ZpwEn43YBvNSnimXT2HrXn4SufLWCEapvXpMT3YukFg8J6rzwxmPcIn2t+w8TcZM76KQ sj0UG8FWouT+BiFvoaH9a/xdgxoOdpcsaDYm6/DgEoed6bCJk/Z3Kh23WaoobdD5+2B7 eTq/SkzjGJFn92pX3QmP/LUX5alKI82SSx1EjMLBm6DywaDMMhdM6F9kR4AijIvhAG0b s8LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686769653; x=1689361653; 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=dBVTYycIkuI/qRJYCpa9zEfs6O3abIwD4lFSl1JiWTc=; b=BsJDWrojdrckBQyibzrFOLd0kj/+7BqGolHRGhq9ZU5+k2waHeCN7Gv7QCUiGZKrNE D5dOQAT/7SrJRrtt22ggTtPHmpSOOg08kL4oHYtLwzwJhxhWE+oPdrEFW7Uuj80Sp7w0 7Y6ad+BjUVsa+2Jo/e8FvfjMWOua1C9cQLq3sHhLs+FNZluNENZ2MhwXxvKCaSEZOehg alLPGpYeNBpfWvdB+Q2nNuTa8/0kqPyagjMLfzPejlJItDyu8Kj9PAPp8AhkkDL/DDK3 cJXRfxjJfCdzPaXAIPmSV0OjUYDZ2+BdUpGQe4wOFauPUH2yO4b3PcVrorpa4UiAm7jN paXg== X-Gm-Message-State: AC+VfDzMeqm/fGke25lPwwiFw2MBj4IVWmf9yMUh6YVZROhlWFbQMeNg 6fQGTx33gYVt3HYMMSvw1Sg= X-Google-Smtp-Source: ACHHUZ4dN3MrOJynuPr7382mt+DhhVwtBvPlvdbN4sHpzXxX58hGJOtVAddaOguwttCEut9zAmj8Cw== X-Received: by 2002:a05:6a20:7d9d:b0:ee:f290:5b5e with SMTP id v29-20020a056a207d9d00b000eef2905b5emr2707883pzj.43.1686769653452; Wed, 14 Jun 2023 12:07:33 -0700 (PDT) Received: from [172.31.0.109] ([136.36.130.248]) by smtp.gmail.com with ESMTPSA id n14-20020a635c4e000000b004fbd91d9716sm11254413pgm.15.2023.06.14.12.07.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 14 Jun 2023 12:07:32 -0700 (PDT) Message-ID: Date: Wed, 14 Jun 2023 13:07:31 -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 V2] RISC-V: Ensure vector args and return use function stack to pass [PR110119] Content-Language: en-US To: Lehua Ding , gcc-patches@gcc.gnu.org Cc: juzhe.zhong@rivai.ai, rdapp.gcc@gamil.com, jeffreyalaw@gamil.com, palmer@rivosinc.com References: <20230614115611.2227435-1-lehua.ding@rivai.ai> From: Jeff Law In-Reply-To: <20230614115611.2227435-1-lehua.ding@rivai.ai> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_SHORT,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 6/14/23 05:56, Lehua Ding wrote: > The V2 patch address comments from Juzhe, thanks. > > Hi, > > The reason for this bug is that in the case where the vector register is set > to a fixed length (with `--param=riscv-autovec-preference=fixed-vlmax` option), > TARGET_PASS_BY_REFERENCE thinks that variables of type vint32m1 can be passed > through two scalar registers, but when GCC calls FUNCTION_VALUE (call function > riscv_get_arg_info inside) it returns NULL_RTX. These two functions are not > unified. The current treatment is to pass all vector arguments and returns > through the function stack, and a new calling convention for vector registers > will be added in the future. > > Best, > Lehua > > PR target/110119 > > gcc/ChangeLog: > > * config/riscv/riscv.cc (riscv_get_arg_info): Return NULL_RTX for vector mode > (riscv_pass_by_reference): Return true for vector mode > > gcc/testsuite/ChangeLog: > > * gcc.target/riscv/rvv/base/pr110119-1.c: New test. > * gcc.target/riscv/rvv/base/pr110119-2.c: New test. And just to be clear, I've asked for a minor comment update. The usual procedure is to go ahead and post a V3. In this case I'll also give that V3 pre-approval. So no need to wait for additional acks. Post it and it can be committed immediately. jeff