From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by sourceware.org (Postfix) with ESMTPS id A39463858C2F for ; Thu, 27 Jul 2023 07:25:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A39463858C2F 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-ej1-x632.google.com with SMTP id a640c23a62f3a-991c786369cso78949466b.1 for ; Thu, 27 Jul 2023 00:25:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690442748; x=1691047548; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:cc:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Gle6i15BJnisd8rA2QYFijg+36JcMPgMjJjmfiqUpSQ=; b=BAEIF4yNEojc1A0kqsBupYs9RG57+uEC5NhXft5Shgb7xB9qQPuLe+TxI5G00H/kVd ArGqQWGI4G8pwTZqeMf7/DgDPxwMk6eSw6NuD032jriRskA66r10cZf00NBQvDSBq3NJ ZgN8FNVLGqx6ebhCZQ18/Or4u00jOr0d0PfFpKFrnAfWEbaJ5OaFrJBDtPZrbKq3wc02 mbqeV64w/K9u2GnSw/ykeDMUsMgzBw/VRakxgJgxanjY0ekYgQyJyB1cZlP4nicuBLRP 4iA2NYd1kaO8ZL5uu4nbClaW1x38VP/HyRdX6Lq46b13hSfKr8oNs1GSf05d8nfnc79+ /n+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690442748; x=1691047548; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:cc:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Gle6i15BJnisd8rA2QYFijg+36JcMPgMjJjmfiqUpSQ=; b=kSIPNiWubERWEqQ+YaMq/oqDfIYPaZamuRFU6tZpXYaVHQkTafX7FBe9YeIaYQx7Zg YKj6tq3VnCs+0/yo0K2isFEjz26U592vzRBFmv/zEjANqOacBjYP2PGfbZG6msnDHvvQ FYSoDTeZdQ9JbYdcj4KedwHT7oG/EzFUE3nW9cIR51aCoDFEQvc/XaFmrbgU0mMFL1or Klhk0wHiH27qahy4iN0bZqJDChPjliKFban6Iswf2ScEoKtzyr0vFmctKSVpkATCWnKZ FA3XGeZ14GHYjAXc6102pbyUoWiuG6JbCWOiIweF+8hm8Umjpz6r7GcDaAVJkTfcekB9 lYhw== X-Gm-Message-State: ABy/qLbbqd/EAk3voexZAGo8kKo07mo9L9p+5iWoVIXr3uE+45yMeOte k+Fs1nd5c1Kko+LAySGT4pI= X-Google-Smtp-Source: APBJJlH/9M2AC/l5Hw8yKi/TYNo6Za5AKZOe3Rq3Iw1g98NRXhejodrom3Z9Hpc6C/Ta6Zj9I/RFsA== X-Received: by 2002:a17:907:a048:b0:988:7d68:9fee with SMTP id gz8-20020a170907a04800b009887d689feemr1218945ejc.34.1690442748026; Thu, 27 Jul 2023 00:25:48 -0700 (PDT) Received: from [192.168.1.23] (ip-046-005-130-086.um12.pools.vodafone-ip.de. [46.5.130.86]) by smtp.gmail.com with ESMTPSA id lz7-20020a170906fb0700b0099b6b8a0d04sm424944ejb.157.2023.07.27.00.25.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 Jul 2023 00:25:47 -0700 (PDT) Message-ID: Date: Thu, 27 Jul 2023 09:25:46 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Cc: rdapp.gcc@gmail.com, "gcc-patches@gcc.gnu.org" , "juzhe.zhong@rivai.ai" , "Wang, Yanzhang" Subject: Re: [PATCH v7] RISC-V: Support CALL for RVV floating-point dynamic rounding To: "Li, Pan2" , Kito Cheng References: <20230719032822.85817-1-pan2.li@intel.com> <20230725055156.595718-1-pan2.li@intel.com> <2a9db9ea-ba9e-264c-fe2f-c44bb8f9d580@gmail.com> <911144fa-47f1-4607-0795-fac42de680fe@gmail.com> Content-Language: en-US From: Robin Dapp In-Reply-To: Content-Type: text/plain; charset=UTF-8 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: >> Why do we appear to return a different mode here? We already request >> FRM_MODE_DYN_CALL in mode_needed. It looks like in the whole function >> we do not change the mode so we could just always return the incoming >> mode? > > Because we need to emit 2 insn when meet a call. One before the call, > we must return DYN_CALL when needed, then the emit part is able to > know the mode switch to DYN_CALL and restore. One after the call, we > must return DYN_CALL when after, then the next insn emit part is able > to know the prev_mode is DYN_CALL and backup. My question was not about DYN_CALL in general but rather - mode switching will switch to the moded requested by mode_needed. The mode_after hook allows to specify if we want to change a mode afterwards but it doesn't look like we every do. mode_needed -> CALL_P -> DYN_CALL mode_sw switches to DYN_CALL mode_after -> DYN_CALL so there is no need to appear to change the mode but we can just pass it through, possibly same for DYN? Or to put it differently, can we start with "return mode" in riscv_frm_mode_after and then only add the condition that are strictly necessary? I also noticed an unused bb in riscv_frm_adjust_mode_after_call that we want to remove. Also, if (mode != prev_mode) in mode_set is unnecessary as mode_sw already checks that. Regards Robin