From nobody Wed Nov 19 08:44:08 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.218.51 as permitted sender) client-ip=209.85.218.51; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-ej1-f51.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.218.51 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1615301873; cv=none; d=zohomail.com; s=zohoarc; b=FpcLXjPA7icGS0h/FWAz/i0kK7RgkT7nBa00Aei7/HY6+WZ4WmrlfhXRoLNntdlWvVz+VFtP95f7oDzturTWt3yRxxYHEBhd9EcoMzSm5m/OrXNKjXe02Y5cOH2vfsOH0f47posFCLNzR6v9sgDojUo48GyaGQwyN3np2fiTfXE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615301873; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=AyXaAlW3PTOTDKw2GCNaV+r2g9IJNYZ9Fp9SJUdZdB8=; b=f6paSkjP143WiOc2fvV6uF03LdnMR6A9gg9N3ftCkDHt5NBUVFHMaPAXUfMq3dqaJ8gM75aCPdiHal9JrUekwNNkDb+spWNr8ujLrHYkDUN35J1147iLxTdkzTX9Gd/G7JuiWHV+u52Eu1HSaldhdfJTU6wuUtHGUt4tmVEgBLc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.218.51 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) by mx.zohomail.com with SMTPS id 16153018734791022.726981530861; Tue, 9 Mar 2021 06:57:53 -0800 (PST) Received: by mail-ej1-f51.google.com with SMTP id ci14so28397655ejc.7 for ; Tue, 09 Mar 2021 06:57:52 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (68.red-83-57-175.dynamicip.rima-tde.net. [83.57.175.68]) by smtp.gmail.com with ESMTPSA id o6sm9358367edw.24.2021.03.09.06.57.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Mar 2021 06:57:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AyXaAlW3PTOTDKw2GCNaV+r2g9IJNYZ9Fp9SJUdZdB8=; b=eS/JfQTwQFEYsErx+QXovFKx0SEbTF4vlfIoHwbjl8QPWzc0p5bpeURqgV/Wq2BuXE 2rjz3g0xKf9n+e9FnYKLKlMHLk8cFoOddtDLkClKjsPckBk3Jq0czhHHlmqBT3KLQz81 LkxsKpj/B3YKBhw3zwr1AyLSC+xcZrYcasOdp2xpMal5J1oQkX7hMQj0tf0fJ94WlvGa t+r4dp3YqGURTO+Qhw/L1jhtgiXAhmFeVR6g8xVqSkMMbECUdDS5viWFTWkqcwvDaOjr IckH4v4fv90RD1PPDTs31Jxe4Z/lpryLL1IL40oHefLPsIBper6msawOrc/tpJwX8hwH ZTOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=AyXaAlW3PTOTDKw2GCNaV+r2g9IJNYZ9Fp9SJUdZdB8=; b=eJKWKFL70+lraYWbWjSsd7O29AGMoQXms8QCYEiFk7R1eXdyry8+Vyn/Pijh/ZAQll 4HMNkkhD2ZqLzG9RH7v+/aozWxMz3dBsKvAk5DwmTnsHPL7//jUA08HAWarklKQ2xiTj VvY8Mi2lnm+OOU4JqNQD9PPdXHqftyXFM9G6yqw79o5cBwh0NNPwhx8Lr7SJdxjPWEQP p5qaPs7YEIF3SJwheUfKYRWQ5tO0P9OMlkVfQQBU/CZGLgRL/0bd7i+Siw13ch/RI+40 kgFXRkJVJR6JreRmzjEyUgaADmYmnsi9uGNuP0zGdQBRfJgaA65l4TRD3mbrKb2WaOrb Qthw== X-Gm-Message-State: AOAM530l6ATfLglB49ikI9mBu9bWwDqh9TuzXJgxjh7z/tSuI9QECF4i zXy1kmt3vXiJhEC5UN9d35s= X-Google-Smtp-Source: ABdhPJyfFZptmwXJD7Fz5ZIThFG9ZTOPVGkdxj/AxCrD4JzD3LMHPi8e8oO8Nh30LcAOvavOKGedUA== X-Received: by 2002:a17:906:11d1:: with SMTP id o17mr20713843eja.517.1615301871645; Tue, 09 Mar 2021 06:57:51 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Aleksandar Rikalo , Jiaxun Yang , Aurelien Jarno , Fredrik Noring , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH v2 11/22] target/mips/tx79: Introduce PEXTUW (Parallel Extend Upper from Word) Date: Tue, 9 Mar 2021 15:56:42 +0100 Message-Id: <20210309145653.743937-12-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210309145653.743937-1-f4bug@amsat.org> References: <20210309145653.743937-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) Introduce the PEXTUW opcode (Parallel Extend Upper from Word). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- v2: Introduce gen_pextw (rth) --- target/mips/tx79.decode | 4 ++++ target/mips/tx79_translate.c | 30 ++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/target/mips/tx79.decode b/target/mips/tx79.decode index d1c07c7d901..ead5f8281e5 100644 --- a/target/mips/tx79.decode +++ b/target/mips/tx79.decode @@ -35,6 +35,10 @@ PSUBW 011100 ..... ..... ..... 00001 001000 = @rs_rt_rd PSUBH 011100 ..... ..... ..... 00101 001000 @rs_rt_rd PSUBB 011100 ..... ..... ..... 01001 001000 @rs_rt_rd =20 +# MMI1 + +PEXTUW 011100 ..... ..... ..... 10010 101000 @rs_rt_rd + # MMI2 =20 PCPYLD 011100 ..... ..... ..... 01110 001001 @rs_rt_rd diff --git a/target/mips/tx79_translate.c b/target/mips/tx79_translate.c index 3abd1d92e70..68c56affc4c 100644 --- a/target/mips/tx79_translate.c +++ b/target/mips/tx79_translate.c @@ -290,6 +290,36 @@ static bool trans_PNOR(DisasContext *ctx, arg_rtype *a) * PEXTLW rd, rs, rt Parallel Extend Lower from Word */ =20 +static void gen_pextw(TCGv_i64 dl, TCGv_i64 dh, TCGv_i64 a, TCGv_i64 b) +{ + tcg_gen_deposit_i64(dl, b, a, 32, 32); + tcg_gen_shri_i64(b, b, 32); + tcg_gen_deposit_i64(dh, a, b, 0, 32); +} + +/* Parallel Extend Upper from Word */ +static bool trans_PEXTUW(DisasContext *ctx, arg_rtype *a) +{ + TCGv_i64 ax, bx; + + if (a->rd =3D=3D 0) { + /* nop */ + return true; + } + + ax =3D tcg_temp_new_i64(); + bx =3D tcg_temp_new_i64(); + + gen_load_gpr_hi(ax, a->rs); + gen_load_gpr_hi(bx, a->rt); + gen_pextw(cpu_gpr[a->rd], cpu_gpr_hi[a->rd], ax, bx); + + tcg_temp_free(bx); + tcg_temp_free(ax); + + return true; +} + /* * Others (16 instructions) * ------------------------ --=20 2.26.2