Received: by 2002:a17:906:80c9:b0:9a1:ac8c:26bb with SMTP id a9csp707174ejx; Tue, 22 Aug 2023 06:07:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHLf9WBPQ7lPXBud7r1fAdBzYSYhdpExyyrgaL/ghAk1d5JikPJxjP2cmjrz3ODwRU+sTQb X-Received: by 2002:a05:622a:148f:b0:405:47aa:6846 with SMTP id t15-20020a05622a148f00b0040547aa6846mr11641993qtx.32.1692709643381; Tue, 22 Aug 2023 06:07:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692709643; cv=none; d=google.com; s=arc-20160816; b=eqcByuPJ2NAurXe7YsRpAK5AVrtRcSa1c//WEGj9RECrOKcARk99ZeNawc2VepBgOI 9ad8qvQbRFiTL7RHwJ0jSkcICgnSFsXzkiYcmSop/lZRY+ncQZm88YcS1XlOFwafSrKD m4HP2SU5mWJhnWVEiJkpJtAC5wTx6d+VwQz8A+1UI8kMQndFuzn8ASdoaQqpIdyBmz5o 0aS838UuNwzJK+NfaxqVEWsPMmNPAoRzt5JTeOs/wNRdrfhqtAZdjUn33JNT6WQLKUb/ 55E1AByl7R5uIxegOXmUTTUyGy1rgQmD78o1jl95jWHqFHlqoEGWAWadSgo6tZKSg+YU oESg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=GUAENzJoVoQMmt0ZYd0xs5nFH+urfTe7izwNzCDht5k=; fh=KMXQYZNk4TawESTfrTwT0vC1HaxhlAYZboG8cHV9LmY=; b=AkUuxUDNzYTJPo18+JzfiM9tqD+94Dg41Bu2lfCRrYuoOd8d3AAaBmEW1c8DEFlhOK 4EYgxAp/EgfNNn1FabCJHd5F5TgN+wLJVYPre3HAMRi3gy/eRp/AebzgZFFcFOTy9Q7g q1Kf01hwrfjrWLlPLVsx42k6zhNuEyNgOiy+irGwr2xHGYgpVQJr2WbyOZ4rM2vfxGEq 2Vu9X7nOwRJDyrga7dBa1LPSkgGt8enKEfV9gO3nY1E/Hh/5HjGH0WsCnImq3Rh3aMol eRExcu317PpAEAvcppk6NonAJqiZC5x6PSO3oWH30PUckn2e9gugCx47Pa+HoXlvQn5A cWVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qMZwPciS; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id g20-20020ac85814000000b003f518050347si6208724qtg.480.2023.08.22.06.07.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Aug 2023 06:07:23 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qMZwPciS; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYR5y-0004Iw-Jp; Tue, 22 Aug 2023 09:06:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qYR5x-0004ID-Ar for qemu-arm@nongnu.org; Tue, 22 Aug 2023 09:06:53 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYR5u-0006Ri-T8 for qemu-arm@nongnu.org; Tue, 22 Aug 2023 09:06:53 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-3fef56f7248so13254505e9.3 for ; Tue, 22 Aug 2023 06:06:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692709608; x=1693314408; 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=GUAENzJoVoQMmt0ZYd0xs5nFH+urfTe7izwNzCDht5k=; b=qMZwPciSOvk9D1vnliHtwAnaDRR9E1GR5bbX1+7aecQQd3PEOaRgUw/0l8BKY0olFo Qh0qwKGTqUqd9FUIUuP0xCqFIcldxcOMA65qzTpfpt73dropKh9TS4F+DDwy6flle/eg 5xzlmkdm4uPSrKyq/ECUNb/bOVGCyk8mhM0Yg2XoEaYv6cBmPOYXwF1pkdqyl80dmJ5u FrrfBrR/XtjZnJrWzfdOyBF4jePAIxZWC5fjZ6F9mxXAKEKThBoNZFwWCg7JiH69GdIh USyhHGdG0XAO44r3vzPd0dI8omBcziOiRPKMhmutxiu9GotV1YvVKqeslMbf8EROwkfy 4l4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692709608; x=1693314408; 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=GUAENzJoVoQMmt0ZYd0xs5nFH+urfTe7izwNzCDht5k=; b=hTvIeYgLKEfTvVapWA4gAJnFFIwfJgSLCKcEK890RgRI+j0X4zclgVqKrNCkliRwRP AVXAyh4Irbgcltdn0pT3jjF5p5g92kqdDoS0jSevu2MwB3cxgCFMcUrcT1nmvRpan80F 0oqoO+AkxS0lG6GHDxk6jVmgW3JF0d83xq+0zKmaWGduRqz7vzHDiuEQTha9hVFCsdHv 2fqZlvg7yoOWv22SeJ7LSbrP3aPumXpJxxdWGsxDhnOHmwyWosuJru6IfTqv551TgSyy g7CCwSzBRvWXztkgLIygowLDXDOrUHrktdmlkwPX+MwGXcqiPI5b+WPJ87tm91+txNR0 RUZQ== X-Gm-Message-State: AOJu0Yz6Hva+/43nM9nmJWTfROQjgmptIcJRoNvQU/WAitvUdb+Dvrz1 gsmv3tqENUtiVHCZHrGD48NTrA== X-Received: by 2002:a7b:cd14:0:b0:3fe:22a9:910 with SMTP id f20-20020a7bcd14000000b003fe22a90910mr7765512wmj.14.1692709608626; Tue, 22 Aug 2023 06:06:48 -0700 (PDT) Received: from [10.2.0.2] ([37.19.214.4]) by smtp.gmail.com with ESMTPSA id g10-20020a7bc4ca000000b003fe29f6b61bsm15694943wmk.46.2023.08.22.06.06.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 22 Aug 2023 06:06:48 -0700 (PDT) Message-ID: <09dd2dc9-edc2-a9d2-e91a-a5eb07f96ca0@linaro.org> Date: Tue, 22 Aug 2023 15:06:44 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Subject: Re: [PATCH 2/6] target/cris: Use hswap_i32() in SWAPW opcode Content-Language: en-US To: Peter Maydell Cc: qemu-devel@nongnu.org, Aurelien Jarno , Xiaojuan Yang , Aleksandar Rikalo , Yoshinori Sato , "Edgar E. Iglesias" , qemu-arm@nongnu.org, Jiaxun Yang , Song Gao References: <20230822110129.41022-1-philmd@linaro.org> <20230822110129.41022-3-philmd@linaro.org> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.google.com X-Spam_score_int: -38 X-Spam_score: -3.9 X-Spam_bar: --- X-Spam_report: (-3.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-1.767, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org X-TUID: 33pnFXeDCUpt On 22/8/23 13:44, Peter Maydell wrote: > On Tue, 22 Aug 2023 at 12:01, Philippe Mathieu-Daudé wrote: >> >> Commit 46be8425ff ("tcg: Implement tcg_gen_{h,w}swap_{i32,i64}") >> introduced the generic hswap_i32(). Use it instead of open-coding >> it as t_gen_swapw(). >> >> Signed-off-by: Philippe Mathieu-Daudé >> --- >> target/cris/translate.c | 14 +------------- >> target/cris/translate_v10.c.inc | 2 +- >> 2 files changed, 2 insertions(+), 14 deletions(-) >> diff --git a/target/cris/translate_v10.c.inc b/target/cris/translate_v10.c.inc >> index b7b0517982..0ff15769ec 100644 >> --- a/target/cris/translate_v10.c.inc >> +++ b/target/cris/translate_v10.c.inc >> @@ -506,7 +506,7 @@ static void dec10_reg_swap(DisasContext *dc) >> if (dc->dst & 8) >> tcg_gen_not_tl(t0, t0); >> if (dc->dst & 4) >> - t_gen_swapw(t0, t0); >> + tcg_gen_hswap_i32(t0, t0); > > Both these are operating on TCGv, not TCGv_i32, so I think this > should be tcg_gen_hswap_tl(). (Compare the tcg_gen_not_tl() > calls.) You are correct, if someone copies part of this code to a new function compiled for a 64-bit target, this won't build. We know cris is a 32-bit only target. When implementing tcg_gen_foo_tl(), should we implement both corresponding tcg_gen_foo_i32/i64() even if one is never used (thus not tested)? I like completeness, but I'm a bit reluctant to commit unused code (mostly for maintenance burden). Maybe I can go mid-way and only add tcg_gen_hswap_tl() -> tcg_gen_hswap_i32() here. If tcg_gen_hswap_tl() were used on a 64-bit target then we'd get a build failure. Does that sound reasonable? Thanks, Phil.