From patchwork Thu Apr 25 00:00:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 791786 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:346:15ad:a2a with SMTP id g4csp1119608wrq; Wed, 24 Apr 2024 17:11:56 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVR/owsILm4G2sIRByE/Vs/L4WMzUigDY8u6j5oClLSNSyAAmzS4IfuG77vtSSbjsoewpNuHuVjLYFDrriZgdc2 X-Google-Smtp-Source: AGHT+IFA8vf+g9uBqeU2JTH3eKh//PcL9KZYi8We1VkOELEYZSL5kT0hWjsIAakoAaIcPBtx7EiN X-Received: by 2002:a05:6122:20a3:b0:4d8:7789:dd0d with SMTP id i35-20020a05612220a300b004d87789dd0dmr4512404vkd.15.1714003915917; Wed, 24 Apr 2024 17:11:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714003915; cv=none; d=google.com; s=arc-20160816; b=JB5iZa/P1ZNSDJKeS3/hmj+1DKsEdZ5wvQYzXzI0v06EtsD90RVHeL0o+nBvvBD6hN WOaNclxOV5sP6t/7EP8+Amo8S2EPXjg5T9UaM7gXpc90OZJ+wXlnqdkWKx7Fg8MV0YxB /FU29jU7EFU8cuZqjTEkM826kDFSpZT5baXvv8MO5Qg+8eZG/1JGmTj+eQI2QJnIq4oT RyKsTmFxvgPNY5VJDCpXxmXKEm66egENMy8fZLeO+f8fKfXCjza0TdHILFrcaFpEp97U o1OmCqGT8Z6SyZ4id1mmq7VcGK6ZuM4TGKhg6yiHTqIMXiYnVq/tSNecmRk9NveE4vgN ZI7A== 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:to:from :dkim-signature; bh=od3C8Is61jrhdrT5iIGSRyg1mQHZLFI1AAa4tyjr1AQ=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=LxmS+OYFFSUxO8VFkpPcXlxwf7G7VgORIc3eIdEeLrc5LwInu2n0piaYDn2FJTQLCv oUmw5JxES6N/LYVe9fQK/CjPSXK6kBlhUqvVS3sx80mceJ6Oiv47QZVN1BpKlHGEbv89 oX0eLfrpeXQO9ZN7sL+4OGD8MezKlNHMnQU+ruXzqEZ08h7FIOMnewqKGX8dXoTiQ/Uu 1yGrTE79mxAo721E8YoRrewHrqDYqZe5AOQCqZBSE4N8QSv4y3QnYsSSK7+jBvnL4jUY 4QHhYlTIU8r5cy+nAr/Q+Zc6nacbHngm0IC6YY9zoOB0qrg3d1KqlCgG7hVluvxaU3yZ NI3Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GLhvnZLs; 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 j29-20020a05620a0a5d00b0078f1530f4dfsi14695655qka.24.2024.04.24.17.11.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Apr 2024 17:11: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=GLhvnZLs; 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 1rzmYf-0000fd-5i; Wed, 24 Apr 2024 20:01: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 1rzmXx-0008J2-SD for qemu-devel@nongnu.org; Wed, 24 Apr 2024 20:01:06 -0400 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rzmXs-0006JR-MU for qemu-devel@nongnu.org; Wed, 24 Apr 2024 20:01:03 -0400 Received: by mail-pj1-x102e.google.com with SMTP id 98e67ed59e1d1-2a78c2e253aso372807a91.3 for ; Wed, 24 Apr 2024 17:00:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714003259; x=1714608059; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=od3C8Is61jrhdrT5iIGSRyg1mQHZLFI1AAa4tyjr1AQ=; b=GLhvnZLsI/3Z+uNKovnRt+BWaFkiBU+Ql4jGJyV7A9KBoEC3KG9Y6fkFwEF+kzpyEo cLYU94A7ekOeW20ChvbcD6xvQdTJpbjmN+VPpgj/q70egYOHFFr4+0LnVz7xGAxsLaTJ Jx9miizvppgXAMoeu2Z0Su16zAPZ1yIh238+XLaUWFuTtzRZ1xsJAMaHv5t/SQalBxnQ sb6DOY2FnxHxBlGryIdfmP/rINJh9/iCsahg5azPIp56098VHBfcD5HyJd360N3+03W0 +Xtitx3rIGEsz12YdSCHqqDnHlv9lEww+bMZnssUl6oWq8NUZ08+fzf0ZvFQ1820uP/H YQUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714003259; x=1714608059; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=od3C8Is61jrhdrT5iIGSRyg1mQHZLFI1AAa4tyjr1AQ=; b=nI8HnXGl/hoNWe8oz+3TkVy/dITAgBSNU6bZU7oSTsNDuYayXn8vRgRLyNcUJhJ6dG QPMtZBn2w+WswXQu42un50Z1Vrm1dPy/qxvVCZS90c0mfKHQ8LCb1JygYWCoCKHHU7xE aC4V//9nUlm5GBlLlepxAtzLuHKQgIXkrsvDWXYK82iFdfVgAgh6kVRVuY3k18RRr1t9 IEmdP8jLiO16xEYlOLAKJrakH2TGXL+klAn0jfNUNrmXi2YjZLU9qLNhzBagJS2z/eRP t7n0Y6R/SbcQ1hn1QMIOlcel4MPekL+vPQvpmQNdbsWdxlygOxZruvrA4ObXcpS2Gnfp rkBw== X-Gm-Message-State: AOJu0YyDFLf6U/ZsB/xJE4sY7+wFRwopiv3ZC7pJHRoShh5l9sdHZ8w6 b7mkp1kkIyd7zE0bCnBTLY7CiisjXoBf6fijRI2/nC8nUIbYbUr+1DkXTU8xKaevggWHktQQy+d 8 X-Received: by 2002:a17:90a:c244:b0:2af:9e88:d41d with SMTP id d4-20020a17090ac24400b002af9e88d41dmr1791320pjx.23.1714003259102; Wed, 24 Apr 2024 17:00:59 -0700 (PDT) Received: from stoup.. ([156.19.246.23]) by smtp.gmail.com with ESMTPSA id t6-20020a170902e84600b001e604438791sm12465715plg.156.2024.04.24.17.00.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 17:00:58 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 35/45] target/hppa: Split PSW X and B into their own field Date: Wed, 24 Apr 2024 17:00:13 -0700 Message-Id: <20240425000023.1002026-36-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240425000023.1002026-1-richard.henderson@linaro.org> References: <20240425000023.1002026-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102e; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102e.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 Generally, both of these bits are cleared at the end of each instruction. By separating these, we will be able to clear both with a single insn, instead of 2 or 3. Signed-off-by: Richard Henderson --- target/hppa/cpu.h | 3 ++- target/hppa/helper.c | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index 66cae795bd..629299653d 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -214,7 +214,8 @@ typedef struct CPUArchState { uint64_t fr[32]; uint64_t sr[8]; /* stored shifted into place for gva */ - target_ulong psw; /* All psw bits except the following: */ + uint32_t psw; /* All psw bits except the following: */ + uint32_t psw_xb; /* X and B, in their normal positions */ target_ulong psw_n; /* boolean */ target_long psw_v; /* in most significant bit */ diff --git a/target/hppa/helper.c b/target/hppa/helper.c index 7d22c248fb..b79ddd8184 100644 --- a/target/hppa/helper.c +++ b/target/hppa/helper.c @@ -54,7 +54,7 @@ target_ulong cpu_hppa_get_psw(CPUHPPAState *env) psw |= env->psw_n * PSW_N; psw |= (env->psw_v < 0) * PSW_V; - psw |= env->psw; + psw |= env->psw | env->psw_xb; return psw; } @@ -76,8 +76,8 @@ void cpu_hppa_put_psw(CPUHPPAState *env, target_ulong psw) } psw &= ~reserved; - env->psw = psw & (uint32_t)~(PSW_N | PSW_V | PSW_CB); - + env->psw = psw & (uint32_t)~(PSW_B | PSW_N | PSW_V | PSW_X | PSW_CB); + env->psw_xb = psw & (PSW_X | PSW_B); env->psw_n = (psw / PSW_N) & 1; env->psw_v = -((psw / PSW_V) & 1);