From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by sourceware.org (Postfix) with ESMTPS id 333653858C50 for ; Mon, 3 Apr 2023 04:13:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 333653858C50 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-pj1-x102b.google.com with SMTP id mp3-20020a17090b190300b0023fcc8ce113so31161697pjb.4 for ; Sun, 02 Apr 2023 21:13:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680495193; x=1683087193; 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=0GTMuzk/Jhi49++egTKYn1MYE+MYrXRN9bjbjx2qWJs=; b=ds3ktA6EZiagJBFmTpG59BYFqnSb/Ky12EOl3wUsfySPHF9Zpi2HszQikg753NjnGK Kb1J2RuOQPfO96G/sF8GIldjEiy6zPVP1uMN1EN+7E/wqnPdWMVr7GqAVsHN0HDRJfmf RkX4VB4QHdlYmEv4oS6hLoHcsBY8spadPVPkhvq/sKcC9YFmBptyNZCpfjeFCCohgybO hZ9ndNlzKEh4iL+5odNiBIjegiTJC3ovCFjxl3va6VicsQrEvC1yjrlhffCu4NmuTch2 wLTSaH41Dd7spjOVfk0/n58eVNTk0vAA5vLkueXKP+lVOX15iFh2OzhVBxPrdmcFluCa ni5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680495193; x=1683087193; 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=0GTMuzk/Jhi49++egTKYn1MYE+MYrXRN9bjbjx2qWJs=; b=zoxX/fZzsx9FWTsQ6PbWF90CRY7VPcRevr5ZFMa+vaKi6ZUXC9NK7SbF0Q4EadjcZ7 MNlZ4h29Qb2J7BO9g1bFRVgbvBF5OpCDWp6WGrQ2Y2efY5HrWqL624baq3PmMM5LDwjV j3NoUYX1aSwL1XWMIEE0WQiWkj0Nk6DeyfcKde9cpa/0h9+3nx84GQghr1+RDplVcrCX Gf9utQlhr4p1u1S0phw29ZJ1niT28nqraaqgQkIIR24F5sYKhX6BQK1E0ZdM/lwdvF/N r7S99yOLAN5+x6lUMYyjcF3Pu6buoa8FQhKq0wm/81Ln9/vjQgdVS7ILR+IbS3IVOf97 fz4w== X-Gm-Message-State: AAQBX9fdPCAFgJU3J1OumIq05+17ZhFjX32IWFII3gEMblpnzAfaYWH5 DxDF1G/q9uf2zf6wN2WO5j4= X-Google-Smtp-Source: AKy350a1LZQicx++JrOehjyQIHtj0ejPG/OoFuGkFKZqgcnpSCwq35L1cB6F3Ve/DoaQY7UokbMVgg== X-Received: by 2002:a17:903:2282:b0:19e:bfec:7928 with SMTP id b2-20020a170903228200b0019ebfec7928mr43526472plh.24.1680495192971; Sun, 02 Apr 2023 21:13:12 -0700 (PDT) Received: from ?IPV6:2601:681:8600:13d0::f0a? ([2601:681:8600:13d0::f0a]) by smtp.gmail.com with ESMTPSA id g12-20020a1709026b4c00b001888cadf8f6sm5515516plt.49.2023.04.02.21.13.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 02 Apr 2023 21:13:12 -0700 (PDT) Message-ID: <2fa75b34-889f-d6c7-ec91-25999acbde4b@gmail.com> Date: Sun, 2 Apr 2023 22:13:11 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH] RISC-V: Fix SEW64 of vrsub.vx runtime fail in RV32 system Content-Language: en-US To: juzhe.zhong@rivai.ai, gcc-patches@gcc.gnu.org Cc: kito.cheng@gmail.com, palmer@dabbelt.com References: <20230403003855.113601-1-juzhe.zhong@rivai.ai> From: Jeff Law In-Reply-To: <20230403003855.113601-1-juzhe.zhong@rivai.ai> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.5 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 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 4/2/23 18:38, juzhe.zhong@rivai.ai wrote: > From: Ju-Zhe Zhong > > It's quite obvious that the order of vrsub SEW64 is wrong. > > gcc/ChangeLog: > > * config/riscv/vector.md: Fix incorrect operand order. Note the formatting in that code is wrong on multiple levels. While I don't typically get nit-picky on formatting, this needs serious cleanup for gcc-14: > if (riscv_vector::sew64_scalar_helper ( > operands, > /* scalar op */&operands[3], > /* vl */operands[5], > mode, > mode, > riscv_vector::simm5_p (operands[3]), > [] (rtx *operands, rtx boardcast_scalar) { > emit_insn (gen_pred_merge (operands[0], operands[1], > operands[2], boardcast_scalar, operands[4], operands[5], > operands[6], operands[7])); > })) Please review the coding standards, particularly with regards to indention and function call parameters. When you find that you're writing code like this: emit_insn (gen_something (x, y, x, p, q, r, s, t)); Please break it up. Pull the generator call out and store its result in a temporary. Then fix the indention of its arguments so that it looks like this: temp = gen_something (some_long_argument, another_long_argument, more_long_args, something_else); The coding standards exist to make it easier for everyone to be able to understand your code without having to waste mental energy parsing different formatting styles. As it stands I'm spending *far* too much mental energy just trying to figure out what arguments are associated with what calls. That's just crazy. jeff