From patchwork Thu Nov 2 01:29:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740415 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp597784wrv; Wed, 1 Nov 2023 18:48:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEnAvRSxcblUyyrtOpGDJhKjp73KWQOX4i0jZR2A0RE3OzTFY6YWKPbmVolaRZbxyr4p9s9 X-Received: by 2002:a05:622a:d3:b0:41e:1974:7cf1 with SMTP id p19-20020a05622a00d300b0041e19747cf1mr20605773qtw.18.1698889684814; Wed, 01 Nov 2023 18:48:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889684; cv=none; d=google.com; s=arc-20160816; b=uDsyf6uGzm62mxC3oWFjcXFPuybg5GQDM4q84+58zSjX3hS2ZfPmTYEIvHUDVakWUd +idEEmvkMrp3vPtMOBTqU46zT/Z0NfZsBSfrDYhBVCOSoga2SlKpFhc9w+UNNf0N4sQZ wBVNFbSG6j6rVrKOBYapn5HHBjtJ6e2NTf1tVtEcmxovhNce+VPBL2gLOOifOVDStPrs k9Pav/ovAPZQIIMq6oHWmfJLvONc0agv+epbASICEKCx/6xxaXZ25vuzUdZ7XkuwVP6j +Kn5X0ZX5VcMVFXttSvQd2uOgWW0bAF3VKzwNJrMWIw5ZfHiic3NnastKtbHGB+AALw+ rfsw== 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=5dZJ/Avbvd5B1sVDHFkjz0KBLC9YCeO4NBIHCuQT/As=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=Mkcqme4D2s7W4i2fjRdlKGvv0Kaf+OSH5lkDZguNw8QLFnddi1626LwGOXXabz3vHb jCgzYY2jbC5W2rLxR5g3UjpGo2MQgEogH8WkW2ekebfh6AChDAu/a03LIxxv/de3mE55 Xpsx9V8/lhOKV1vUxZVyJXHop9VHzkNw3gQGBMeloiAo11IdKIC9EP5rCClCxKQTKkJn /MikG1NbRqzXz8uHOMWJQFXDaqP+3Qg+zbFIEhra68QAY52/x8A64HA7sIW9frK58e6L X0wEEf3Ies5yPOUrQJeAajm43np7u8oKpK70UBYHEFhu83fq29/Q1CoQ/RGeriKkg8B2 1WEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OaKkIT44; 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 f3-20020ac85d03000000b0041963cd47dcsi3667514qtx.38.2023.11.01.18.48.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:48:04 -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=OaKkIT44; 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 1qyMce-0000UY-6s; Wed, 01 Nov 2023 21:35:49 -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 1qyMbQ-0006pA-TS for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:32 -0400 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMb9-000230-QM for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:34:32 -0400 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1cacde97002so3131015ad.2 for ; Wed, 01 Nov 2023 18:34:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888854; x=1699493654; 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=5dZJ/Avbvd5B1sVDHFkjz0KBLC9YCeO4NBIHCuQT/As=; b=OaKkIT44AQB+MWrMxh3aPC3Vwg9cQYYR4Jq25qMrlbcCW0Q1UpL1jPBM3NTDo0Htsa 52kAnzBC/qtVYub8RXjs5V4MZpclNpUVFs0qnfEUabpahRypOMnK+sjyN8uYUMAGb1ZS qI8UBBu8cRBwuR2SvSnwbkUWgvHVwDS9AXQMEDF29x4klPS6W/EWmd/YhnzXZiv+ueQk gkQU6hgfVnNvFbY/jvXKlQjYh0dd0nQAF7DfjyvS3rr2wJVyXlwicyMbUBZXleFvReUr ZJW0xZAC6sMsinjyAFG3iiWv21AjSBjz5T0IR4tXkjJTfapn8bAd+paesKTaBQx4UuQF hXZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888854; x=1699493654; 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=5dZJ/Avbvd5B1sVDHFkjz0KBLC9YCeO4NBIHCuQT/As=; b=vtqwC6I6I6zwfveWf8CGQhtcdiNOm23gcYi65MWsqYd7NGi5NcxojmylyfejgbU9ln IZSPhBzzG377hMHFihiwqEdHrcSo2zJdUvfJbbuAAtXo0Xa/SKtAGG88wGPMZQocmYV8 Is/ZVEw/S1KURTR2A2E+JV6UBRafhB7RM20dKsfw4YERNHLRgGBeKABsMSqdq/wQ0UHy hvHMeoUmLJH3d3e4w/fNy2MCNNuJUSSynM6XJi1bsS2kdQmPcrEoCajF2xWKfYulwbO4 Yb3YRwNlr3kk2TKxs9G0ZaUyI4M784FTgUUCLpwMbmo5Cfdh4yMR44JIsmyR7rq/+3JD ukXQ== X-Gm-Message-State: AOJu0YwHebsmj/R7ViNpzW7RjD0h3HdshPxTVkgmXi4Cgh8JCz1GksMf y6yvI71MYxRHk68Hl9LiNJQvPtLaQMa4dG7jJhg= X-Received: by 2002:a17:902:d484:b0:1cc:361b:7b28 with SMTP id c4-20020a170902d48400b001cc361b7b28mr12470291plg.64.1698888854304; Wed, 01 Nov 2023 18:34:14 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id t2-20020a1709027fc200b001a98f844e60sm1918125plb.263.2023.11.01.18.34.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:34:13 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 66/88] target/hppa: Implement HSHL, HSHR Date: Wed, 1 Nov 2023 18:29:54 -0700 Message-Id: <20231102013016.369010-67-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_HELO_TEMPERROR=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 | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index 6959555bf3..bb5cd267b0 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 2fdd4448ae..d342df2dfa 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2789,6 +2789,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); @@ -2809,6 +2829,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);