From patchwork Tue Nov 7 03:03:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 741791 Delivered-To: patch@linaro.org Received: by 2002:adf:fd90:0:b0:32d:baff:b0ca with SMTP id d16csp1419566wrr; Mon, 6 Nov 2023 19:06:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IFQ7E93umhd4ZSPnMU9ZYUD/3hASL5Cil4XebSpUQ8tgy7jE1tH3J1E2scNIW79cEFX2pf8 X-Received: by 2002:a05:620a:4d3:b0:76f:98c:3f0e with SMTP id 19-20020a05620a04d300b0076f098c3f0emr28614211qks.68.1699326407300; Mon, 06 Nov 2023 19:06:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699326407; cv=none; d=google.com; s=arc-20160816; b=PcVZ+ftzXY9vvRQ15LELoLQ6uFiXgWRiTtqb0nErCedOa3RvTqfuRvO2DGyl+dFw8j R7qwYdqxt7/wYGYs3shcxZV2qFCIIq3zQZxyzNwVrAMosHVbAeIiWSpa7/j1Lz9+qpuW et/BTegPepa8oMxnlO13cvxGXEg+ToXk+eKW9Zu4jwmhtReqobNCRYbYXMU1mabTv+MM f8Y1TvXtZj+RzBnGoQdeGw7xG+8y67Fl+c6+HPEnYFXjpkSzVyPKqc1jE/QFGGjQ4+Mf yHVuPHrAMAOW34CSNAhd2i24Bl1YSCcS+7i4+QLfpa/9Sxgyvb+MZsiOOjrwOzr1i52L EUrw== 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=TlmvaxlY9UgjcMmC1xCbzus1zwL6bLCGJMO5gWkqRLs=; fh=wDljmxUHXfz9MGj2//jPHYRc53BMWF157v8rVKELrf4=; b=Vo+NBXUnyVmxFpXny9BJ92qCaTdsDSsGC2B+zkx/yv8eRj+IxlGa0y7pS4etP9UBv4 Dmxcp4I91Lko5bqi5Xu4r8wMhKJ9gz5xJI0xu87X9isx8PhYxwRfuNRWIbMJz0l9ueDe BRuVtcolWsrcdkpTWlLlh/dj23Q4Q7TrhCnGllA2VjghAY/rOmb2ew0XTWH4NxfRHmFt jDSTyjJOZbkF3MjmbxbdcPLmXPLZsSY1+3RxZrLcq2liTj4XM/oqAR7gx1V9xEWbx5dK JKLyQlPX/S394jJye2WS9tRSw2O/wfa1Epj5FulSREM9chcqts3/EH3mhoOu+3UEfL+s Oqng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Uu6a+Yz0; 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 x17-20020a05620a449100b007791b3962d3si6981162qkp.577.2023.11.06.19.06.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 Nov 2023 19:06:47 -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=Uu6a+Yz0; 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 1r0CPH-0008IV-SO; Mon, 06 Nov 2023 22:05:35 -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 1r0COS-0006ve-0L for qemu-devel@nongnu.org; Mon, 06 Nov 2023 22:04:44 -0500 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 1r0COL-0000gx-4n for qemu-devel@nongnu.org; Mon, 06 Nov 2023 22:04:43 -0500 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1cc68c1fac2so47703225ad.0 for ; Mon, 06 Nov 2023 19:04:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699326270; x=1699931070; 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=TlmvaxlY9UgjcMmC1xCbzus1zwL6bLCGJMO5gWkqRLs=; b=Uu6a+Yz0/xHITig+4XFllgz1mnlMYkosI7mOmVHWdKpJEF1slUKx3jRi9I59KfzBhG ApfGu/gG0iPzMpkx+Dm2/8YQp2XO3i0p9Ubv+7NyZXTbQCNB3WWJWrSlq64feqa3mv8K wzOWsGkTDQxN9vWiVtIvwT2CweMjYjUWznOxGsE4vakIhJWUjbk4Jn/Sm2rObqAijdgc QRao9NhQEOdxRtAFEDZ791zyd4SiMgT62MMZd5MSXpiLOMf+kvdNDJLMgd243RBgZDnp 9+INjd6o1lcX5wCaAtoh5T252yT10uHEna/ff0eeHb5wEFTI5JJ9lkltgsljdGYNN0ej 2iBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699326270; x=1699931070; 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=TlmvaxlY9UgjcMmC1xCbzus1zwL6bLCGJMO5gWkqRLs=; b=rhrT0T+QH5iQa1oMBTpDJlPZCVF5N/hhE3AUhGFE206uUJmIpjqVBJ0HFvVygp4Zpw xynhU/omln3iHlPNlVTwo8BSKaKNEP9yWWG+1Z4XHgcar9udnS2sLxwZ4BDKcHqdmMg+ 7sZO5BYn6nCbuO23O7lLdU4TrDm5qOm8KxFr5iiMTQOtQiiVfvsoahpGAOs0mdda/bLq 7rROCFwxfGcSdXhhX+JHeKa4iayNj6heNpqRBaTTV5bUqkOW0wNlM/JtMCLTf7X9WQ1i LQM/8GASWDiu6W/tLFw07YUJ4T9BjOd2mvomv7E+pDb4CPGL6CfrDERWCPGJpq19M7Nn lhTQ== X-Gm-Message-State: AOJu0YzcOvr8Zz8o40YNiiE9vzQQPb8OleopqQpsVHN3aDVW3kUYH1EE koq/I8eKJcI8HneCvKwBxPYohjBQxJRHuULgUBI= X-Received: by 2002:a17:902:d144:b0:1ca:28f3:5690 with SMTP id t4-20020a170902d14400b001ca28f35690mr28691841plt.46.1699326270462; Mon, 06 Nov 2023 19:04:30 -0800 (PST) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id u9-20020a17090282c900b001c72d5e16acsm6518012plz.57.2023.11.06.19.04.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 19:04:30 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Helge Deller Subject: [PULL 29/85] target/hppa: sar register allows only 5 bits on 32-bit CPU Date: Mon, 6 Nov 2023 19:03:11 -0800 Message-Id: <20231107030407.8979-30-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::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, 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 From: Helge Deller The sar shift amount register is limited to 5 bits when running a 32-bit CPU. Strip off the remaining bits. The interesting part is, that this register allows to detect at runtime if a physical CPU is capable to execute PA2.0 (64-bit) instructions. Signed-off-by: Helge Deller --- target/hppa/translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index cf05d8b6e4..1694b988ae 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2176,7 +2176,7 @@ static bool trans_mtctl(DisasContext *ctx, arg_mtctl *a) if (ctl == CR_SAR) { reg = load_gpr(ctx, a->r); tmp = tcg_temp_new(); - tcg_gen_andi_reg(tmp, reg, TARGET_REGISTER_BITS - 1); + tcg_gen_andi_reg(tmp, reg, ctx->is_pa20 ? 63 : 31); save_or_nullify(ctx, cpu_sar, tmp); cond_free(&ctx->null_cond); @@ -2237,7 +2237,7 @@ static bool trans_mtsarcm(DisasContext *ctx, arg_mtsarcm *a) TCGv_reg tmp = tcg_temp_new(); tcg_gen_not_reg(tmp, load_gpr(ctx, a->r)); - tcg_gen_andi_reg(tmp, tmp, TARGET_REGISTER_BITS - 1); + tcg_gen_andi_reg(tmp, tmp, ctx->is_pa20 ? 63 : 31); save_or_nullify(ctx, cpu_sar, tmp); cond_free(&ctx->null_cond);