From patchwork Tue Aug 22 12:40:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 715747 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp235538wrp; Tue, 22 Aug 2023 05:42:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF07U9nJK4tbD/gcYG21bNQ8ZXYS110ZR4XtZC3kmY2Xeub5Z86bkOpi1cErBZpVFN59apH X-Received: by 2002:a1f:eac3:0:b0:48d:29ef:1764 with SMTP id i186-20020a1feac3000000b0048d29ef1764mr3992800vkh.9.1692708145092; Tue, 22 Aug 2023 05:42:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692708145; cv=none; d=google.com; s=arc-20160816; b=mvDSxz1Bi2532Ya/vuiKQkxRU+65MVXdd2cclTLl206S0+H3rBReljKPo9FlzoaWeq JzoX0G3dEywRLIpbVOBqN6nDLslzhS+h0kpMrERXJyAqyOB/ecH3otD+hyNQ8tLBC7nV Kd19M+KBLUMVl32p7Hif2tlFksvKUh8/uZ/pvCaRe/6lVjpUQW52gWplD+VQN3uvaNI6 ZX5xsuId3wzt1zRIAgLEpRuor1pV9cMcmR9mSIGM6/nbUmJ8yRgWXmewyJ9eMp32W2dO RhuU+tDfiB4YHk6r+0b+oEwlJvaji70ACHGWrduAFJPtc1yd8wSv1jqWjABiLJSOHDK8 E7bA== 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 :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=k+Q+413qAyohxkZfqCqkkltTwZ66XX4v/AfIWdcA3w4=; fh=wXqw6aajGBSP4OKAgbWKHj3BSg7Yrdz+j0I8chPJZNc=; b=M04lF6Z+VvsVFuCDAQdZ6jHbsweUAPSJ+LveN+yRoI7Kz5PqJpt7Y+xeZgjAGS5Bvn 9VAB4RRrejLqZjV5gpgVeVDOzEpYVdY3qaYI7C7WlmwmYX9DFM3sQ9v4F/qkFQga/nk/ vmF6fsOZHl0WH9X9RaF0xbbrdEMj/pr7gC+0cH0eEiHJKM1nN4EQv6XXutN5kzshLVhI sFPnoQ5nSriLbTvR9XFeI8koYYUnPYkzf/EawILEdlxHudf6O1trstzVIJglROIQSCet pmkN7vLyIzWApxOtsbzvDXLIYEKeIbHflc91Ap7jtyrXT1QnRTWgpUsJCnjVGhGQzyKB oUWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RHAt31Ja; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=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 t9-20020a05622a148900b0040345635f05si6455061qtx.132.2023.08.22.05.42.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Aug 2023 05:42:25 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=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=RHAt31Ja; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=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 1qYQhL-0006Qo-SN; Tue, 22 Aug 2023 08:41:27 -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 1qYQhB-0006MC-7B for qemu-devel@nongnu.org; Tue, 22 Aug 2023 08:41:18 -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 1qYQh8-0005fY-Ra for qemu-devel@nongnu.org; Tue, 22 Aug 2023 08:41:16 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-3fe8242fc4dso43804845e9.1 for ; Tue, 22 Aug 2023 05:41:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692708072; x=1693312872; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=k+Q+413qAyohxkZfqCqkkltTwZ66XX4v/AfIWdcA3w4=; b=RHAt31JaX+enrxV2lGY1ElHMHQfUkmaCYzzh5D0NPoQO3WOwlVHcNJSyfwCJgMJdRE PRLJDtij2T3QHtANmzMg9V0JBto+2j0VV0eiggYB9uBnsvLJirOkj3JNTKO9XHqqTBBf XYuiH0hlG3aIOvrktg3GzU2oeySb805dxEBF9aEuVWhl354HLQT8K8+/qvFmRCobVRZ9 zfVBJ4KP5msX5FBwxX2dvCdD8KpTdW9aCdYoxC73kf24rOcWFzibQ5MldQ7A/fhIPLue IVcriIEhPRxJqIiHUZlmFjPXDqNUlPtctiljgrrUFYbtoleQAZ3Tpogbb40/W+UAc/ta r1AQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692708072; x=1693312872; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=k+Q+413qAyohxkZfqCqkkltTwZ66XX4v/AfIWdcA3w4=; b=Gk76pgMd5g7G1JWmL1SBDUr0hvJ9Pg3Sty8k4LRvPFwaf2GaEcwaZAiDGes01sennV WiRtMEGJfV5HW6qtWzWPsE2JUdUsq2/13J3gWgBhmUN+Ou4m146HrLM3VORbW2s45H7s o7acCaFOoqTpssVYxkEq0Mlx/wp+h1pg3lNG2CQbgTS4sulm5Z2o+D+c0bm9wBs6NEue wN/SrzlzvFig0JRhBd1RoR2pXOgdetKRD/4QEaRPQKqMWOb3Y8cmFlNP5LqXu5VUEKh6 CYaljhDHxX47lNl/hSyF+QnzAbWWt/bAwsAhnKJ81zZdMOd23h6PeCfhnxxXnhYoGbEs TJLQ== X-Gm-Message-State: AOJu0YwKUZKivhF1MuF+tijZuUVo/BGSeOC05WDJ8j+NMItQ29aR3EIK aGoFbk/QAovJf7h1HTxUBYngzmyKKFMkrsQi9+Pj+g== X-Received: by 2002:a5d:4685:0:b0:317:59c8:17bc with SMTP id u5-20020a5d4685000000b0031759c817bcmr6009480wrq.15.1692708072120; Tue, 22 Aug 2023 05:41:12 -0700 (PDT) Received: from localhost.localdomain ([37.19.214.4]) by smtp.gmail.com with ESMTPSA id a14-20020adff7ce000000b0030fd03e3d25sm15856795wrq.75.2023.08.22.05.41.08 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 22 Aug 2023 05:41:11 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Song Gao , "Edgar E. Iglesias" , Richard Henderson , Greg Kurz , Aurelien Jarno , Peter Maydell , qemu-ppc@nongnu.org, Daniel Henrique Barboza , Aleksandar Rikalo , Paolo Bonzini , David Gibson , Jiaxun Yang , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Yoshinori Sato , Nicholas Piggin , Xiaojuan Yang , qemu-arm@nongnu.org Subject: [PATCH 03/12] target/cris: Use generic hrev32_i32() in SWAPB opcode Date: Tue, 22 Aug 2023 14:40:33 +0200 Message-ID: <20230822124042.54739-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230822124042.54739-1-philmd@linaro.org> References: <20230822124042.54739-1-philmd@linaro.org> MIME-Version: 1.0 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@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-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé --- target/cris/translate.c | 20 +------------------- target/cris/translate_v10.c.inc | 2 +- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/target/cris/translate.c b/target/cris/translate.c index 925ed2c6f6..00bbe6c645 100644 --- a/target/cris/translate.c +++ b/target/cris/translate.c @@ -381,24 +381,6 @@ static inline void t_gen_subx_carry(DisasContext *dc, TCGv d) } } -/* Swap the two bytes within each half word of the s operand. - T0 = ((T0 << 8) & 0xff00ff00) | ((T0 >> 8) & 0x00ff00ff) */ -static inline void t_gen_swapb(TCGv d, TCGv s) -{ - TCGv t, org_s; - - t = tcg_temp_new(); - org_s = tcg_temp_new(); - - /* d and s may refer to the same object. */ - tcg_gen_mov_tl(org_s, s); - tcg_gen_shli_tl(t, org_s, 8); - tcg_gen_andi_tl(d, t, 0xff00ff00); - tcg_gen_shri_tl(t, org_s, 8); - tcg_gen_andi_tl(t, t, 0x00ff00ff); - tcg_gen_or_tl(d, d, t); -} - /* * Reverse the bits within each byte. * @@ -1666,7 +1648,7 @@ static int dec_swap_r(CPUCRISState *env, DisasContext *dc) tcg_gen_hswap_i32(t0, t0); } if (dc->op2 & 2) { - t_gen_swapb(t0, t0); + tcg_gen_hrev32_i32(t0, t0); } if (dc->op2 & 1) { t_gen_swapr(t0, t0); diff --git a/target/cris/translate_v10.c.inc b/target/cris/translate_v10.c.inc index 0ff15769ec..86cc5de8ad 100644 --- a/target/cris/translate_v10.c.inc +++ b/target/cris/translate_v10.c.inc @@ -508,7 +508,7 @@ static void dec10_reg_swap(DisasContext *dc) if (dc->dst & 4) tcg_gen_hswap_i32(t0, t0); if (dc->dst & 2) - t_gen_swapb(t0, t0); + tcg_gen_hrev32_i32(t0, t0); if (dc->dst & 1) t_gen_swapr(t0, t0); cris_alu(dc, CC_OP_MOVE, cpu_R[dc->src], cpu_R[dc->src], t0, 4);