From nobody Thu Oct 31 00:20:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1623660867; cv=none; d=zohomail.com; s=zohoarc; b=HfyR+rKaW2gGddnmALiTKLg/7vUlD7qgOC9cocp+2UlLmmJ/IafNzle5SO0I6gIPDCPxLWOVzgNlCIBD57chAU09YdxsGaxW/cAnLq0F1hYn6Abi/N4xnaKUXmM7WPDQee6FXxaHjygEA87dfKhZxnn0lGvH8PJro8+d2WytCRY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623660867; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=efhM15NF3CwbPhiaHPmRN5qTN9aiv7TZSEdl+6oiGJA=; b=ExgF2AFZG+TrVJ2FVPLR/DVDKMu4iOO4Ou5R6+bl6HjaRwvfT6QjB30yt18hgJZE+pLlb5SkID3+aLyuwGrS01P7oKo4GWPcS21LcbP5nf6TELupLl+eP9mvQLy2m+zaeIAanwZ7ERTLllYr+9ZMfUn5Y69IXKBhrXiUzAybC3Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1623660867033769.3040185503806; Mon, 14 Jun 2021 01:54:27 -0700 (PDT) Received: from localhost ([::1]:57126 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lsiMT-00088X-82 for importer@patchew.org; Mon, 14 Jun 2021 04:54:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46152) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lsi6s-0002Du-LV for qemu-devel@nongnu.org; Mon, 14 Jun 2021 04:38:18 -0400 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]:54218) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lsi6i-0003Xw-CP for qemu-devel@nongnu.org; Mon, 14 Jun 2021 04:38:18 -0400 Received: by mail-pj1-x102e.google.com with SMTP id ei4so9286940pjb.3 for ; Mon, 14 Jun 2021 01:38:07 -0700 (PDT) Received: from localhost.localdomain (174-21-70-228.tukw.qwest.net. [174.21.70.228]) by smtp.gmail.com with ESMTPSA id h20sm2242022pfh.24.2021.06.14.01.38.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Jun 2021 01:38:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=efhM15NF3CwbPhiaHPmRN5qTN9aiv7TZSEdl+6oiGJA=; b=O7qvuFfny6UZxSJSSIpgm/I0oEcDflN5S+g1lMvMwEy6KIhLmkCEbiaye/AMto0d9q 38w4hXKO5sAkY8YKTOYweFVljZlQX+rZU5LPzZBYrvikBAZkKqkrHbeOyXkB5J/p1T31 1Oa0WlZQLSBVTFNSEBUslIKx9bPtyDZklvinFwNSAU2N9BM1GK6jgm2nGFO26xKa77Bk BcpxF+mkJYKxhHo2HPzcWd+7JC+OimFxb6x7y9q4Z5GMnlQwe9TVeM+gGAsPCF9WELwY AOBqcy7tDExTGiFYRKoHQNDVNgWnoLcN6EjujrO0NDkaWqADa25GjMDzh0wyh5xq9nNa e3pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=efhM15NF3CwbPhiaHPmRN5qTN9aiv7TZSEdl+6oiGJA=; b=jGEoYlPK9j1aT3CkIQXKIXhkj2Lf/9KEZ8ra3WM18YfBqX5a9axjmhV/9yZa494SGh liXP8BCb291mEj+OmnkqQGzdgCB4WlcnQSu4OCU00noYHvntzvp2t3i6mtqlsidpYn5V 95ULWcxpZdj/D3z3B96Fs3rL1PH7h+UPzp1ra5XrSFKSQu7AjG0L1Eifyc8o2vgjOiXD gm4+xd5L0il9caqH9RnH9SwEdzyN72wFCX18108L2d6QxX8F+O3I/Hjdbx9SvS1DDW8p hL06RKIOhmhG/Tu8+YVLQu235pTM+ktGEPChMFeOWOFJnGtMOa8t9P54Lw0eI3U3Ti6p 3HOg== X-Gm-Message-State: AOAM530I/Nc+OgW2IaQYZ1aBYQn3bakk1nZsrnm+VVTxzY1gVc53ZnQi 6glwVUzNbtFa3VY9glPCfID2NPHA2VTTrw== X-Google-Smtp-Source: ABdhPJxAppJBRSsSA7W15u13HEgGQf0ad/ywVBeym5nQrdhqQUBiUw9GjCyP2PwPczEcadb5Bj+G+Q== X-Received: by 2002:a17:90b:393:: with SMTP id ga19mr17665224pjb.182.1623659887072; Mon, 14 Jun 2021 01:38:07 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 09/28] tcg/ppc: Split out tcg_out_bswap64 Date: Mon, 14 Jun 2021 01:37:41 -0700 Message-Id: <20210614083800.1166166-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210614083800.1166166-1-richard.henderson@linaro.org> References: <20210614083800.1166166-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::102e; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102e.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=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- tcg/ppc/tcg-target.c.inc | 51 +++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 30 deletions(-) diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc index f0e42e4b88..690c77b4da 100644 --- a/tcg/ppc/tcg-target.c.inc +++ b/tcg/ppc/tcg-target.c.inc @@ -809,6 +809,26 @@ static void tcg_out_bswap32(TCGContext *s, TCGReg dst,= TCGReg src) tcg_out_mov(s, TCG_TYPE_REG, dst, tmp); } =20 +static void tcg_out_bswap64(TCGContext *s, TCGReg dst, TCGReg src) +{ + TCGReg t0 =3D dst =3D=3D src ? TCG_REG_R0 : dst; + TCGReg t1 =3D dst =3D=3D src ? dst : TCG_REG_R0; + + /* src =3D abcd efgh */ + tcg_out_rlw(s, RLWINM, t0, src, 8, 0, 31); /* t0 =3D 0000 fghe */ + tcg_out_rlw(s, RLWIMI, t0, src, 24, 0, 7); /* t0 =3D 0000 hghe */ + tcg_out_rlw(s, RLWIMI, t0, src, 24, 16, 23); /* t0 =3D 0000 hgfe */ + + tcg_out_rld(s, RLDICL, t0, t0, 32, 0); /* t0 =3D hgfe 0000 */ + tcg_out_rld(s, RLDICL, t1, src, 32, 0); /* t1 =3D efgh abcd */ + + tcg_out_rlw(s, RLWIMI, t0, t1, 8, 0, 31); /* t0 =3D hgfe bcda */ + tcg_out_rlw(s, RLWIMI, t0, t1, 24, 0, 7); /* t0 =3D hgfe dcda */ + tcg_out_rlw(s, RLWIMI, t0, t1, 24, 16, 23); /* t0 =3D hgfe dcba */ + + tcg_out_mov(s, TCG_TYPE_REG, dst, t0); +} + /* Emit a move into ret of arg, if it can be done in one insn. */ static bool tcg_out_movi_one(TCGContext *s, TCGReg ret, tcg_target_long ar= g) { @@ -2806,37 +2826,8 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, case INDEX_op_bswap32_i64: tcg_out_bswap32(s, args[0], args[1]); break; - case INDEX_op_bswap64_i64: - a0 =3D args[0], a1 =3D args[1], a2 =3D TCG_REG_R0; - if (a0 =3D=3D a1) { - a0 =3D TCG_REG_R0; - a2 =3D a1; - } - - /* a1 =3D # abcd efgh */ - /* a0 =3D rl32(a1, 8) # 0000 fghe */ - tcg_out_rlw(s, RLWINM, a0, a1, 8, 0, 31); - /* a0 =3D dep(a0, rl32(a1, 24), 0xff000000) # 0000 hghe */ - tcg_out_rlw(s, RLWIMI, a0, a1, 24, 0, 7); - /* a0 =3D dep(a0, rl32(a1, 24), 0x0000ff00) # 0000 hgfe */ - tcg_out_rlw(s, RLWIMI, a0, a1, 24, 16, 23); - - /* a0 =3D rl64(a0, 32) # hgfe 0000 */ - /* a2 =3D rl64(a1, 32) # efgh abcd */ - tcg_out_rld(s, RLDICL, a0, a0, 32, 0); - tcg_out_rld(s, RLDICL, a2, a1, 32, 0); - - /* a0 =3D dep(a0, rl32(a2, 8), 0xffffffff) # hgfe bcda */ - tcg_out_rlw(s, RLWIMI, a0, a2, 8, 0, 31); - /* a0 =3D dep(a0, rl32(a2, 24), 0xff000000) # hgfe dcda */ - tcg_out_rlw(s, RLWIMI, a0, a2, 24, 0, 7); - /* a0 =3D dep(a0, rl32(a2, 24), 0x0000ff00) # hgfe dcba */ - tcg_out_rlw(s, RLWIMI, a0, a2, 24, 16, 23); - - if (a0 =3D=3D 0) { - tcg_out_mov(s, TCG_TYPE_REG, args[0], a0); - } + tcg_out_bswap64(s, args[0], args[1]); break; =20 case INDEX_op_deposit_i32: --=20 2.25.1