From patchwork Wed Oct 18 21:51:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 735123 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1227386wro; Wed, 18 Oct 2023 15:01:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEvR8g0x5M5Gq1p+3T+qlcsaA/0JDILP1pt+nT8JaXPIQIBcKYMm9DRi5z6N7Jfmr58kx+y X-Received: by 2002:a5b:e89:0:b0:d9a:c946:c18a with SMTP id z9-20020a5b0e89000000b00d9ac946c18amr657660ybr.28.1697666515650; Wed, 18 Oct 2023 15:01:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666515; cv=none; d=google.com; s=arc-20160816; b=WLTKS5Ky0W8EvDW3UPVvC5SQ30nZUaPYBGTRPPS16N3td0+FIiX741FFUyoOnfu56l sa30hxdQLAbgFKb5iweBmSbcEZQ+9suOwdQqKyICMtzdN5BIiR25ymyOyhcdcE2AUmB3 xO7iHDAAilFTnwCAG29gpfGrCMZKL+9NOF4q7iMgk9vH1WnY5qkoES9WyyFi6gSxEpC1 DAlA+qLj4nhYv4HpTgVs6tKwsvsWeaWVmxWHU4nZ9c5X2MeyzA3tjpPbDTEZAVYLOHut J5ea8Vg+Wj2b5agdznTi/J6AA+XPtXbocsS8VbLtvF8AggVc6/b9Wuet2+g7/VAa0Tor CSAg== 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=C8gelUNFkNxUiOo/PW3mwBHCQ9wwJJl5VkUEA5tOyCI=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=S9tOZWAjHDfw5ji+7Ky3tPrwHAEWAXbA4m87oQF18LDhCVvYwZgGrnNG3duE4HOwka 4r/vi9xFC6kFJW2D4wK7WaE85GLlfU9Gk+mhotGeTdJ7yeB6jjmkV7CinCKz2DqqYgUJ hftq/hf9TpforI7ojZzVPkYCiJelykPNucKyvSFvYgZlpvKNU6gSDyyZGOKVXPk9iJsT pxA3RAOfLCTcnrnI5A1zDmhxSn3gHXSl8SyQc+3lGzK4wcNClYELC19F+ohFqzD+b6mZ c2gbgjVS4zVYj5WMogMjaS9B5YfCxJ06ZhQ/obbNi/Zj983Ljpv3KMwczu9lBYTxp06B Q9yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ylqou8Gk; 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 bp34-20020a05622a1ba200b004181e759a6csi575148qtb.597.2023.10.18.15.01.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 15:01:55 -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=Ylqou8Gk; 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 1qtEVj-0002Ef-Ci; Wed, 18 Oct 2023 17:55: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 1qtEVi-0002E5-IZ for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:26 -0400 Received: from mail-oo1-xc2c.google.com ([2607:f8b0:4864:20::c2c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtEVh-000561-0D for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:55:26 -0400 Received: by mail-oo1-xc2c.google.com with SMTP id 006d021491bc7-57bce354d94so3791014eaf.2 for ; Wed, 18 Oct 2023 14:55:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697666124; x=1698270924; 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=C8gelUNFkNxUiOo/PW3mwBHCQ9wwJJl5VkUEA5tOyCI=; b=Ylqou8GkiBxYC1OqFb5d9Of59YmiLOVt7RX/p/7BZjUs1gJViOJAlITaVk3Wafxy0F j+bPCfqcRs4qAWo3at8fEXXtcNQboYynr4Q2vJtaDBYP2zdQIAHBDcvLM9boenPYGgFk PZ/EMB5nmMBZxwmTOUI02JTygDXkaJf9j5C+2BCJdVjtCk0iqZYd6d/Q1RleWDvD78bi w4EcFAf5QS7M0kGhXeEAoqXMBi10JVvKGNjK2zMIZo5SezG2VuVW+FyAryh9GIwsC05V L+UOiLGtaRCnh+gh4bOYec8uJhlIjd1KYZOQcjajhRFUwjKWL3iopSJIAv7TtUtRacMn pEHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697666124; x=1698270924; 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=C8gelUNFkNxUiOo/PW3mwBHCQ9wwJJl5VkUEA5tOyCI=; b=LktfQGh4PohYIziMerRZQnfWgTN9lf69F5cBXzydybcvhYHoe3vFD3WgFr1n1rqMKj uNIBFsmqK2q5nLQBWSwJmOt9Hny28I0rx3t3TeV2gq9s4omE73ECiiJtV41iEdfqbY7P 4n80+ZuAHPGHhyFhOImO3E7105CmGTR/YUPRtxT6xJP8A8+XTDX864nspl/hjUbjXI67 8N7k6jha33vlctvzr34KB8Ea3ZZllf7j+ys0l2yNAX1fPGFxSJcIRBpLxNNLeLmSavik TXF9R76CeZgJnmqvjzxeHfMIR35c5E31DcDrIiBUh+PxAJqngxxAFv4PM/HV0nu2b1Ba IcwQ== X-Gm-Message-State: AOJu0YyGM2BVgcuG7HcKYBEW3iUSf08Fh8Vn3QXmkWx7jmUAURGn1D9V MoVNfqQ5MOEvJP1O57hZDMTEcl/uSYEs5CbhEsA= X-Received: by 2002:a05:6359:100e:b0:12b:e47a:8191 with SMTP id ib14-20020a056359100e00b0012be47a8191mr249750rwb.16.1697666123735; Wed, 18 Oct 2023 14:55:23 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r15-20020aa7962f000000b006889348ba6esm3796263pfg.127.2023.10.18.14.55.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:55:23 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 54/61] target/hppa: Implement HSHL, HSHR Date: Wed, 18 Oct 2023 14:51:28 -0700 Message-Id: <20231018215135.1561375-55-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::c2c; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc2c.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 | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index fb0f9d6dbd..f0c4866ca2 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -69,6 +69,7 @@ &rrr_cf t r1 r2 cf &rrr_cf_d t r1 r2 cf d &rrr_cf_d_sh t r1 r2 cf d sh +&rri t r i &rri_cf t r i cf &rri_cf_d t r i cf d @@ -216,6 +217,10 @@ hadd_us 000010 ..... ..... 00000011 00 0 ..... @rrr havg 000010 ..... ..... 00000010 11 0 ..... @rrr +hshl 111110 00000 r:5 100010 i:4 0 t:5 &rri +hshr_s 111110 r:5 00000 110011 i:4 0 t:5 &rri +hshr_u 111110 r:5 00000 110010 i:4 0 t:5 &rri + hsub 000010 ..... ..... 00000001 11 0 ..... @rrr hsub_ss 000010 ..... ..... 00000001 01 0 ..... @rrr hsub_us 000010 ..... ..... 00000001 00 0 ..... @rrr diff --git a/target/hppa/translate.c b/target/hppa/translate.c index b3335ba595..b912673531 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2761,6 +2761,26 @@ static bool do_multimedia(DisasContext *ctx, arg_rrr *a, return nullify_end(ctx); } +static bool do_multimedia_sh(DisasContext *ctx, arg_rri *a, + void (*fn)(TCGv_i64, TCGv_i64, int64_t)) +{ + TCGv_i64 r, dest; + + if (!ctx->is_pa20) { + return false; + } + + nullify_over(ctx); + + r = load_gpr(ctx, a->r); + dest = dest_gpr(ctx, a->t); + + fn(dest, r, a->i); + save_gpr(ctx, a->t, dest); + + return nullify_end(ctx); +} + static bool trans_hadd(DisasContext *ctx, arg_rrr *a) { return do_multimedia(ctx, a, tcg_gen_vec_add16_i64); @@ -2781,6 +2801,21 @@ static bool trans_havg(DisasContext *ctx, arg_rrr *a) return do_multimedia(ctx, a, gen_helper_havg); } +static bool trans_hshl(DisasContext *ctx, arg_rri *a) +{ + return do_multimedia_sh(ctx, a, tcg_gen_vec_shl16i_i64); +} + +static bool trans_hshr_s(DisasContext *ctx, arg_rri *a) +{ + return do_multimedia_sh(ctx, a, tcg_gen_vec_sar16i_i64); +} + +static bool trans_hshr_u(DisasContext *ctx, arg_rri *a) +{ + return do_multimedia_sh(ctx, a, tcg_gen_vec_shr16i_i64); +} + static bool trans_hsub(DisasContext *ctx, arg_rrr *a) { return do_multimedia(ctx, a, tcg_gen_vec_sub16_i64);