From patchwork Thu Nov 2 01:29:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740371 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp595089wrv; Wed, 1 Nov 2023 18:37:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEWynsuIIQUBaROTqWLSjl1yxQtLoqONShxW5da4poQib9f/2NJlJuT9agaImPeHpEx8/7o X-Received: by 2002:a05:620a:4247:b0:76c:a952:c70f with SMTP id w7-20020a05620a424700b0076ca952c70fmr11307168qko.35.1698889065939; Wed, 01 Nov 2023 18:37:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889065; cv=none; d=google.com; s=arc-20160816; b=V8Vjf1wQ0G5MQjhYIGkCcdQR22iVrRxfP6z/uMF+vd+s/5rIk1bds7AxDYpwZbqa2a enS6mEbOp1oiWvF16GRVqiN5RR1g4WTG24U/Vvt7L7xWhWPsd8Sa2c4rlecT7yj8DJF1 7v3jA05c+4uDA+CSJjElTXAO8zZ0/McJQVF00w7JsmCpNiyl+/Or3L226b6but5/Tfa4 yVJ/JlXgv+mwhnq/Jiyba2hf4FCuI3+J9L6Y+dh9ZDchMbpAVaQjfcD+GSuO8ORoEync i5TieAhBR1Je05yExF91z3BSdZgW5N148gPmoMwplaZe8H/ExLe1ZRbI6tVKr+rC0wmD Q3vQ== 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=XBkHVGjqIu3LTEV2zzgvwaws1GKhji4cesKfRpz1I/k=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=QWnNUHhH1gp6a2m7IeVTj7rSE2m8R16DEsIWAKpf7cNKGshg9+nyJANMDSoDEtdrox g2DzhbHTI3J2sikxY5PJVqLI/AcrOfsJ3NtNYhREt9kXoCfzA6G9meWhSnxD6+eoZkmh KHKi2CVMRCxMwY04145Fz8VfbqQMRMxXg9LHGvHNEZdSeg4uE4+tweNfrsOjKGmzrSnH nT9PxMA0l1kiXy3/hvcEIM9TEwNaFskFz1L5N/+p3HZzlg/MVHJVQVKgap+BOhU4bFNa whEAb6dtGYVoT03jWJs2hKdqS3T96n1L+YD6Qb/S4l3/i1P9kdSPDDavLV3wcNSNwGRp FMow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ua+mQrmm; 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 bl15-20020a05620a1a8f00b0077a02a27b8fsi3735131qkb.354.2023.11.01.18.37.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:37:45 -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=ua+mQrmm; 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 1qyMXi-0005iP-Gm; Wed, 01 Nov 2023 21:30:42 -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 1qyMXh-0005hs-7r for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:41 -0400 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMXe-0001ZC-6d for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:40 -0400 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-6b77ab73c6fso382112b3a.1 for ; Wed, 01 Nov 2023 18:30:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888636; x=1699493436; 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=XBkHVGjqIu3LTEV2zzgvwaws1GKhji4cesKfRpz1I/k=; b=ua+mQrmmJjck9B4ZG64z/Bxmt97A3n6uyO8u/0jvXU4sR1HNQ/UtWz9LC6ZYYcpaGE s7XM4F8EJ75dRB/ahrIEk93VOx7LJpv+D/3cVXgi59cH9p3Z/NJzc7TNPSvbT22zwKp4 tzS3ZIp0+GaiB4r3AfTV68fm82en0r61XZDxTRx7+jjmc838a4xu9zSI5/1UCEAYwtQ2 7DHma6C+3UmJKuHUvrjdFPKxueSOezO2IyLTBQ+nmjHgTyx1VBhEw+9nzknqaoD1cENv jkOjfcQmpbGcJmHyN4Ur+taP3aSSGMFJ5lUb8gojRXgxnqyEMgqYkALLknm7JJ/DHiei ++Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888636; x=1699493436; 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=XBkHVGjqIu3LTEV2zzgvwaws1GKhji4cesKfRpz1I/k=; b=u4Z2TOErNK469fu4ILyfuKC6hf5udkFu75rcNi5pQo2/VdO6baIuUlp1Nb+sKnPW9P yOY/CRrDcxYQabmE+7CrlzwazWrj/XyPIJh0JtTFiE+o//qhDUsDdzwcszoQ6Wj+mF6b nONiSMZuXbAYyRp5hNltbTkEzqOx//ZF77ZO8rcIwBzNV/gAW0BsWMsv7zub34t+OxzB uamiw7aOKzTknwGu2hJrRy/87JjFbcSmIKyUT+I96Ed86TvOpm5ZGjPqi4ZrrEr5Kt9W Au6MjwB9BGwqMyLRvogb/nV+Yd6sA9kq1FEAZ1kaUbsdqzpOb2z86ZyFS3tnqPbutt6N KBxg== X-Gm-Message-State: AOJu0YybLgNEjMi1tDexa/Fdre4mqnw3Y58vEZMUxeyXqH5VlMNn3jLz xsdH5i0XMHpjU6KBDB+5cGWZZlptU55j8HnyGcI= X-Received: by 2002:a05:6a00:1f13:b0:68a:48e7:9deb with SMTP id be19-20020a056a001f1300b0068a48e79debmr6582000pfb.2.1698888631779; Wed, 01 Nov 2023 18:30:31 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r23-20020aa78457000000b006979f70fdd5sm1784191pfn.219.2023.11.01.18.30.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:30:31 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 17/88] target/hppa: Fix bb_sar for hppa64 Date: Wed, 1 Nov 2023 18:29:05 -0700 Message-Id: <20231102013016.369010-18-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::42f; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42f.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/translate.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index b0cd12a2d0..ffa367b91f 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -3073,14 +3073,21 @@ static bool trans_bb_sar(DisasContext *ctx, arg_bb_sar *a) { TCGv_reg tmp, tcg_r; DisasCond cond; + bool d = false; nullify_over(ctx); tmp = tcg_temp_new(); tcg_r = load_gpr(ctx, a->r); - tcg_gen_shl_reg(tmp, tcg_r, cpu_sar); + if (cond_need_ext(ctx, d)) { + /* Force shift into [32,63] */ + tcg_gen_ori_reg(tmp, cpu_sar, 32); + tcg_gen_shl_reg(tmp, tcg_r, tmp); + } else { + tcg_gen_shl_reg(tmp, tcg_r, cpu_sar); + } - cond = cond_make_0(a->c ? TCG_COND_GE : TCG_COND_LT, tmp); + cond = cond_make_0_tmp(a->c ? TCG_COND_GE : TCG_COND_LT, tmp); return do_cbranch(ctx, a->disp, a->n, &cond); } @@ -3088,12 +3095,15 @@ static bool trans_bb_imm(DisasContext *ctx, arg_bb_imm *a) { TCGv_reg tmp, tcg_r; DisasCond cond; + bool d = false; + int p; nullify_over(ctx); tmp = tcg_temp_new(); tcg_r = load_gpr(ctx, a->r); - tcg_gen_shli_reg(tmp, tcg_r, a->p); + p = a->p | (cond_need_ext(ctx, d) ? 32 : 0); + tcg_gen_shli_reg(tmp, tcg_r, p); cond = cond_make_0(a->c ? TCG_COND_GE : TCG_COND_LT, tmp); return do_cbranch(ctx, a->disp, a->n, &cond);