From patchwork Sat May 4 15:39:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 794626 Delivered-To: patch@linaro.org Received: by 2002:adf:a453:0:b0:34e:ceec:bfcd with SMTP id e19csp190243wra; Sat, 4 May 2024 08:41:24 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXU8z7lK8wmMU4YXKsrrSEUhmysfCGl2lWR1UoRKEtsnIhvozChIf/wRfJ2qaEusXF851nTmqqQqDIWJI0PSi2P X-Google-Smtp-Source: AGHT+IGErNd2BWwAhjxTlmFWkXfur3uv/e6ixLQEWurbWto81KiPXgpw6gLaYWeUvM9FgLQY3AhL X-Received: by 2002:a05:6214:ace:b0:6a0:c950:437f with SMTP id g14-20020a0562140ace00b006a0c950437fmr6428474qvi.12.1714837283908; Sat, 04 May 2024 08:41:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714837283; cv=none; d=google.com; s=arc-20160816; b=S0Ow+YtxnOZ8egEq+N9SC1wYpJ9axmCEZYHCp08Tx6A77p6bFDulsGenSBgHaUTK6y JElS6xVQv8LBoPMOUmheoH9T3DAIp77MPZ6A9MKvJi5xNfsBnCnN6YdMG/b8NgQa6bod tMDtQYStCp+XP2rXunrCnpkxLTfARPx32Mk6byUfeBJ16fFXTgEGz32V5szIqWbxFdXq AoAHY67v7lefT7DKBjxBYFH6BIzDGPbGUziHqzBh9H7kyI8J8hMoYYixnEv4047Bg/0c pqO4M9boh2DvomqZfqjlYocsBL4Ej+3cq0oQU+3gJ4KpPYhFh1E/kLRBuv+tbfgXrwkj 4lrw== 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=Szn3u2DiPc63NcxLhhS13Pf/pn94U3NtwmvgmtkOMv0=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=sUVt7QI8IYJFGFrzUXCWxorIo/tC0FhXJDu0ec8ktyK2veemv1YT9M0WROGOdUYz/n FgUgfy932ZRMkuiWC2kyWa3BoC+5a5ApA/tswaZRm6qyryKDEg4G+5bvtoAvQS2J5SaO iREouyzhuVxv2KHwGgamkrmUyTDGxbiVm3dReJsL1r1oZTnq89GCuLcyzL5cfdRz+rpE EXjPJtzg76NihV1UF+QReFjzc56JaGvvAJEY8GZuCv68eYjmI4HQPUv3djhnRxe5SYI9 Aa4FrBuyBYa8bH8cOgUxFGKLXIOzR731BknwwQYEv1S3A8r6NHE0+JfNLIBjbcaPsB31 Rfrg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=A4RgGxdo; 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 y16-20020a05620a44d000b0078f08b40faesi6398063qkp.690.2024.05.04.08.41.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 04 May 2024 08:41:23 -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=A4RgGxdo; 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 1s3HU6-00021z-DQ; Sat, 04 May 2024 11:39:34 -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 1s3HU4-000212-Md for qemu-devel@nongnu.org; Sat, 04 May 2024 11:39:32 -0400 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s3HU3-0006E7-0R for qemu-devel@nongnu.org; Sat, 04 May 2024 11:39:32 -0400 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1ec5387aed9so5050045ad.3 for ; Sat, 04 May 2024 08:39:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714837169; x=1715441969; 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=Szn3u2DiPc63NcxLhhS13Pf/pn94U3NtwmvgmtkOMv0=; b=A4RgGxdokgoN1VDX1GtAlAPBdO428KEt19LREaFXJGYzx5H7HbDbbX3/5t6cQ2kJui PuPNcyE8NrT1+jyM9FCtUIeIgJLmcX83jCTLLo5bdXFQPurkH7iyAReFHiohvvnWUjpz fpEcnCPgIq5A2VgBQhl8+ZqaMjWBIuyIHEk7CzE90111DIO3Ruuok6qNM6XbdQywIgLl wheIHLKIJQcBEM2hsowos9jvwpg/poNyUIGkeOMHvE/0INP5Qc1HYhrY+wp/KhhvxzQ3 W0CybZBAU1avVyAetD6E/hdVDSU2j7J5hVR9ZIl8FPWptKzoDSgC0bMMXkSWsWKKA2/f Tbsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714837169; x=1715441969; 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=Szn3u2DiPc63NcxLhhS13Pf/pn94U3NtwmvgmtkOMv0=; b=rtfnDYhjk7jbCA+FAuKH0W4//yHfSE1s1zlHU2Za86yagjROFLOjtBQ83p5ECGtRTB 4/WFJHWtOLgTDGJWtaQHKj0eYg8V7PnEW9ObFM4BMfDjuZYPWYNUSFnrkG9SRHkAVnqk mthnuCu9yEgHELyTPK2aHilj4TdTfAjO0pPDlEYwIu9jma9TcagRtXvHzzdTvE2JxMZT HPBGRPhSOsyIWn0mFR5hr/MSe1Dk1qZq8OqqlQAsJ9UCBs+WarJVx6/rVgzN3bcxxmm9 XpS8wpwtErKid2GT5mCv39GqE48TY4+9n46DlHF/aEnXrCn8KIxX1euG9NBJC9H53AkY 6Jbw== X-Gm-Message-State: AOJu0Yxbu3BxijYxYQVJUHL1Xq3U3Px+P7ecWrOjUnmpVwGOxOhfgncn SNkIPrTGyZMrQuw9TxrxeJtarU1ZEzX5mZdKMr/avWEWyy0C/0TopfNc5bnlQNxDLD5OGT5ZLaR d X-Received: by 2002:a17:90a:ac18:b0:2b2:9d08:80a1 with SMTP id o24-20020a17090aac1800b002b29d0880a1mr5241359pjq.33.1714837169188; Sat, 04 May 2024 08:39:29 -0700 (PDT) Received: from stoup.. (174-21-72-5.tukw.qwest.net. [174.21.72.5]) by smtp.gmail.com with ESMTPSA id n15-20020a170902e54f00b001e4d22f828fsm5197859plf.33.2024.05.04.08.39.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 May 2024 08:39:28 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 1/9] target/alpha: Use cpu_env in preference to ALPHA_CPU Date: Sat, 4 May 2024 08:39:18 -0700 Message-Id: <20240504153926.357845-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240504153926.357845-1-richard.henderson@linaro.org> References: <20240504153926.357845-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x630.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 ALPHA_CPU has a dynamic object type assert, which is unnecessary considering that these are all class hooks. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20240503072014.24751-2-philmd@linaro.org> --- target/alpha/cpu.c | 15 ++++++--------- target/alpha/helper.c | 8 ++++---- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c index 05f9ee41e9..f98d022671 100644 --- a/target/alpha/cpu.c +++ b/target/alpha/cpu.c @@ -28,25 +28,22 @@ static void alpha_cpu_set_pc(CPUState *cs, vaddr value) { - AlphaCPU *cpu = ALPHA_CPU(cs); - - cpu->env.pc = value; + CPUAlphaState *env = cpu_env(cs); + env->pc = value; } static vaddr alpha_cpu_get_pc(CPUState *cs) { - AlphaCPU *cpu = ALPHA_CPU(cs); - - return cpu->env.pc; + CPUAlphaState *env = cpu_env(cs); + return env->pc; } static void alpha_restore_state_to_opc(CPUState *cs, const TranslationBlock *tb, const uint64_t *data) { - AlphaCPU *cpu = ALPHA_CPU(cs); - - cpu->env.pc = data[0]; + CPUAlphaState *env = cpu_env(cs); + env->pc = data[0]; } static bool alpha_cpu_has_work(CPUState *cs) diff --git a/target/alpha/helper.c b/target/alpha/helper.c index d6d4353edd..c5e4958f8b 100644 --- a/target/alpha/helper.c +++ b/target/alpha/helper.c @@ -124,7 +124,7 @@ void alpha_cpu_record_sigsegv(CPUState *cs, vaddr address, MMUAccessType access_type, bool maperr, uintptr_t retaddr) { - AlphaCPU *cpu = ALPHA_CPU(cs); + CPUAlphaState *env = cpu_env(cs); target_ulong mmcsr, cause; /* Assuming !maperr, infer the missing protection. */ @@ -155,9 +155,9 @@ void alpha_cpu_record_sigsegv(CPUState *cs, vaddr address, } /* Record the arguments that PALcode would give to the kernel. */ - cpu->env.trap_arg0 = address; - cpu->env.trap_arg1 = mmcsr; - cpu->env.trap_arg2 = cause; + env->trap_arg0 = address; + env->trap_arg1 = mmcsr; + env->trap_arg2 = cause; } #else /* Returns the OSF/1 entMM failure indication, or -1 on success. */ From patchwork Sat May 4 15:39:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 794629 Delivered-To: patch@linaro.org Received: by 2002:adf:a453:0:b0:34e:ceec:bfcd with SMTP id e19csp190354wra; Sat, 4 May 2024 08:41:48 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUl9jPuidR8aWvQi9yvdBf84YJ41BnKuHP+Xbi6hx+PgFs5cHZv2XCFfXlpfdm2cWLaCfoHW7XqI9yLiPGsae8n X-Google-Smtp-Source: AGHT+IGP6aoRso4JkmM8P25lQq4YHwSjzFmTpT3y3xxciL2S9/XoWIEgTX3sUox0FfvPiQ3V/Jn6 X-Received: by 2002:ad4:5de6:0:b0:6a0:64ee:e40d with SMTP id jn6-20020ad45de6000000b006a064eee40dmr10399341qvb.22.1714837307932; Sat, 04 May 2024 08:41:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714837307; cv=none; d=google.com; s=arc-20160816; b=Tc3feHbeS486kU2l9NE75VDK9L10jC4jxdd2UN+qh+VhXGfIs6UDGhMUzF1G6s/gR3 Xbo5CXkmQRE4pSkj/CF+dYX5RtdhPdtrsJj1S4nU/cPpLJt7q8kzyx4kLLNkiGcSk/k7 7+A24hHUSw7IGh2wq2jKZBTQjLssHgsCjkKPAhQpF8fnG+hA6o6EFml+yIb6UToDwP6Z W8Is9cDAnoxTi7ZpTONk8PzMbkHctHmuqJBPrOZW+PlN25h+x4eOOoueh04ZUK+ZwQcP QwStMBGKBcAMHMoSGDJTrCuPZ3jHJpn0IGKVfkjwwXoF/Ru+Y/gp6HB+yvk3Y9bn3zsj 3epQ== 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=p/6g7IPHM26fk2SatJJUV9sUQh1e0SSWEbxZZLoVbHA=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=fAXyADOMZ2atz+70cFykRFi/U1ddLei4zONmNMXDdnGiFgjzxf4acP1nTYn7zZ9Fem 84Ghn/J8O2ihPgc7TvLZv/d9HJH6Noy7eCV9C67TGtSoJoKQwJNsoSHc04gw6p/+q3Jb oRsGnUse46IwXI4hVbQX6s06dGgU4cRY9O4FW+ev9u9opTSAm99d7XMDhtva84xbyB7o DhwxkCqOHuHspTzcendkU0c2qpy43W45hRFd1J0J/K0D4+aFhTC+dzFOdWWaLL1vCf9f mJs2DBvQZa397X3rRodHUoppXz4XNEiNuYF9xPuwHAyFcbmMcAEp3KcXObyPhD5wEBNL 7slA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=F1sIB0CN; 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 eh27-20020a05622a579b00b0043b026fcecesi5177755qtb.806.2024.05.04.08.41.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 04 May 2024 08:41:47 -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=F1sIB0CN; 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 1s3HU7-00022R-N2; Sat, 04 May 2024 11:39:35 -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 1s3HU5-00021J-KQ for qemu-devel@nongnu.org; Sat, 04 May 2024 11:39:33 -0400 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s3HU4-0006EC-4l for qemu-devel@nongnu.org; Sat, 04 May 2024 11:39:33 -0400 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1ecd9a81966so18850285ad.0 for ; Sat, 04 May 2024 08:39:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714837170; x=1715441970; 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=p/6g7IPHM26fk2SatJJUV9sUQh1e0SSWEbxZZLoVbHA=; b=F1sIB0CNuDpGOPLpd19Zc97N4nLD594fe8PbPGvT44rk6PVG2BerYQ2q/+p1R0QLHh iZ1jkoFNIGeqqBP91+KU2VxJG1ddcXGKPXFGCUA/zGJdTH3m2N2W5xP81dnNkZ05lzra J2zuBNOW+HhXfpd6rucpXWO6y6s46rJ+IU9cbWypBxfvEMb69CSKjEcl0qNy6m9LA05n QS/ONzJ/rs3aTVDHfI0C6jnJZ+8FMgrO9ChOh3XzA/F5DE8L/b5G10Oa4rI95rdmkT9n l3S+xC6V2I3Vrwk8G8+szA5y8P0SX9Q7tzJXYyLmBRGMGkDJoZvajUJTzbdB3DngKtax yRjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714837170; x=1715441970; 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=p/6g7IPHM26fk2SatJJUV9sUQh1e0SSWEbxZZLoVbHA=; b=Tr0YOu7uNoVUU2P55k6bCE6oSZNXX8n+Vt0zBxv5atzLMkGeEfgzTjw8/y3nZEt9vf hXPPKxF2V7wma4MKKVMigxE9GgXSCbTaScAqJ7vM4hwAvtPv097baJWutDNVIb+xhfxQ ULtazMwsZGBma4Ja8NEuvnwPImILqmWZnzXVSYZA7+AXoQMFh9xzd9MA68+AmiUbjZai 74qWklds2flXUVZ1SBYVNoRlG6DijvrrlOi7UeULXcL9ygMsVFVodVJ0QKTKKtFY/zeC U1jgNIye96fIl6ygzwLcsLL0royJmcC8RcQUB4e5dctraJDTPgXD35HQfNzwWgOgmHtf 56HA== X-Gm-Message-State: AOJu0Yx0LRyosWkxJgp8YrlZ13hZbQiuUuoarEOf+MQfuCjV2/nNeoCY EVeJ4SgwFm4EF7B2BnRHzul2NdEaWQGQRfAVY7FauReWoZp04efqmih7tcbOQQhCYk/qNQ3MoUh 4 X-Received: by 2002:a17:902:e752:b0:1e3:ce12:ef77 with SMTP id p18-20020a170902e75200b001e3ce12ef77mr8437938plf.11.1714837170177; Sat, 04 May 2024 08:39:30 -0700 (PDT) Received: from stoup.. (174-21-72-5.tukw.qwest.net. [174.21.72.5]) by smtp.gmail.com with ESMTPSA id n15-20020a170902e54f00b001e4d22f828fsm5197859plf.33.2024.05.04.08.39.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 May 2024 08:39:29 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 2/9] target/alpha: Hoist branch shift to initial decode Date: Sat, 4 May 2024 08:39:19 -0700 Message-Id: <20240504153926.357845-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240504153926.357845-1-richard.henderson@linaro.org> References: <20240504153926.357845-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::629; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x629.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 Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20240503072014.24751-3-philmd@linaro.org> --- target/alpha/translate.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/alpha/translate.c b/target/alpha/translate.c index a97cd54f0c..52c2e6248b 100644 --- a/target/alpha/translate.c +++ b/target/alpha/translate.c @@ -432,7 +432,7 @@ static bool use_goto_tb(DisasContext *ctx, uint64_t dest) static DisasJumpType gen_bdirect(DisasContext *ctx, int ra, int32_t disp) { - uint64_t dest = ctx->base.pc_next + (disp << 2); + uint64_t dest = ctx->base.pc_next + disp; if (ra != 31) { tcg_gen_movi_i64(ctx->ir[ra], ctx->base.pc_next); @@ -455,7 +455,7 @@ static DisasJumpType gen_bdirect(DisasContext *ctx, int ra, int32_t disp) static DisasJumpType gen_bcond_internal(DisasContext *ctx, TCGCond cond, TCGv cmp, uint64_t imm, int32_t disp) { - uint64_t dest = ctx->base.pc_next + (disp << 2); + uint64_t dest = ctx->base.pc_next + disp; TCGLabel *lab_true = gen_new_label(); if (use_goto_tb(ctx, dest)) { @@ -1382,7 +1382,7 @@ static DisasJumpType translate_one(DisasContext *ctx, uint32_t insn) real_islit = islit = extract32(insn, 12, 1); lit = extract32(insn, 13, 8); - disp21 = sextract32(insn, 0, 21); + disp21 = sextract32(insn, 0, 21) * 4; disp16 = sextract32(insn, 0, 16); disp12 = sextract32(insn, 0, 12); From patchwork Sat May 4 15:39:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 794631 Delivered-To: patch@linaro.org Received: by 2002:adf:a453:0:b0:34e:ceec:bfcd with SMTP id e19csp190399wra; Sat, 4 May 2024 08:41:55 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVHAFp4uGFy+4yveUZz1iWyPNCNB3RsDaeB054WZyH1Y0diRKzdpX5WhiOfEG+11qKv65ysyOd0vLFR2cVY3d6O X-Google-Smtp-Source: AGHT+IHxsUCpd5YUvwkMSN3umKUarxwnc3cX3cpMayKuRDI9yGuqkB6dQ88jfU3BU89QZ9OvhR7U X-Received: by 2002:a81:a109:0:b0:618:9007:a172 with SMTP id y9-20020a81a109000000b006189007a172mr5960697ywg.40.1714837315683; Sat, 04 May 2024 08:41:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714837315; cv=none; d=google.com; s=arc-20160816; b=pPJDEiAhzpGyw88veZz8QaNS5dDbYfEw1uTW4XmPcABmPaoICokLJ323SZO+HGbzdo 2DBpWwdCZZAvNIssXZJZuqiGJnpHvaElsztKzMWGgnGP3m61XdTK/SK5pJ6jW/epP9Gb XP3b6znwMV9T3oFGVkU2jGrmKIE3JdRliH2wwUYfSmVgjkXHBpj7US1v/ut1uhkb+PWG LgG9Lu1fAPlq0huUYOnbKRr85Xk+M7Pcd2GJYfeAn5500GtU6fHqesjpSeTHXrivoA4J c3UBJls8lLVfvF7WMX6/HEWwm3nf1kbyLvlnofP7uWbiwCvXSC1bss8UrXuPRgQNyVYC Dkbw== 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=qfHxYfQijfNm9q0rpqswl8HrggnkGTpjh4fn75ISOwE=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=od3x8Y3+VzQWz1ixN7CFDVQIWSBRm/N284RHQYq+PvA4VTLdSygY/RM9yGOPfSUd6K NeaFIeAiJEt5/7aiRXqOBzC+m3vr/ZPzCQkIl2xBxmbHxXUgr8lJRJGTxe/ndonfNFZg aPWi/dPL+7C/naQz/Jbx2+/oOXeciedAsr04wFPydhGQwPlNqLJ20F+yKzANBwlqLEZD Z7N/bbWoR9bIRFZ98WojgecQgFHAQD5l2Hpx9SH2j18xjOJCdUsxJWSjbbEJg2zqwXwd kLcB/MuJmzlgzCFsjSJEGAD7BdP1de6YzK2ZeEXkozE8YwUGPolcT4pNHKHmPN7bZ1TI 8Zhw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zEdJ5CqN; 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 u18-20020a05622a14d200b0042aaa53f36dsi5757220qtx.573.2024.05.04.08.41.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 04 May 2024 08:41:54 -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=zEdJ5CqN; 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 1s3HU7-00022P-LM; Sat, 04 May 2024 11:39:35 -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 1s3HU6-00021U-05 for qemu-devel@nongnu.org; Sat, 04 May 2024 11:39:34 -0400 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s3HU4-0006EI-IO for qemu-devel@nongnu.org; Sat, 04 May 2024 11:39:33 -0400 Received: by mail-pg1-x52c.google.com with SMTP id 41be03b00d2f7-61eba9f9c5dso453659a12.0 for ; Sat, 04 May 2024 08:39:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714837171; x=1715441971; 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=qfHxYfQijfNm9q0rpqswl8HrggnkGTpjh4fn75ISOwE=; b=zEdJ5CqNivpkqZWidMWcOhn8pqX2VYxrrCWeo1uuniGyPZrp1OicMfFMvw895wITvM kEtN3JPaL2ULV6EBxjNMetZXcayRsz1wrwF9prOLYYmkRMUpZTBbFUH4q5/kPpdebBLi 2Xn66THU1El2xAym/GO+LTMjUM2YMs+NIpMuNunE44fsFKnz1HBYAqVHEejY8xdVQf+x Xt/pXeT7iV8RzhAg2ggnJyexkLWKkbLm4vBRKj1YCSXpZhQe61z36e0Whts+cDcZesER X3VU05X3JRzTaHEfOcpcDfrRIbsyY9Rnqix0G8PUP6Hgrbp/xrnM0H9ZxD+Q/Q3PWBYz jo9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714837171; x=1715441971; 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=qfHxYfQijfNm9q0rpqswl8HrggnkGTpjh4fn75ISOwE=; b=tjLCbRUidFxjApdv6c9Z+w0tv8NiLI8yXjTXDyUX/12Ysd8lM6Gk4Eq0YGDhugeq/w Wx1LCotoxDiQ44V6QI7VpqAgXflnnysEq6MkHAQuP+I+A5lCY2zcCcgat0OksgT/csM5 JnLrf7HeuUU69JyQW292jkLHzl6TIeL2Kwq/hWM+IhMpDtdkCWfjAD53gdYSaam7yw9G e3+L9MymJfzRdm+LZ+9mOxawzNjbUzjm3/Df3VbFirKzUybbZa/G/wHzNJfHeK2n3Nr9 TFY6hKh0yyl5kjb5GnJRQPN9XZbEdLMDdb4TpyBy0gRhW5/R+w5jUr1wDXnz82w42VAv 4z3Q== X-Gm-Message-State: AOJu0Yx8hMuq/ORVWmKEKWPEve7oN64GdE5IhHVdOuNGQkb3cls+Fnxl Rnx2vH+8mHpwsQ7lmF4g0A9fOVgYkkhKSgll1Efw0TOkaFvrME/l1rAm8PCpLeI/9MCwLHK9vNl i X-Received: by 2002:a17:902:f609:b0:1df:f681:3cd8 with SMTP id n9-20020a170902f60900b001dff6813cd8mr7201555plg.12.1714837171063; Sat, 04 May 2024 08:39:31 -0700 (PDT) Received: from stoup.. (174-21-72-5.tukw.qwest.net. [174.21.72.5]) by smtp.gmail.com with ESMTPSA id n15-20020a170902e54f00b001e4d22f828fsm5197859plf.33.2024.05.04.08.39.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 May 2024 08:39:30 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 3/9] target/alpha: Use DISAS_NEXT definition instead of magic '0' value Date: Sat, 4 May 2024 08:39:20 -0700 Message-Id: <20240504153926.357845-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240504153926.357845-1-richard.henderson@linaro.org> References: <20240504153926.357845-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52c; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52c.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 Message-Id: <20240424234436.995410-4-richard.henderson@linaro.org> [PMD: Split bigger patch, part 1/5] Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20240503072014.24751-4-philmd@linaro.org> --- target/alpha/translate.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/alpha/translate.c b/target/alpha/translate.c index 52c2e6248b..9ad7bf6e5f 100644 --- a/target/alpha/translate.c +++ b/target/alpha/translate.c @@ -440,8 +440,10 @@ static DisasJumpType gen_bdirect(DisasContext *ctx, int ra, int32_t disp) /* Notice branch-to-next; used to initialize RA with the PC. */ if (disp == 0) { - return 0; - } else if (use_goto_tb(ctx, dest)) { + return DISAS_NEXT; + } + + if (use_goto_tb(ctx, dest)) { tcg_gen_goto_tb(0); tcg_gen_movi_i64(cpu_pc, dest); tcg_gen_exit_tb(ctx->base.tb, 0); From patchwork Sat May 4 15:39:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 794627 Delivered-To: patch@linaro.org Received: by 2002:adf:a453:0:b0:34e:ceec:bfcd with SMTP id e19csp190245wra; Sat, 4 May 2024 08:41:24 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX9KwvgfTKalSgklz4OIqDGUbVlMf/mCQFqCzi35xlBsIQyEMZ/jfZRyJf5pn25MoNplIA9VcmG0deHWgH6GTU0 X-Google-Smtp-Source: AGHT+IGHUKwat3RnOOvDHcCnNSWWrPU4Wi74ikV2QpeUfbBR1OFbcl0r8y0si2fuSvt+OIZtEU6L X-Received: by 2002:ac8:5805:0:b0:43b:6fa:9756 with SMTP id g5-20020ac85805000000b0043b06fa9756mr5587412qtg.27.1714837283983; Sat, 04 May 2024 08:41:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714837283; cv=none; d=google.com; s=arc-20160816; b=s4boNHi0gk0zwifRmC5jVK0jRWhCFSCoxHLXD5+laqlW1lg2mAKdRqlB+xn7Kx5uuJ JJSb5aMfgEI1Smf7HwDa8umWNHuHzE2uphp7+f1Q7Aiuq2YAkOnPkIlOwx86Nvv2MapZ iDBJIKc4SzksU/Iow2nvrQ30GQEKVS/Regsu2sBKfFDON+COR760fRFTfhCiB5NZOIbx fI9AgFOoCTQl4Okrwg/dnz+6GMpTFF6OMF0i92jD4Iy5IVCpOBhayIplyWpjWEnwlPCq GjOyUpEpOLtIPoovDWN/rVlXy1lsE1uvWu1+fpL6UAdoRPbLijYkLrI/Yd+nqcKGPQvB +3RA== 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=fi/ZQeRrecbB7BBaXRi3+3SwPGSOgsgXACvVx9J1knk=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=M4tDFDFP/I3n96C0KeOoybTwgP+D2tthHnAYbWlrMki87M3bCoM23KYNS+IAClYudu Z/g4bmZ/AJp9j9eAbO6td7mPT21XFcvvtCLyZgJu6FHoF0kCjjmT4fFWH1EtUsg7CuAi mWXRuwPenZPs06IQfTKg6vSCVLhvHzKIfvB8i1UpnjGnFm6M/dE8wzfQDzTIAAnLTy60 y0QtAJuIfqrH8ZkcNBvX8Uc3YtH+4WZ8gSK4wbDxkjidig+M3dFXOxhvCeAE9ZtAeYAx /WP+bjmXofN7YlBq9smX2qrJKbqU0KuYAacDskSAOptjADKKzQ6saAugwJB0kYGwgtS/ 440Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uGpEVFSS; 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 u6-20020a05622a010600b0043a941cbc97si5865416qtw.176.2024.05.04.08.41.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 04 May 2024 08:41:23 -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=uGpEVFSS; 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 1s3HU8-00022f-EL; Sat, 04 May 2024 11:39:36 -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 1s3HU6-00022E-S4 for qemu-devel@nongnu.org; Sat, 04 May 2024 11:39:34 -0400 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s3HU5-0006EU-8d for qemu-devel@nongnu.org; Sat, 04 May 2024 11:39:34 -0400 Received: by mail-pj1-x1036.google.com with SMTP id 98e67ed59e1d1-2b12b52fbe0so433244a91.0 for ; Sat, 04 May 2024 08:39:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714837172; x=1715441972; 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=fi/ZQeRrecbB7BBaXRi3+3SwPGSOgsgXACvVx9J1knk=; b=uGpEVFSSEr8060cP509cO+f4sPuHs+61OeLKLcmndJaneWGPUcAcYvrjRXF+n7M2XK pO3EprLaXPujlCOdCUoD2qAiluaOjhhNebN28oEJ3C7qBagfIXb25nKc5DTqhg3fTiS9 kh5EEDQdGkce/sD1hLtUoKrN2RdsuRJHANcg0g9Ur6hb8Wz/K5r8lbrcrnycZ2O2xNvg veTlY/eKbKSQCMINRzN8Pf9hyUcSNiXEDWyjZFTiA/KkYcMWo0e0730tL0ffXL9gCgtU VuNBhCJAj7M49IYzpxXlTlqyRXhAEHkp9kNDCoytSCwO1+ImiBIOpwO8q2J1vFdQTaxN JdGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714837172; x=1715441972; 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=fi/ZQeRrecbB7BBaXRi3+3SwPGSOgsgXACvVx9J1knk=; b=hSI3C05QS4+fiCOgTxrvDk2eHTSlra8UotxkUyl+jcTkJi9aqUDY2tV4mkGiiOqiaE nqY3HkeUW4kgTOlyGgYg4b7fy8189/poGf7D8YP1P6nPCyZKR/H6SxxiLM4LU7G+12sJ 90aNU3YQdjFuyw0OFYTgkeqa5rvCMkayF38ZB42toAJG0oGQokjRRDXkWa/VEWQkND43 P3W2qoHg3tBGOFgxcV+zHpi/kKVlzyYZ/d0W3zOGm3w9nJcrMVU8EyBkSs9OFVXm4Xt3 FBJDUus1Gr7IJOfiu8lTOzMQpWuwdUt+MiZJ6ItvuIVBWkiJ6InDA/NCO+OuGoIgigul fiWQ== X-Gm-Message-State: AOJu0YxhNVmHRBm1NUGgXdQThyYv+hr0BVkeDNoueXbdBMpF2m1Omb7l zglpx99UDd1Wh4SbIgHBDtmc6LN3pA9FvTWRW0dhRBvgIaG7iZNEXHksv+IFe6T6zFPw0D5Ge7m 0 X-Received: by 2002:a17:90b:684:b0:2b4:329e:e373 with SMTP id m4-20020a17090b068400b002b4329ee373mr5941195pjz.6.1714837171872; Sat, 04 May 2024 08:39:31 -0700 (PDT) Received: from stoup.. (174-21-72-5.tukw.qwest.net. [174.21.72.5]) by smtp.gmail.com with ESMTPSA id n15-20020a170902e54f00b001e4d22f828fsm5197859plf.33.2024.05.04.08.39.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 May 2024 08:39:31 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 4/9] target/alpha: Inline DISAS_PC_UPDATED and return DISAS_NORETURN Date: Sat, 4 May 2024 08:39:21 -0700 Message-Id: <20240504153926.357845-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240504153926.357845-1-richard.henderson@linaro.org> References: <20240504153926.357845-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1036; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1036.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 Inline DISAS_PC_UPDATED switch case from alpha_tr_tb_stop(): switch (ctx->base.is_jmp) { ... case DISAS_PC_UPDATED: tcg_gen_lookup_and_goto_ptr(); break; Signed-off-by: Richard Henderson Message-Id: <20240424234436.995410-4-richard.henderson@linaro.org> [PMD: Split bigger patch, part 2/5] Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20240503072014.24751-5-philmd@linaro.org> --- target/alpha/translate.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/alpha/translate.c b/target/alpha/translate.c index 9ad7bf6e5f..01914e7b56 100644 --- a/target/alpha/translate.c +++ b/target/alpha/translate.c @@ -450,7 +450,8 @@ static DisasJumpType gen_bdirect(DisasContext *ctx, int ra, int32_t disp) return DISAS_NORETURN; } else { tcg_gen_movi_i64(cpu_pc, dest); - return DISAS_PC_UPDATED; + tcg_gen_lookup_and_goto_ptr(); + return DISAS_NORETURN; } } @@ -479,7 +480,8 @@ static DisasJumpType gen_bcond_internal(DisasContext *ctx, TCGCond cond, TCGv_i64 p = tcg_constant_i64(ctx->base.pc_next); tcg_gen_movcond_i64(cond, cpu_pc, cmp, i, d, p); - return DISAS_PC_UPDATED; + tcg_gen_lookup_and_goto_ptr(); + return DISAS_NORETURN; } } From patchwork Sat May 4 15:39:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 794630 Delivered-To: patch@linaro.org Received: by 2002:adf:a453:0:b0:34e:ceec:bfcd with SMTP id e19csp190368wra; Sat, 4 May 2024 08:41:50 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVsKmy8EoOq5przwr9jsvpVj7i3Oi/tzeZEzRT2VOJTQNtPeM0yvO8EkXAZUSb+t29PaFsj+80oZIR82JboW8sa X-Google-Smtp-Source: AGHT+IEcL5PImwM3YdqJJXHdCBjriY04/vARV+VwJ34HTGOnu3O7ADfDFBg3nqjvYGdU46PmG5Xb X-Received: by 2002:a0c:d803:0:b0:6a0:ef09:dbaf with SMTP id h3-20020a0cd803000000b006a0ef09dbafmr15111849qvj.19.1714837309909; Sat, 04 May 2024 08:41:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714837309; cv=none; d=google.com; s=arc-20160816; b=0thxDpeDYKPYnDK3Jg3W1AMX6seNeYRQzbQxQXmp6O8SdQl22/8ZbPpVscRzZZbiQ+ buLDlW/u22E0ERhO4KNrIHgcwUlIzLvj+9knb88HQlQGj5UeGfkZ9TZlCr44U2Ye6l8e dhandkX/4kffPaKUF79VMbedAwA2JK5P7xvb3np7oCSR9KRQTa+jT/rHerQL0uiIAqES 1NAELz/pSBUl9+WE7Y45z2QUpX4NXXruIuTmJj1V2QgCPwnS39FxhKNR10nRmsqMJk0A p1ss8RqsbB8Qm/d0LxnIYC+cHSrjZhFTY05YRgu3B1PBXZ4GTvEh7/KzjmBMW9ohaT4a eIew== 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=vY5Eou1jVTje6BF1WY7ML8aaACS2Ol4ajRC2WX0h/bw=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=VlKO45iJHyVG+xNDlIHJgHFj1Vna5THmX9yKoGGY6DVyLJ8kvKnWlQjpbeTvwqQqrY dGAG2PW8uDoAYgst2iONeQtpUtSU+cOQdTjEEB+ZObrKPm1tykKV8zHH0gkNxKYON8LD g2aGlzqo67YbsgDQg5fxov+VUHDczHGpsbsbValCg9G9pWaN/oKEeihmPsfp3NBboUyH Y/zU9jN6600l3R3iy6ffX5PFfxxQBxqlxJyOhVQPfAEK2hKhZpXshPFGs1CuJf7sKzKD 5QKNtwcwspRFXXlZsK64RrBINxTtOh+e0+XTsjytJrcAVlFb9mURKnaJNOR/7H6sIxBw Yo5w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zm738Eke; 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 a13-20020ad45c4d000000b006a0d6b67400si5501236qva.133.2024.05.04.08.41.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 04 May 2024 08:41:49 -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=zm738Eke; 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 1s3HU8-00022e-Be; Sat, 04 May 2024 11:39:36 -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 1s3HU7-00022Q-Kn for qemu-devel@nongnu.org; Sat, 04 May 2024 11:39:35 -0400 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s3HU6-0006Ef-10 for qemu-devel@nongnu.org; Sat, 04 May 2024 11:39:35 -0400 Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-1ed012c1afbso4635635ad.1 for ; Sat, 04 May 2024 08:39:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714837173; x=1715441973; 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=vY5Eou1jVTje6BF1WY7ML8aaACS2Ol4ajRC2WX0h/bw=; b=zm738Ekez1vsqoj2eIJcAYR4FiuHUSAfjXT3VKJY4kE3yfzl2et9TqyQ7ZY3Fl3cA6 Na+SLQsGFS7W5fSQTpJEVLGWN23nbLj6dUZfrsiaH7XjWa4EsObImx73Q60c16aTGcpn XoqJT1VA522jMs0AG52Frc1qejKxGYBaI2dGA608rVoMJE7XFiIWHYD549+X+5U3Wnwn hnjhjylc2DPaBQgLJblu//tRqNnu/v0uVWVf0pur0uz5iAMKzSc337IQDYQh8dzAcI6Z dmtFwvF+OTyTUOkYiI129NepGh7xu8Hh5PybDmalfEss13knJoGDcUDLbPvyYi3Ah8SX dWLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714837173; x=1715441973; 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=vY5Eou1jVTje6BF1WY7ML8aaACS2Ol4ajRC2WX0h/bw=; b=YntijcJf5iKjUOQGdDQCaLtRokSwDqXSs5udJHYuQHT64JD0pLxHASeMj8am9vMp9G f/bjJDTUibimNX3yIiyip+csMIEIYnpNsMYBOj0v/A08dov1pEFzW7uU6X6rZqxCi42F 52rW/Ga5+0fi5O37KOOKRZJhejSsE5a4+I88YvzY5p8q2v5PcO3JV+0SA7rK+ZzjkV17 FRR6gAwXMkd2az49AT/dxg3TIGLSdJxpjI5wwcHDkgsCkGO6Iv97jZKRBpNauJz+SddX RbyBMBTKU7Pn6OYDojVgdmsEyB3x78ivSSBk3VD5HluYzQAB0Ql3Urq1/7oT6kQTb9fM umhw== X-Gm-Message-State: AOJu0YxfzD+ElFAxJGdeZr3RMWQxKqLBr6KHEIMbO2gb8WKJa7nuEb2G NwMnUBscVAslhAzB8lYSEjFqEOoyml+8mNzOt3ku1SlF3qexiCq+GckxnGD8mNqClBab3Hp73SS 0 X-Received: by 2002:a17:902:f605:b0:1e8:682b:7f67 with SMTP id n5-20020a170902f60500b001e8682b7f67mr8654821plg.29.1714837172718; Sat, 04 May 2024 08:39:32 -0700 (PDT) Received: from stoup.. (174-21-72-5.tukw.qwest.net. [174.21.72.5]) by smtp.gmail.com with ESMTPSA id n15-20020a170902e54f00b001e4d22f828fsm5197859plf.33.2024.05.04.08.39.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 May 2024 08:39:32 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 5/9] target/alpha: Return DISAS_NORETURN once Date: Sat, 4 May 2024 08:39:22 -0700 Message-Id: <20240504153926.357845-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240504153926.357845-1-richard.henderson@linaro.org> References: <20240504153926.357845-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62e.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 Trivial change to make next commits easier to understand. Signed-off-by: Richard Henderson Message-Id: <20240424234436.995410-4-richard.henderson@linaro.org> [PMD: Split bigger patch, part 3/5] Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20240503072014.24751-6-philmd@linaro.org> --- target/alpha/translate.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/target/alpha/translate.c b/target/alpha/translate.c index 01914e7b56..41151f002e 100644 --- a/target/alpha/translate.c +++ b/target/alpha/translate.c @@ -447,12 +447,12 @@ static DisasJumpType gen_bdirect(DisasContext *ctx, int ra, int32_t disp) tcg_gen_goto_tb(0); tcg_gen_movi_i64(cpu_pc, dest); tcg_gen_exit_tb(ctx->base.tb, 0); - return DISAS_NORETURN; } else { tcg_gen_movi_i64(cpu_pc, dest); tcg_gen_lookup_and_goto_ptr(); - return DISAS_NORETURN; } + + return DISAS_NORETURN; } static DisasJumpType gen_bcond_internal(DisasContext *ctx, TCGCond cond, @@ -472,8 +472,6 @@ static DisasJumpType gen_bcond_internal(DisasContext *ctx, TCGCond cond, tcg_gen_goto_tb(1); tcg_gen_movi_i64(cpu_pc, dest); tcg_gen_exit_tb(ctx->base.tb, 1); - - return DISAS_NORETURN; } else { TCGv_i64 i = tcg_constant_i64(imm); TCGv_i64 d = tcg_constant_i64(dest); @@ -481,8 +479,9 @@ static DisasJumpType gen_bcond_internal(DisasContext *ctx, TCGCond cond, tcg_gen_movcond_i64(cond, cpu_pc, cmp, i, d, p); tcg_gen_lookup_and_goto_ptr(); - return DISAS_NORETURN; } + + return DISAS_NORETURN; } static DisasJumpType gen_bcond(DisasContext *ctx, TCGCond cond, int ra, From patchwork Sat May 4 15:39:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 794628 Delivered-To: patch@linaro.org Received: by 2002:adf:a453:0:b0:34e:ceec:bfcd with SMTP id e19csp190270wra; Sat, 4 May 2024 08:41:29 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW+O7VCe/wYVNUFMbmiCSwp8JTNMY64GUwY/bMaJ9ttgaJljR24esvbsKYXKL/ObyKFnSm1U9RniZFkp/N3pbKw X-Google-Smtp-Source: AGHT+IEx9/27w/MsNNlGsK/hnV20QSro5eKJJXCZ7yvHp9+O6n5vDwitP+1RxfuudMQ7p5CRsEZL X-Received: by 2002:a05:6830:201a:b0:6f0:36f2:2ed7 with SMTP id e26-20020a056830201a00b006f036f22ed7mr270473otp.35.1714837289093; Sat, 04 May 2024 08:41:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714837289; cv=none; d=google.com; s=arc-20160816; b=OZ6UO/0MVLkS+dKkygfvtIQRCIZsupEHYp8WTfSvpNaBde3K7+xDHs8giZx6qYUaeM aHPHSTDCcKj24lOatqPAiwAt3H3QVRGsUmE7VDsm+Dr1vLsuOYBdkzTgrWwPmru8pD+8 JT64/3o8BliL8rSLambaDxo6bw4E75d03dCZnUYi7mMEA7kHbE+6kWm/KFTF9LQ8jucQ AI1CXZi7xaOLgkPkSFx77pT+Wgp3UotCXf3STms/a80utCdm1adASEHiX4yUjSRykpyS uOo7r9BJRsWLAprwZf5k85li/SsFr8/mbR0eV4tJVbe824oPzJlSrmZKeduLhS/TaJW9 Uqgw== 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=sbgTvqZXx0oV/4QT5gXHywIupzMDjszkzNiZiQWIETo=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=xZx8QUSAVP5WkBzwtA3GCww5p9SWpxuoPoAREy0CsJzMbiRx4IP5TYMQXw6cEWPYje FCF+1f0vusAq6x2KRufLiFZ8oVFqGn6C41UiPpq8uAqjcGvaBGwssVU2VlNWXJcqRqMV muQBbscoEWdTia7vmDOTTiYkeRdisHLQyIZyMAjsoKPTkxdkKwmUTpO42OU2ph4kZUf0 iWnQtwK6NFladnkDDM78+ep9I93v5I4CTAsAVmCA1ZuhjKPMy5CxOv7jcnrk6K4Pnv6E Bn51msQR258L+DPdtngFY4dNmjxQfhTEnvU8BpHQRhouH/cz5otkXUv2S2fKxZnuaZqA 6wxA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=erh5dysr; 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 pi22-20020a05620a379600b0078edd73d5casi5218679qkn.663.2024.05.04.08.41.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 04 May 2024 08:41:29 -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=erh5dysr; 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 1s3HUB-00024X-Cn; Sat, 04 May 2024 11:39:39 -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 1s3HU8-00022k-Oe for qemu-devel@nongnu.org; Sat, 04 May 2024 11:39:36 -0400 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s3HU7-0006Ey-2g for qemu-devel@nongnu.org; Sat, 04 May 2024 11:39:36 -0400 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-6f44881ad9eso503299b3a.3 for ; Sat, 04 May 2024 08:39:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714837173; x=1715441973; 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=sbgTvqZXx0oV/4QT5gXHywIupzMDjszkzNiZiQWIETo=; b=erh5dysrkgPPdSQhwPB6/rL9zUmMaxNFvNmF66mS8e4AM+EOCXfpERBnhRwE1NdepG qiPNWZTfwej+JQUOHL/io3dFhzylJkwwPV5xgtwrUVMVkUxkzgyI9q6JzgAjEj69Btng hMOaVB7x+LeLD8dtSbfQcPOh4z4oRihxH+r2TQpZu/TSh+ytfvoRcOp9iXNqLMDb/3pN N2ePRAoBXELbaXPGUOxKO9evFmmuvcDBv95z5QbpKFfu4RyrSlV2JsPnRawAwedqBmRg KVR6prNCYJowCd9AjOyMwG9Wao8RKdozvV3ByQWaMu0Tr06xLnOmz40FIfg+fefPFQBU raCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714837173; x=1715441973; 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=sbgTvqZXx0oV/4QT5gXHywIupzMDjszkzNiZiQWIETo=; b=mw16f3JNapHTeoWLNxgr07ADQGq9/pio2a2/mZEVKdaFdGBDLn+DcxzrBbz7Z9/oDk FaxiteEAKJWeQMFxWb+tvATQz8f+n5pIk09aapfiwLU3tQwHL+CjsGKO5m3HFG7IkTr9 B3rMzqzlM7S3uoEPi1mMVBPNIiVeC88U/VFWVIgcpBe9ecHBGEhoK2rRrqQpeMLIGvB8 +z9/vzaETjxY+CmrBCjD0up0Z6mBrcrK+LLptkgSbyOr20B1KJyhz8VKqm6EHturKBW1 9tAQx8xLSmP5hh9EXk6PFXviB5Ffgij9lxSgltP4fI/K7vV0iwPTtInTUNqtReEs1Qmn Wk4A== X-Gm-Message-State: AOJu0YxlzVDZdz5ueCJNfW/9bYNOM91GcX7aTVbecYvH8r57fMbVmC1F 7RCwQYmZP73OcqD5HqhBFalRM63vUjpvGME4vg7T4I5hWBjRbDbCPAQdyQ9zaKyHvtNQnr0KbeV k X-Received: by 2002:a05:6a21:164a:b0:1af:997d:1788 with SMTP id no10-20020a056a21164a00b001af997d1788mr1216910pzb.44.1714837173623; Sat, 04 May 2024 08:39:33 -0700 (PDT) Received: from stoup.. (174-21-72-5.tukw.qwest.net. [174.21.72.5]) by smtp.gmail.com with ESMTPSA id n15-20020a170902e54f00b001e4d22f828fsm5197859plf.33.2024.05.04.08.39.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 May 2024 08:39:33 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 6/9] target/alpha: Simplify gen_bcond_internal() Date: Sat, 4 May 2024 08:39:23 -0700 Message-Id: <20240504153926.357845-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240504153926.357845-1-richard.henderson@linaro.org> References: <20240504153926.357845-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42c; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42c.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 From: Philippe Mathieu-Daudé Richard Henderson explained on IRC: bcond_internal() used to insist that both branch destination and branch fallthrough are use_goto_tb; if not, we'd use movcond to compute an indirect jump. But it's perfectly fine for e.g. the branch fallthrough to use_goto_tb, and the branch destination to use an indirect branch. Signed-off-by: Richard Henderson Message-Id: <20240424234436.995410-4-richard.henderson@linaro.org> [PMD: Split bigger patch, part 4/5] Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20240503072014.24751-7-philmd@linaro.org> --- target/alpha/translate.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/target/alpha/translate.c b/target/alpha/translate.c index 41151f002e..b7b94cc378 100644 --- a/target/alpha/translate.c +++ b/target/alpha/translate.c @@ -461,23 +461,22 @@ static DisasJumpType gen_bcond_internal(DisasContext *ctx, TCGCond cond, uint64_t dest = ctx->base.pc_next + disp; TCGLabel *lab_true = gen_new_label(); - if (use_goto_tb(ctx, dest)) { - tcg_gen_brcondi_i64(cond, cmp, imm, lab_true); - + tcg_gen_brcondi_i64(cond, cmp, imm, lab_true); + if (use_goto_tb(ctx, ctx->base.pc_next)) { tcg_gen_goto_tb(0); tcg_gen_movi_i64(cpu_pc, ctx->base.pc_next); tcg_gen_exit_tb(ctx->base.tb, 0); - - gen_set_label(lab_true); + } else { + tcg_gen_movi_i64(cpu_pc, ctx->base.pc_next); + tcg_gen_lookup_and_goto_ptr(); + } + gen_set_label(lab_true); + if (use_goto_tb(ctx, dest)) { tcg_gen_goto_tb(1); tcg_gen_movi_i64(cpu_pc, dest); tcg_gen_exit_tb(ctx->base.tb, 1); } else { - TCGv_i64 i = tcg_constant_i64(imm); - TCGv_i64 d = tcg_constant_i64(dest); - TCGv_i64 p = tcg_constant_i64(ctx->base.pc_next); - - tcg_gen_movcond_i64(cond, cpu_pc, cmp, i, d, p); + tcg_gen_movi_i64(cpu_pc, dest); tcg_gen_lookup_and_goto_ptr(); } From patchwork Sat May 4 15:39:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 794623 Delivered-To: patch@linaro.org Received: by 2002:adf:a453:0:b0:34e:ceec:bfcd with SMTP id e19csp189903wra; Sat, 4 May 2024 08:40:19 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXOLOqY+7mnKK8aSy3lN++gdXvuoOo6KL/dc/CGnCWdb7aiTm+S03X2cpBMY9qa+hMwChfbtvmHHJmJFectfE73 X-Google-Smtp-Source: AGHT+IEIPk5HYUW3kM25hzhHSe4O5pNEFfK467YcsKEr80WKldA56GHcJ+kRFTkt5Zse7yLoPIxt X-Received: by 2002:ac8:5849:0:b0:43a:e5c6:b70b with SMTP id h9-20020ac85849000000b0043ae5c6b70bmr5736821qth.31.1714837219297; Sat, 04 May 2024 08:40:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714837219; cv=none; d=google.com; s=arc-20160816; b=UcsCaEllBAAbTu7RUv3uG53WYeK8zdJTU0pUazL++h5ukm2aLNahTTV1gulHp4YMBQ 0qolDThyDWDi1TMrtjGt76FSgVgOTp76F8Aq5AMiqRTi2PWR+q84kLOO0tsrGdf7VVCB 2bZ3Q48dZtEw/SgRNOGS5SzY9f9/3h7ZEBlfX3nJMRNxF7EmWN89DPxz8T2s8N1SOi5G 9VoAkvVYql9yLaQCaItBnUPFBXqC5c8gIfUr4yWBxalEehw1KxfsxHbf6cfy/pEljZQj bqEow0xoEC/4/4Xx/KJtoelKobzSnWKXxv+J/YJnOmpqZ/lzxvtsK7+biSnpzj03gi5U QvTQ== 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=xVVPRKrlT2Orc69ECKDjPxn2WVFASwuWViHwTTTKVCk=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=AhaYhsImEzi+sV+rWkBzToXFdrhEBj0MYfhXPCQHxsPuyZqVt45fvMCWK3DY6haE4G DSefctjGBcK9Dx51+X5DxSVgNkAv9nO36fkWzVUzpf1lkdVNcfaCrMuRxFuoREJ5D8rv CEaST9zJbsUvdvBbWLUMZN7/qIA9T4CF8Bd+mPZ3yfvBpyMt2mtZRdbvg+eLPs+rAXni 4HlaDMEwI197xFLi0gAJipPhx/ILyRZ1bFDC8H0VrHSvYNMLOEPdvExIHUGvB9D6YlKv YIxwzOv/YGQ0bmP2Lj5RBDGXjUORDc4a4IqlRC9jTnD2dBqw55mTqzeR+SyovK9FlzFf aLsA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nEFYmN6s; 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 ea14-20020a05622a5b0e00b0043ade35ba8fsi2560960qtb.791.2024.05.04.08.40.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 04 May 2024 08:40:19 -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=nEFYmN6s; 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 1s3HUC-000257-5x; Sat, 04 May 2024 11:39:40 -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 1s3HUA-00023s-4m for qemu-devel@nongnu.org; Sat, 04 May 2024 11:39:38 -0400 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s3HU8-0006F9-GP for qemu-devel@nongnu.org; Sat, 04 May 2024 11:39:37 -0400 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1ed96772f92so2966305ad.0 for ; Sat, 04 May 2024 08:39:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714837175; x=1715441975; 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=xVVPRKrlT2Orc69ECKDjPxn2WVFASwuWViHwTTTKVCk=; b=nEFYmN6suGlspSM4JCvNYyhkb3fNpxI5zTZ/jYa5reAahd54c/PCWlfqSI0qXEH6Te TZP18y2rd/W3hNol1UOXeCK6FU06DRjCeuljpTqHf2ms7NFjdmXOp1Dg3P19+LxPTCVJ uE7TiNJNHqhfoPIFJJGl6ntyGD008mQXKRIBmJfIU+Xd9wlY+9E9hNvGSFtTm0ZWm0eN BJ3mc//eAx2fXwgGDhH/OwXkhREbK3yim4k3UPPfkyaMC1Jry2x+W36s2UuC2TwhVI+v QjEV0Xwh3MaFe/53tLRLYiYQGFBMZc9PYx9PAFm275ZTg2Qr1dQpzzFhVBymxvkRIoO3 AFdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714837175; x=1715441975; 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=xVVPRKrlT2Orc69ECKDjPxn2WVFASwuWViHwTTTKVCk=; b=afgRejoqQSPeeBsoh6L0tX5tsgMppJGvyeQDljltzomKlVazfZw6Ce4VxIJ1pMw74o 3QZw6DQUGjMvgUFo/oavPvv7bcLyBU359jhuekWRwRC4sRHQpDALyhywXn8Ar/MPcytw zKGu20CffUf//+JbeQLvNO9HbLtRAsIXRPkudWwkLWDj5/2aYTAL03z+NbEzCp81hVjL 8vHwRAqvXHOaE2anG0O9Ig3GpGbIxuiuG8+pajYptP6YGMfhTcwnOU4R4srPg91ukefA Q38VLe08swqTS4Yo7FNZ3XCv1cD5SfelzWKEUn0sy6Wc0Uce2XC9lwQpJStXgI9WiHQo OnkA== X-Gm-Message-State: AOJu0YyLiIJqA+kQZrcxKW9kokpM6wB48AsrYrgjn8e/V8BJJt2TPCEV JkYYhJIDJq3bMs4UwmE58+j3/90TrzE/AFcQkm+yR4OGwOiYCW6NqmEHYZtXUkqrXj9O/trfv3W v X-Received: by 2002:a17:903:228e:b0:1eb:51a4:3685 with SMTP id b14-20020a170903228e00b001eb51a43685mr6776336plh.52.1714837174794; Sat, 04 May 2024 08:39:34 -0700 (PDT) Received: from stoup.. (174-21-72-5.tukw.qwest.net. [174.21.72.5]) by smtp.gmail.com with ESMTPSA id n15-20020a170902e54f00b001e4d22f828fsm5197859plf.33.2024.05.04.08.39.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 May 2024 08:39:34 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 7/9] target/alpha: Split out gen_goto_tb Date: Sat, 4 May 2024 08:39:24 -0700 Message-Id: <20240504153926.357845-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240504153926.357845-1-richard.henderson@linaro.org> References: <20240504153926.357845-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x635.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 Message-Id: <20240424234436.995410-4-richard.henderson@linaro.org> [PMD: Split bigger patch, part 5/5] Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20240503072014.24751-8-philmd@linaro.org> --- target/alpha/translate.c | 53 ++++++++++++---------------------------- 1 file changed, 16 insertions(+), 37 deletions(-) diff --git a/target/alpha/translate.c b/target/alpha/translate.c index b7b94cc378..c1a55e5153 100644 --- a/target/alpha/translate.c +++ b/target/alpha/translate.c @@ -425,15 +425,22 @@ static DisasJumpType gen_store_conditional(DisasContext *ctx, int ra, int rb, return DISAS_NEXT; } -static bool use_goto_tb(DisasContext *ctx, uint64_t dest) +static void gen_goto_tb(DisasContext *ctx, int idx, int32_t disp) { - return translator_use_goto_tb(&ctx->base, dest); + uint64_t dest = ctx->base.pc_next + disp; + + if (translator_use_goto_tb(&ctx->base, dest)) { + tcg_gen_goto_tb(idx); + tcg_gen_movi_i64(cpu_pc, dest); + tcg_gen_exit_tb(ctx->base.tb, idx); + } else { + tcg_gen_movi_i64(cpu_pc, dest); + tcg_gen_lookup_and_goto_ptr(); + } } static DisasJumpType gen_bdirect(DisasContext *ctx, int ra, int32_t disp) { - uint64_t dest = ctx->base.pc_next + disp; - if (ra != 31) { tcg_gen_movi_i64(ctx->ir[ra], ctx->base.pc_next); } @@ -442,43 +449,19 @@ static DisasJumpType gen_bdirect(DisasContext *ctx, int ra, int32_t disp) if (disp == 0) { return DISAS_NEXT; } - - if (use_goto_tb(ctx, dest)) { - tcg_gen_goto_tb(0); - tcg_gen_movi_i64(cpu_pc, dest); - tcg_gen_exit_tb(ctx->base.tb, 0); - } else { - tcg_gen_movi_i64(cpu_pc, dest); - tcg_gen_lookup_and_goto_ptr(); - } - + gen_goto_tb(ctx, 0, disp); return DISAS_NORETURN; } static DisasJumpType gen_bcond_internal(DisasContext *ctx, TCGCond cond, TCGv cmp, uint64_t imm, int32_t disp) { - uint64_t dest = ctx->base.pc_next + disp; TCGLabel *lab_true = gen_new_label(); tcg_gen_brcondi_i64(cond, cmp, imm, lab_true); - if (use_goto_tb(ctx, ctx->base.pc_next)) { - tcg_gen_goto_tb(0); - tcg_gen_movi_i64(cpu_pc, ctx->base.pc_next); - tcg_gen_exit_tb(ctx->base.tb, 0); - } else { - tcg_gen_movi_i64(cpu_pc, ctx->base.pc_next); - tcg_gen_lookup_and_goto_ptr(); - } + gen_goto_tb(ctx, 0, 0); gen_set_label(lab_true); - if (use_goto_tb(ctx, dest)) { - tcg_gen_goto_tb(1); - tcg_gen_movi_i64(cpu_pc, dest); - tcg_gen_exit_tb(ctx->base.tb, 1); - } else { - tcg_gen_movi_i64(cpu_pc, dest); - tcg_gen_lookup_and_goto_ptr(); - } + gen_goto_tb(ctx, 1, disp); return DISAS_NORETURN; } @@ -2922,12 +2905,8 @@ static void alpha_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu) case DISAS_NORETURN: break; case DISAS_TOO_MANY: - if (use_goto_tb(ctx, ctx->base.pc_next)) { - tcg_gen_goto_tb(0); - tcg_gen_movi_i64(cpu_pc, ctx->base.pc_next); - tcg_gen_exit_tb(ctx->base.tb, 0); - } - /* FALLTHRU */ + gen_goto_tb(ctx, 0, 0); + break; case DISAS_PC_STALE: tcg_gen_movi_i64(cpu_pc, ctx->base.pc_next); /* FALLTHRU */ From patchwork Sat May 4 15:39:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 794624 Delivered-To: patch@linaro.org Received: by 2002:adf:a453:0:b0:34e:ceec:bfcd with SMTP id e19csp189934wra; Sat, 4 May 2024 08:40:25 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUf3nZprE4uq7Yyr7qw0g66TwjOM2b2zzYtTl0A69S78rD/kwk4RT+BfgvSvglho9LbbH/UnwIgxj7WVMBKArNd X-Google-Smtp-Source: AGHT+IHufRtQNtW6N07doDns7csUB+SEOSji9USxYlZKB4gUOiMF5oti+8QDsB3QVsp6m0TXBQTN X-Received: by 2002:a05:6214:501d:b0:6a0:8238:943 with SMTP id jo29-20020a056214501d00b006a082380943mr6217103qvb.65.1714837224884; Sat, 04 May 2024 08:40:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714837224; cv=none; d=google.com; s=arc-20160816; b=BMHMBpuxkSoUydlA5FBcKi9OzEB6XCemnNlzlh/xgqoNBHH7K9jJGWxyoGIs6sCcYC vhGNpu3JbToMoh19byGvpfwv9ciNHziL3MRVdR4zmT5+LIdofeMMbILLo8WPOGBI3VVZ iWjZEGksJg01vVbK0BlxX2gzchvqvp+Vic08N+NWGq2l9XHoBxfG31YDP7qEMGI51eam NKUFYUPdciO3VACLTzAVfrMT1D3mUgzfEq7i6b9iWOvYsA1IjemNipOr7bvol6x7PLzc 3roPgL69nPfza1gn8IWAwpSHgxAT1ebtbBcuCCuGbtArhv7+SqVjQVR+H1iyI6tjpJW9 WhIw== 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=/dNPNLs1khRCpqkW7qQSkGpf2gCcH5jGPYIjxIk0MdY=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=zgts/bdU25va+XU0S0Xn5Y2Vt3beA7TStmuc0EYHXhuyGK9kpfBozFBoRXrrtjuSJs ttgBlW/9hYRfpg71YZiqI1W6M4X12jjVjMYeU3pcZopGGjK1PLPWUUueQ9hWQ2cT9vMP 7p2z+KYHL88kh/FQnPp8HOWJT3LeKkex6OQqOXTZVWU4fmGC8AIbuJXQ+PDX7VbebWK5 +4NWpUiYzbdDPGXpc2RQZ36f7HexJOl5SjuwXe+BYKSI1EojtDvz8qqRzmvaAH1t2VBx H48Z4BaijQikK1wh3+esrH5wJKP8+dIWfodRipADYgaiS57mFi/wFrtqlQi1glMK2Bx8 ml9A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Dtl7I85o; 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 p21-20020a05622a00d500b00439ff2a9b0asi4538880qtw.124.2024.05.04.08.40.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 04 May 2024 08:40:24 -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=Dtl7I85o; 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 1s3HUC-00024q-0P; Sat, 04 May 2024 11:39:40 -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 1s3HUA-000249-Nk for qemu-devel@nongnu.org; Sat, 04 May 2024 11:39:38 -0400 Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s3HU8-0006FI-Tz for qemu-devel@nongnu.org; Sat, 04 May 2024 11:39:38 -0400 Received: by mail-pg1-x52d.google.com with SMTP id 41be03b00d2f7-5e42b4bbfa4so319570a12.1 for ; Sat, 04 May 2024 08:39:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714837175; x=1715441975; 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=/dNPNLs1khRCpqkW7qQSkGpf2gCcH5jGPYIjxIk0MdY=; b=Dtl7I85o02IsilE/RAvQycghH3veu4YufVfJT+ozjzsmkH/RZdFCz6zTkMV4NZpeme ERsGso6XoTNf/G8GfWpv9nQtRLyT0TFVPtbjAg4pLlIo2spWKPaVPAh+X+6o/6gTokHB 5LZdtfDmH4/T+a9ipliyJUWHUBokQqbUF9zXDme1cxC3KUREFKJIjyFoSPadZM8HxNYK Sdl4OhlmbTYDx2p6HWzT9l5TPjNL4wLFHf98rToNMhFmEg637LnYYfRPbLq7iamD9o51 mAhP7c4B1E8IGH/YUEg5/1/sOpUZiZv4VbjtbEyD11ze3azYJyh/rhLGuQ2wMhDz4FZP CRDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714837175; x=1715441975; 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=/dNPNLs1khRCpqkW7qQSkGpf2gCcH5jGPYIjxIk0MdY=; b=itz0WwvV944T5SyWhQyvYwhJDaV717Q7hLNE+m+v9ZlsfVOcCrSrskbe3aqo+iUn3l UF7BKWyAGgqd/Ubow376QCX43yu2ye0S6dNqsvRptopMHNFJPE1vAhC+iehIhEVT5y/T WoocvN84hdUmitpG/o2EQUyrL1YTOIqB6eN43QUHTU4gHg841s8iQEtIwWTj9NsWQbBW eYvjJJu6uymk8VIuZeQnRQpVEuadD39dH4lWeORYPH46px8nhOnURj7X1RFCeM3HRynj OGORFRU8EGZnwmQwc37tYFBAzTs7Z7oLFHO7kip4MHJEaMhibIhnPmuqqSYwzkT/gELG ukPQ== X-Gm-Message-State: AOJu0Yw6ZGm0eX8kt9i7kM5yJG5ZnXX1QOyM2MJkyxtg11Y58WuRXfkY QwrcY/OMGv7Ins5nXSuJTh4SN9SEzo1xlfLFKG+NdL9JPP1IMQkKdPyI6bduxGUPCIe5Z/W39DV U X-Received: by 2002:a17:902:ea0e:b0:1e5:3d8a:75fd with SMTP id s14-20020a170902ea0e00b001e53d8a75fdmr6739272plg.69.1714837175579; Sat, 04 May 2024 08:39:35 -0700 (PDT) Received: from stoup.. (174-21-72-5.tukw.qwest.net. [174.21.72.5]) by smtp.gmail.com with ESMTPSA id n15-20020a170902e54f00b001e4d22f828fsm5197859plf.33.2024.05.04.08.39.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 May 2024 08:39:35 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 8/9] target/alpha: Split out gen_pc_disp Date: Sat, 4 May 2024 08:39:25 -0700 Message-Id: <20240504153926.357845-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240504153926.357845-1-richard.henderson@linaro.org> References: <20240504153926.357845-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52d; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52d.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 Prepare for pcrel by not modifying cpu_pc before use, in the case of JSR. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20240503072014.24751-9-philmd@linaro.org> --- target/alpha/translate.c | 41 ++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/target/alpha/translate.c b/target/alpha/translate.c index c1a55e5153..86402d96d5 100644 --- a/target/alpha/translate.c +++ b/target/alpha/translate.c @@ -252,6 +252,11 @@ static void st_flag_byte(TCGv val, unsigned shift) tcg_gen_st8_i64(val, tcg_env, get_flag_ofs(shift)); } +static void gen_pc_disp(DisasContext *ctx, TCGv dest, int32_t disp) +{ + tcg_gen_movi_i64(dest, ctx->base.pc_next + disp); +} + static void gen_excp_1(int exception, int error_code) { TCGv_i32 tmp1, tmp2; @@ -263,7 +268,7 @@ static void gen_excp_1(int exception, int error_code) static DisasJumpType gen_excp(DisasContext *ctx, int exception, int error_code) { - tcg_gen_movi_i64(cpu_pc, ctx->base.pc_next); + gen_pc_disp(ctx, cpu_pc, 0); gen_excp_1(exception, error_code); return DISAS_NORETURN; } @@ -427,14 +432,12 @@ static DisasJumpType gen_store_conditional(DisasContext *ctx, int ra, int rb, static void gen_goto_tb(DisasContext *ctx, int idx, int32_t disp) { - uint64_t dest = ctx->base.pc_next + disp; - - if (translator_use_goto_tb(&ctx->base, dest)) { + if (translator_use_goto_tb(&ctx->base, ctx->base.pc_next + disp)) { tcg_gen_goto_tb(idx); - tcg_gen_movi_i64(cpu_pc, dest); + gen_pc_disp(ctx, cpu_pc, disp); tcg_gen_exit_tb(ctx->base.tb, idx); } else { - tcg_gen_movi_i64(cpu_pc, dest); + gen_pc_disp(ctx, cpu_pc, disp); tcg_gen_lookup_and_goto_ptr(); } } @@ -442,7 +445,7 @@ static void gen_goto_tb(DisasContext *ctx, int idx, int32_t disp) static DisasJumpType gen_bdirect(DisasContext *ctx, int ra, int32_t disp) { if (ra != 31) { - tcg_gen_movi_i64(ctx->ir[ra], ctx->base.pc_next); + gen_pc_disp(ctx, ctx->ir[ra], 0); } /* Notice branch-to-next; used to initialize RA with the PC. */ @@ -1091,7 +1094,7 @@ static DisasJumpType gen_call_pal(DisasContext *ctx, int palcode) } /* Allow interrupts to be recognized right away. */ - tcg_gen_movi_i64(cpu_pc, ctx->base.pc_next); + gen_pc_disp(ctx, cpu_pc, 0); return DISAS_PC_UPDATED_NOCHAIN; case 0x36: @@ -1138,19 +1141,17 @@ static DisasJumpType gen_call_pal(DisasContext *ctx, int palcode) #else { TCGv tmp = tcg_temp_new(); - uint64_t exc_addr = ctx->base.pc_next; - uint64_t entry = ctx->palbr; + uint64_t entry; + gen_pc_disp(ctx, tmp, 0); if (ctx->tbflags & ENV_FLAG_PAL_MODE) { - exc_addr |= 1; + tcg_gen_ori_i64(tmp, tmp, 1); } else { - tcg_gen_movi_i64(tmp, 1); - st_flag_byte(tmp, ENV_FLAG_PAL_SHIFT); + st_flag_byte(tcg_constant_i64(1), ENV_FLAG_PAL_SHIFT); } - - tcg_gen_movi_i64(tmp, exc_addr); tcg_gen_st_i64(tmp, tcg_env, offsetof(CPUAlphaState, exc_addr)); + entry = ctx->palbr; entry += (palcode & 0x80 ? 0x2000 + (palcode - 0x80) * 64 : 0x1000 + palcode * 64); @@ -2344,9 +2345,13 @@ static DisasJumpType translate_one(DisasContext *ctx, uint32_t insn) /* JMP, JSR, RET, JSR_COROUTINE. These only differ by the branch prediction stack action, which of course we don't implement. */ vb = load_gpr(ctx, rb); - tcg_gen_andi_i64(cpu_pc, vb, ~3); if (ra != 31) { - tcg_gen_movi_i64(ctx->ir[ra], ctx->base.pc_next); + tmp = tcg_temp_new(); + tcg_gen_andi_i64(tmp, vb, ~3); + gen_pc_disp(ctx, ctx->ir[ra], 0); + tcg_gen_mov_i64(cpu_pc, tmp); + } else { + tcg_gen_andi_i64(cpu_pc, vb, ~3); } ret = DISAS_PC_UPDATED; break; @@ -2908,7 +2913,7 @@ static void alpha_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu) gen_goto_tb(ctx, 0, 0); break; case DISAS_PC_STALE: - tcg_gen_movi_i64(cpu_pc, ctx->base.pc_next); + gen_pc_disp(ctx, cpu_pc, 0); /* FALLTHRU */ case DISAS_PC_UPDATED: tcg_gen_lookup_and_goto_ptr(); From patchwork Sat May 4 15:39:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 794625 Delivered-To: patch@linaro.org Received: by 2002:adf:a453:0:b0:34e:ceec:bfcd with SMTP id e19csp190099wra; Sat, 4 May 2024 08:40:55 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWtDNRiOlD5JRmCgz+7nr5AhwJeAigudcyrXrBZnZSgFI2Ci7LE8gZAiD3Sff9jBpcGlgfuW7XxHGJopM05TPVQ X-Google-Smtp-Source: AGHT+IHZnQe3YJSybBYBm8JWQ+9lBOYV6uPgQMKfZoqhl1Gdg5WDdt96eGgUx+CMtI1yFvjrcVCK X-Received: by 2002:a05:6808:8e9:b0:3c7:c12:e2fb with SMTP id d9-20020a05680808e900b003c70c12e2fbmr6037306oic.56.1714837255660; Sat, 04 May 2024 08:40:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714837255; cv=none; d=google.com; s=arc-20160816; b=vMw2CkT2XVDbAw7amfK/xwMBDc0dINAuZb68gJHHwlUdjxuNSwdRYRGSwGLCaU5VyB 6TeepjBe98wCFuU9Mp+5QQe1cLxWSpWwhz2umJFnQKbzqSu2U/I3WsMXBd1iiOKtJn/t aXHVLb3Gp1l4yT/LvqDaX2I9ZufbzMF4khcBBOhbEzqXPOcyT+C+0pBoZjhHx9B48fub mqYJxZcOcMqr1a8TCBY6vBnIcOaUIs2LVPf4LYstoOTWw+OqzO1tbKbd9epkSa44OFnt uyCSoPpBRJRDpW9YZzLVCFgLYudeDOREqs7BjOLNM+R7/LnuwNhJMjJRNqZDGSMzeU3D Mmng== 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=MWL0Ke+Jw6QzfCzbT3Y2xG1VsHYECu3YiFT2GS703uA=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=Z67T2x4mnYBL9pkHIwRxZ5Uco9cW0vnj3JoQDLgYah1bjWCahmp2Z3WEunsTiDRQNU Bx1VDWj7g2113o/UoXvVXoSTNUV3ngYyLEUl4ojlBtfE8HoVdktBsND1M4raxiHRd1zp pnHeXGcFiaFB4apLl0Hwg1RS/k5MVmC+ydw/fa7Cn9crcFpql8JXJUMdr9jwN2wMad1J xs/6BoKXCNI1WpejQvh1RnXOaDy3IqPkKJNuGRdDFs0//Vu3KzLgJksr92KM/SL7SaSw Mw0S4WiC7CW33mCwThkShv4wx2nwiW6gywB363ubo1UtlWUxzy0+0asiq5NEamLBTyQ7 TwmA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PZhR3wv5; 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 2-20020a0562140cc200b006a0af637933si5971728qvx.452.2024.05.04.08.40.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 04 May 2024 08:40: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=PZhR3wv5; 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 1s3HUC-00025T-VQ; Sat, 04 May 2024 11:39:40 -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 1s3HUB-00024d-IT for qemu-devel@nongnu.org; Sat, 04 May 2024 11:39:39 -0400 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s3HU9-0006FT-MV for qemu-devel@nongnu.org; Sat, 04 May 2024 11:39:39 -0400 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1ec69e3dbcfso4591375ad.0 for ; Sat, 04 May 2024 08:39:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714837176; x=1715441976; 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=MWL0Ke+Jw6QzfCzbT3Y2xG1VsHYECu3YiFT2GS703uA=; b=PZhR3wv5PKdhPjG1nlhi7rmgPT8fVobamOaXatYSr7N2papdTW90+3jMBBpFldf/Y1 Qa1Al77P7b8hae9wtIFaLLlFrT3g3e8CElHRUSAReH5qAM9uMy6ebR8amQjgO8Q9i8wu zzOmlXSqR/teF9T/+2m7GiKTPaasmoA8rfJerQq2HlKSzdSjbdAMoPSTzzpxSXUdPnOK SwxP5jPn0VlTwNbC7jDz+5dMO+VBfWlaW1c9+s+MpH336ClJEq6TfIpages9M2V47R1n 1hd2nqdzwOPJ1BqHy/7Xxs24BWnRN1yXaCBIAIHU1cvtyOUbOnZgkt4B3vdiTQCn7Bqm nH/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714837176; x=1715441976; 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=MWL0Ke+Jw6QzfCzbT3Y2xG1VsHYECu3YiFT2GS703uA=; b=BPZaNx3QM8bEYx6oDLw1l1ty/BebhQrpsH1KFhGBBVcyZxXB9mcqLin8f0Y1dVhx6J pIKaftkWTuBttTxgcEdEr96mKoTosFL2X1pbPR0Z9x9qDGLxRw/v0+zGmp4zYRvzBzhx 431FcpnJZRmPB96c1HV6eKvOCaONuOwB9DQ6ExkxQYo1yz5LCwQeFoyGHXasJS54G5lm pGGY1OCpibtHj3CVfie4qkU7Z8uwS1agzPK3SSLQP/TD8W0dlSdE/hrDDQf+UxpImwjc 8XEIj4u2srnMoRAlx6Yr1n55uUed2Td+Fudie+Dn/Jq6wuMdukovAsql3ZfhzAKpzH5U n2ug== X-Gm-Message-State: AOJu0YxGJqNTQkKEUmTFKqwGfvLxiweGR5QqbjKVtJ7kerN9VLRf0mG2 Z3Oq/+yVMwECMRSfY8QL9pTjk4QsBYiUBe0EwpLhWYPK8UPliEX7vILSJyBHfbEg6p0Yh6X+uQA V X-Received: by 2002:a17:903:234b:b0:1ec:a65a:e4ad with SMTP id c11-20020a170903234b00b001eca65ae4admr6419420plh.66.1714837176291; Sat, 04 May 2024 08:39:36 -0700 (PDT) Received: from stoup.. (174-21-72-5.tukw.qwest.net. [174.21.72.5]) by smtp.gmail.com with ESMTPSA id n15-20020a170902e54f00b001e4d22f828fsm5197859plf.33.2024.05.04.08.39.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 May 2024 08:39:35 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 9/9] target/alpha: Implement CF_PCREL Date: Sat, 4 May 2024 08:39:26 -0700 Message-Id: <20240504153926.357845-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240504153926.357845-1-richard.henderson@linaro.org> References: <20240504153926.357845-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62c.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 Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20240503072014.24751-10-philmd@linaro.org> --- target/alpha/cpu.c | 23 ++++++++++++++++++++++- target/alpha/translate.c | 29 +++++++++++++++++++++++++---- 2 files changed, 47 insertions(+), 5 deletions(-) diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c index f98d022671..0e2fbcb397 100644 --- a/target/alpha/cpu.c +++ b/target/alpha/cpu.c @@ -38,12 +38,27 @@ static vaddr alpha_cpu_get_pc(CPUState *cs) return env->pc; } +static void alpha_cpu_synchronize_from_tb(CPUState *cs, + const TranslationBlock *tb) +{ + /* The program counter is always up to date with CF_PCREL. */ + if (!(tb_cflags(tb) & CF_PCREL)) { + CPUAlphaState *env = cpu_env(cs); + env->pc = tb->pc; + } +} + static void alpha_restore_state_to_opc(CPUState *cs, const TranslationBlock *tb, const uint64_t *data) { CPUAlphaState *env = cpu_env(cs); - env->pc = data[0]; + + if (tb_cflags(tb) & CF_PCREL) { + env->pc = (env->pc & TARGET_PAGE_MASK) | data[0]; + } else { + env->pc = data[0]; + } } static bool alpha_cpu_has_work(CPUState *cs) @@ -78,6 +93,11 @@ static void alpha_cpu_realizefn(DeviceState *dev, Error **errp) AlphaCPUClass *acc = ALPHA_CPU_GET_CLASS(dev); Error *local_err = NULL; +#ifndef CONFIG_USER_ONLY + /* Use pc-relative instructions in system-mode */ + cs->tcg_cflags |= CF_PCREL; +#endif + cpu_exec_realizefn(cs, &local_err); if (local_err != NULL) { error_propagate(errp, local_err); @@ -190,6 +210,7 @@ static const struct SysemuCPUOps alpha_sysemu_ops = { static const TCGCPUOps alpha_tcg_ops = { .initialize = alpha_translate_init, + .synchronize_from_tb = alpha_cpu_synchronize_from_tb, .restore_state_to_opc = alpha_restore_state_to_opc, #ifdef CONFIG_USER_ONLY diff --git a/target/alpha/translate.c b/target/alpha/translate.c index 86402d96d5..db847e7a23 100644 --- a/target/alpha/translate.c +++ b/target/alpha/translate.c @@ -54,6 +54,9 @@ struct DisasContext { uint32_t tbflags; int mem_idx; + /* True if generating pc-relative code. */ + bool pcrel; + /* implver and amask values for this CPU. */ int implver; int amask; @@ -254,7 +257,12 @@ static void st_flag_byte(TCGv val, unsigned shift) static void gen_pc_disp(DisasContext *ctx, TCGv dest, int32_t disp) { - tcg_gen_movi_i64(dest, ctx->base.pc_next + disp); + uint64_t addr = ctx->base.pc_next + disp; + if (ctx->pcrel) { + tcg_gen_addi_i64(dest, cpu_pc, addr - ctx->base.pc_first); + } else { + tcg_gen_movi_i64(dest, addr); + } } static void gen_excp_1(int exception, int error_code) @@ -433,8 +441,14 @@ static DisasJumpType gen_store_conditional(DisasContext *ctx, int ra, int rb, static void gen_goto_tb(DisasContext *ctx, int idx, int32_t disp) { if (translator_use_goto_tb(&ctx->base, ctx->base.pc_next + disp)) { - tcg_gen_goto_tb(idx); - gen_pc_disp(ctx, cpu_pc, disp); + /* With PCREL, PC must always be up-to-date. */ + if (ctx->pcrel) { + gen_pc_disp(ctx, cpu_pc, disp); + tcg_gen_goto_tb(idx); + } else { + tcg_gen_goto_tb(idx); + gen_pc_disp(ctx, cpu_pc, disp); + } tcg_gen_exit_tb(ctx->base.tb, idx); } else { gen_pc_disp(ctx, cpu_pc, disp); @@ -2852,6 +2866,7 @@ static void alpha_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cpu) ctx->tbflags = ctx->base.tb->flags; ctx->mem_idx = alpha_env_mmu_index(env); + ctx->pcrel = ctx->base.tb->cflags & CF_PCREL; ctx->implver = env->implver; ctx->amask = env->amask; @@ -2887,7 +2902,13 @@ static void alpha_tr_tb_start(DisasContextBase *db, CPUState *cpu) static void alpha_tr_insn_start(DisasContextBase *dcbase, CPUState *cpu) { - tcg_gen_insn_start(dcbase->pc_next); + DisasContext *ctx = container_of(dcbase, DisasContext, base); + + if (ctx->pcrel) { + tcg_gen_insn_start(dcbase->pc_next & ~TARGET_PAGE_MASK); + } else { + tcg_gen_insn_start(dcbase->pc_next); + } } static void alpha_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu)