From patchwork Wed Oct 18 21:51:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 735107 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1226350wro; Wed, 18 Oct 2023 14:59:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGHeefVU6LncvR5VPCNQuYX2rdc8dGHujKZiQ/1hjayAy/a92KNpbC/Paq4I0/Bc1148fxY X-Received: by 2002:a05:6808:1526:b0:3b2:e363:c7f0 with SMTP id u38-20020a056808152600b003b2e363c7f0mr489671oiw.37.1697666397352; Wed, 18 Oct 2023 14:59:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666397; cv=none; d=google.com; s=arc-20160816; b=Ww+oIPnum3RIOnDL/87UT230OW6tDhpYldMwO33rxLsmDBs2eBdYKamsGV1KNtx5qS BXhNvpkD/lkRuXlyr4FG8MH0D+mD/qZqsoB4uFXU5Nn5k4Qt57PVN2GWJXonfObUAq31 ZGCyy30WSRgKBlMUjsPIki/qGftp8lUfpCSnetTqV8w3DqV8HwJUfbRtT7WmwPRoLcP7 z8UMKZm6d3koXLThQH6pIsnu7DgqB5FY7wc23WO6riYwAZ2uuxt9LYI3+/EummkQyROw 01qo61D2DzhOOYlzj5/PV9+mFf1M2cl7snnrNpBuSqW9DS3Cv1m7bBTM58RYd3pv5isY U72Q== 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=fX4ajZFmvp6CPtzRyMzFGScgJS40L/02z7dwrdi6gaE=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=C3d0FrqB1TwaqD/9zxavUHKnOIQCRKRExZd5xY5d2Q/Z7QNZft/nDss5pGGVWQ37hF iaXL8NRtMMsjd+Lfwt1QLfFqmVLGB2TsjdQVxcV5VHUiPUrxzC5UD4Wo5rD3Q+Vu0eiC MDui/jKIbgdw7XtN107PpEFmucjM/S/4Tj198syKf47AmSBdcihqt1DJqhPPVu31Lvhn WvLl9CCr+BK8UGy4qr2INBlkcxVCnpeGyO9JHhbg7MymlQj7glFtbjRJ+Drw5h6dHV9x OUrWJ8JJHFst+tUcYAnxtmosOWk0otC57WfhEyALYxAYAuPZ/4B5+3r4cMj5SkQaqaX8 1fyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LdXupNzn; 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 im11-20020a056214246b00b0066d15c73fb1si707694qvb.285.2023.10.18.14.59.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 14:59:57 -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=LdXupNzn; 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 1qtEVl-0002GE-9Q; Wed, 18 Oct 2023 17:55:29 -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 1qtEVk-0002F0-2z for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:28 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtEVi-00056v-FL for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:27 -0400 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-6b7f0170d7bso4679475b3a.2 for ; Wed, 18 Oct 2023 14:55:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697666125; x=1698270925; darn=nongnu.org; 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=fX4ajZFmvp6CPtzRyMzFGScgJS40L/02z7dwrdi6gaE=; b=LdXupNzn2C3Ots7zMuGR37goXOW6fZI6BPK6uClqdg0cRmXP8WncgWrcaJeMU77ASn G4XhuUJ3dQ8mpipJSGF5HY5s67N9VQYAVKyMC9szzu44tGRj0PZ8A6V/h8aLnwrWPs7t fp9n3huHy8abYjARC1Dx0BPpXy0E3y/K+qm3qS7laiDZhHYC1/Jy9xL3v1jRKnlP+/qd zP9HzK8wHengvCzzpngYjJDA982Rhy6GXFAXsvC3xdL/n2wezvC3TVyBlqbd3fGIJVYs 69FwIjow6cwtcdg5g8fD0jD0ESceY3yUplsNvcZ13xWP745t4iuMmezI2gLnXSrHA1dx zHEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697666125; x=1698270925; 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=fX4ajZFmvp6CPtzRyMzFGScgJS40L/02z7dwrdi6gaE=; b=QV1USjRQy7FzxxSXQ6mraeU1+cG4UL4yDlso6ZcnDJnvhXq1geOQkJn3W+mEexx02W RDz0eEHHGD/vkJ+t+QVo0ElUyvar66wp/HeMlE1kYFMAGqc4srlL8XryzU3c59dTsIH4 U4E9nzBw8mrJQSVJfD9JZtG3dQoXF3hhA9wfuwMe2JPuJerxEvXJN+R5SYzEZbrSElIQ qx60ORg72Joox8cQfiMDc2la6iMSJZ5NzV64ksxbRrhdoJcgpKN7i5iqT/Xqh9YrvEzK rImRPWe/GhnhgohY9b7XsNwX+mLC5HCNKSqty8FnsQy1kfGYIyVtqIIcguR1WM/Pmbiv N1Yg== X-Gm-Message-State: AOJu0YwREn/zMEhwuAJltSl7Dmc/U38lxycpC/kP2PLTK76ITZWoqd++ rYArZ7gVK28TlOwcx5NQ+sO5CAEBa3ulBB5oa8I= X-Received: by 2002:a05:6a00:15d0:b0:690:28d0:b7b3 with SMTP id o16-20020a056a0015d000b0069028d0b7b3mr388786pfu.13.1697666125210; Wed, 18 Oct 2023 14:55:25 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r15-20020aa7962f000000b006889348ba6esm3796263pfg.127.2023.10.18.14.55.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:55:24 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 56/61] target/hppa: Implement MIXH, MIXW Date: Wed, 18 Oct 2023 14:51:30 -0700 Message-Id: <20231018215135.1561375-57-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42e.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.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 d7befbf73d..323e9275bf 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 b0aefecd2e..bd8a858da6 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2863,6 +2863,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) {