From patchwork Tue Nov 7 03:03:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 741842 Delivered-To: patch@linaro.org Received: by 2002:adf:fd90:0:b0:32d:baff:b0ca with SMTP id d16csp1422037wrr; Mon, 6 Nov 2023 19:15:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IEzLwEAeVMbERNJ8JKUgkJTpa7fTY5QMYoFKJLPaBguGe3F+qjtzsgAhxpGF+QQPBSR7FQo X-Received: by 2002:a05:6214:21aa:b0:66d:12c7:bf85 with SMTP id t10-20020a05621421aa00b0066d12c7bf85mr41357888qvc.31.1699326926522; Mon, 06 Nov 2023 19:15:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699326926; cv=none; d=google.com; s=arc-20160816; b=bNXD3HONFqY0nZ5BSBdiqrGWIkSaBAPnnjj3YF2v2S+K/u6F9+gFTaSIimUpcpBOf/ XcZ726sJuQvsReBhxhxG+IUwidIaKtidgqr07ITf1nM1hV3NB177FnVZCQigxTmUIwKU 6OkFLRE9ymnmhLLJMHfo0wEYxQn223Ks0Lv7iGthhv1VQjrlXJhwUuwckttnyLlCGOjm Wq8wlqzKnbaKTwAFlvHn4AZy+RxT7JQQE7g3G8Nd0+daM66VwAV/1XISkai4LrcvSAEZ 59LyGB/9j3qvGn4BUY+idWnY8gpez2KFciFJF4AFIVpDDDQ1v7MMcXiCtSKj6SJq+9qD 8aqQ== 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:to:from :dkim-signature; bh=3JAxoXI7VapsXdw9ZI00wLKc1gQtqsT1pO38/MYDc4c=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=bo4Pb5CSgYwh23c6CUdHwvQy3ac7QzFdDgu7hrPlsj+lMAGDS693GKkR7H3/UKTDr9 xiKVftLTO7AbfG1+tx62fTJ1U7UaFgw3ZHCdH2o+inO7iu7ckhIet0py0FiSWF8eS3NG jf06OPZ1ZkQTk8oMMTQG1jQyDqQEoXyHG+G588iBehcTWBTQYbRXuBHGTkt9pMe8BqAv VUn7JcauVqerHP8uLo0HifECxlYPWYGfB5wLW+cg6fbneNDcGHWtazkEwgxnYNQuhs+U TlG6+CLG4c6qX1F2NxkVdMVmfcE7HABSLIssk7/+ukzhExT9Ma/LD39ILgJsh+rkgiN2 0Bjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=K+IIkbUD; 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 m12-20020a0ce8cc000000b0064f92d244f5si6482798qvo.396.2023.11.06.19.15.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 Nov 2023 19:15:26 -0800 (PST) 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=K+IIkbUD; 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 1r0CRt-0005kP-8l; Mon, 06 Nov 2023 22:08:17 -0500 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 1r0CRf-0004wW-Sn for qemu-devel@nongnu.org; Mon, 06 Nov 2023 22:08:04 -0500 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r0CRc-0001Q8-OM for qemu-devel@nongnu.org; Mon, 06 Nov 2023 22:08:03 -0500 Received: by mail-pj1-x102a.google.com with SMTP id 98e67ed59e1d1-2800bb246ceso3895391a91.1 for ; Mon, 06 Nov 2023 19:07:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699326478; x=1699931278; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=3JAxoXI7VapsXdw9ZI00wLKc1gQtqsT1pO38/MYDc4c=; b=K+IIkbUDHNc2oUL0XZ5N6PuFXb5b+vdI8KV6B0fpFGfIccpiJ7Vy6Dyo89626AjVBI ts5aRTAJH1ng2ZQ4MshcCwsjr/PwJgBkGX92PRnWCLDzdIm96/m3W9aaRFazmhlmN201 jWnqOgt2XaQAQRH+ZRy3vsCeHJ+vO6RVr8N1BIrHJ+bPiz8/neF5Bgi3CdD0eLPN44KI YtB8rYkQRsqZpByBC9GL/VuL8NdLpQJu/D8xjjaiZQ55ISqc0F1C1KRXTl6lX+L6YG9g rYtF7RDH9nbx0ulF4XJiFqy+o1rcxMhYc1nq3zQg3Sdcivq2dNodQtYBUrUVUTmneB57 NPJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699326478; x=1699931278; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3JAxoXI7VapsXdw9ZI00wLKc1gQtqsT1pO38/MYDc4c=; b=qDYU/lxQsx0nb0i+qlyuyqcT17dmgmlD8tFhUcVnFMiK0KJ5IHGi7iUBnh7nQzfqU0 cH+ADrD4NprGbPLSe1PPl+2vzT+zChN10sA/CLhItyg+mybdP7nm9hFj6m+DwZaVTbNZ bsryUj1yPVg5pNCIUcRHqh0/e2+Wq93R0WIIkBTzz+UC2dDil3J2Ztix/U9fWgvHrmg4 E7XuAX3cx7o8mxc04zknjSejnvbFR3u3IkQornvutBP9U3Pb40SVLge8/Vurx3gvDypd fTdY3VvvbSMzAfCN8xXQpS9YdQFgxolxY0VjA5TZ5r9dNfT9aQXFNF+LjpnrZbyVeC+f 5LWQ== X-Gm-Message-State: AOJu0Yzb5hKTORkGzN5htdWZ1aQ/sryCSvytJvFSx+4Aq3FMxjDBLhnO uvYxPGO6daY08oyD1gwoBs5lgHFGkih4YXMeWAE= X-Received: by 2002:a17:90b:4acb:b0:280:3650:382a with SMTP id mh11-20020a17090b4acb00b002803650382amr20588850pjb.16.1699326478123; Mon, 06 Nov 2023 19:07:58 -0800 (PST) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id 13-20020a17090a004d00b0027782f611d1sm6744883pjb.36.2023.11.06.19.07.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 19:07:57 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 66/85] target/hppa: Implement MIXH, MIXW Date: Mon, 6 Nov 2023 19:03:48 -0800 Message-Id: <20231107030407.8979-67-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231107030407.8979-1-richard.henderson@linaro.org> References: <20231107030407.8979-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102a; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102a.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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: Richard Henderson --- target/hppa/insns.decode | 5 ++++ target/hppa/translate.c | 55 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index 87db726d9e..22ec07f892 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -233,6 +233,11 @@ hsub 000010 ..... ..... 00000001 11 0 ..... @rrr hsub_ss 000010 ..... ..... 00000001 01 0 ..... @rrr hsub_us 000010 ..... ..... 00000001 00 0 ..... @rrr +mixh_l 111110 ..... ..... 1 00 00100000 ..... @rrr +mixh_r 111110 ..... ..... 1 10 00100000 ..... @rrr +mixw_l 111110 ..... ..... 1 00 00000000 ..... @rrr +mixw_r 111110 ..... ..... 1 10 00000000 ..... @rrr + #### # Index Mem #### diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 648c37fb28..2b471444d0 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2891,6 +2891,61 @@ static bool trans_hsub_us(DisasContext *ctx, arg_rrr *a) return do_multimedia(ctx, a, gen_helper_hsub_us); } +static void gen_mixh_l(TCGv_i64 dst, TCGv_i64 r1, TCGv_i64 r2) +{ + uint64_t mask = 0xffff0000ffff0000ull; + TCGv_i64 tmp = tcg_temp_new_i64(); + + tcg_gen_andi_i64(tmp, r2, mask); + tcg_gen_andi_i64(dst, r1, mask); + tcg_gen_shri_i64(tmp, tmp, 16); + tcg_gen_or_i64(dst, dst, tmp); +} + +static bool trans_mixh_l(DisasContext *ctx, arg_rrr *a) +{ + return do_multimedia(ctx, a, gen_mixh_l); +} + +static void gen_mixh_r(TCGv_i64 dst, TCGv_i64 r1, TCGv_i64 r2) +{ + uint64_t mask = 0x0000ffff0000ffffull; + TCGv_i64 tmp = tcg_temp_new_i64(); + + tcg_gen_andi_i64(tmp, r1, mask); + tcg_gen_andi_i64(dst, r2, mask); + tcg_gen_shli_i64(tmp, tmp, 16); + tcg_gen_or_i64(dst, dst, tmp); +} + +static bool trans_mixh_r(DisasContext *ctx, arg_rrr *a) +{ + return do_multimedia(ctx, a, gen_mixh_r); +} + +static void gen_mixw_l(TCGv_i64 dst, TCGv_i64 r1, TCGv_i64 r2) +{ + TCGv_i64 tmp = tcg_temp_new_i64(); + + tcg_gen_shri_i64(tmp, r2, 32); + tcg_gen_deposit_i64(dst, r1, tmp, 0, 32); +} + +static bool trans_mixw_l(DisasContext *ctx, arg_rrr *a) +{ + return do_multimedia(ctx, a, gen_mixw_l); +} + +static void gen_mixw_r(TCGv_i64 dst, TCGv_i64 r1, TCGv_i64 r2) +{ + tcg_gen_deposit_i64(dst, r2, r1, 32, 32); +} + +static bool trans_mixw_r(DisasContext *ctx, arg_rrr *a) +{ + return do_multimedia(ctx, a, gen_mixw_r); +} + static bool trans_ld(DisasContext *ctx, arg_ldst *a) { if (!ctx->is_pa20 && a->size > MO_32) {