From nobody Mon Nov 25 19:30:02 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1717644666; cv=none; d=zohomail.com; s=zohoarc; b=X8rvyN5u2R8Hv/7y+u8jEQL3/xhX/dVQpU9NbqYHWdAzgJQwRCEavYae2dMh4dGr7pb1Tz8LoJb98Vxq/y/Ytwqo/tldiMv8mdCAP0EHYjvJ4x5HepymRWgw710G7dCzgG5NMVRj4B4EoMvNpS317wlwUTupjNHq+mkxTlE/2uA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1717644666; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+Ta0pM6KcQt7rsvA3Ju6z7MgKxBm5RGfKrSL9DmIR7Q=; b=c05g/DziIrPoo+QXZq2IS/DUvncCEbIXNv6C2QGOsW+QZJDMTIAoY7wXpBAisPGLZVFIPIz4u6oJnOvKyr5n050PK6z193kovb2d3sQcNji0Z0Y0aRJK5LkegPPHcx9/DTlN59YNz/boKDF9QLyY8DbNVldWgyi9Wxybz1y9dYI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1717644666247441.353832826995; Wed, 5 Jun 2024 20:31:06 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sF3pQ-0003iN-JJ; Wed, 05 Jun 2024 23:30:19 -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 1sF3os-0003XB-0E for qemu-devel@nongnu.org; Wed, 05 Jun 2024 23:29:42 -0400 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sF3ok-0003mZ-UP for qemu-devel@nongnu.org; Wed, 05 Jun 2024 23:29:41 -0400 Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-2c24115469bso1202063a91.0 for ; Wed, 05 Jun 2024 20:29:34 -0700 (PDT) Received: from stoup.. ([71.212.132.216]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c254a76729sm4826265a91.0.2024.06.05.20.29.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 20:29:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717644573; x=1718249373; 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=+Ta0pM6KcQt7rsvA3Ju6z7MgKxBm5RGfKrSL9DmIR7Q=; b=yF5Jty6EHL2gesYbeckoTJGLhrPxUYGX4SPSngMw/Wwr3/ZkdHaVVNZPWFgcHUd6Wv EHKV+tCYQ8WRxMALtCYXqCCcED23CwsAz6lYSoXpcZBjimwQV9mUMJa3NQ/CdHneM0Ru lUuNSRUWjwAXI664meIHepiEEcf4t4cC6+daHkBi0yWolnqDto6JotRCtY1LPA5BdmPq YZ6GBiJrF5gVlWz2ZBTZds7QEKjwFbWZuq6Pnp2+FK/3JHb4jckf41ByzoOmSjSYJlY9 VnF6yvwd4HadOvHyeqJ/grIXYnJn2oB0xt6mnomL3NVYYVKniUZjaFhxNAeDO8M1RiyH CLRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717644573; x=1718249373; 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=+Ta0pM6KcQt7rsvA3Ju6z7MgKxBm5RGfKrSL9DmIR7Q=; b=PoEJFrtzOEQ6XJTSNi0maP8FDKzojVZcVzimE2WaemDOZtAbGrr+uxJPFNk3oFQNrt Pv4ub2U+4lx77NFDZXUlwvV0vyJ4jjHwyhoCNpjiIAMycnAGKZal6YLx/GQZDhiljyrI J6l1tiw+JGS7Z85f6pu4utfHmkAGjVNvHG4AeL/XBg84xXFQRk+xAVzm+r+6c4JiU18H O7jIz2Nu6av8wxZubZZ3+xB+jMuhwJFxfOM8ZA2YslxagH8/J3/7isfgqpb3ZsU85Nj3 wwiY6LqDjaWbrws1TgcMY/jddANC36SpSr+NvGnrxNab1VxZcSvh5Zsk/0CJ26gkjOgt eKRw== X-Gm-Message-State: AOJu0Yxjjh2R2aYVyrxMdi0NtrSQz8CESar5QsCy/0IG9JTljvg/vIX/ 4VfRMFfE/5Odldop1s6tHPges87S18Knr7WBs/C+ORwtkfBqO8+EcLS2ywhhsldcMsuQ+ygPITk K X-Google-Smtp-Source: AGHT+IEWvSQsT24ICh++D3LKliJRwg/QrL32ICiA72WqTPwr/Ewe709Ti3q4g0YAxBBOLljPKegXHQ== X-Received: by 2002:a17:90a:b014:b0:2bf:9eb3:cea7 with SMTP id 98e67ed59e1d1-2c299a04728mr1839256a91.24.1717644573154; Wed, 05 Jun 2024 20:29:33 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: pierrick.bouvier@linaro.org, alex.bennee@linaro.org Subject: [PATCH v2 6/9] target/i386: Introduce cpu_compute_eflags_ccop Date: Wed, 5 Jun 2024 20:29:23 -0700 Message-Id: <20240606032926.83599-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240606032926.83599-1-richard.henderson@linaro.org> References: <20240606032926.83599-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1033.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1717644667532100001 Content-Type: text/plain; charset="utf-8" This is a generalization of cpu_compute_eflags, with a dynamic value of cc_op, and is thus tcg specific. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- target/i386/cpu.h | 2 ++ target/i386/tcg/cc_helper.c | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index c64ef0c1a2..48ad6f495b 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -2431,6 +2431,8 @@ void cpu_x86_inject_mce(Monitor *mon, X86CPU *cpu, in= t bank, =20 uint32_t cpu_cc_compute_all(CPUX86State *env1); =20 +uint32_t cpu_compute_eflags_ccop(CPUX86State *env, CCOp op); + static inline uint32_t cpu_compute_eflags(CPUX86State *env) { uint32_t eflags =3D env->eflags; diff --git a/target/i386/tcg/cc_helper.c b/target/i386/tcg/cc_helper.c index f76e9cb8cf..8203682ca8 100644 --- a/target/i386/tcg/cc_helper.c +++ b/target/i386/tcg/cc_helper.c @@ -225,6 +225,16 @@ uint32_t cpu_cc_compute_all(CPUX86State *env) return helper_cc_compute_all(CC_DST, CC_SRC, CC_SRC2, CC_OP); } =20 +uint32_t cpu_compute_eflags_ccop(CPUX86State *env, CCOp op) +{ + uint32_t eflags; + + eflags =3D helper_cc_compute_all(CC_DST, CC_SRC, CC_SRC2, op); + eflags |=3D env->df & DF_MASK; + eflags |=3D env->eflags & ~(VM_MASK | RF_MASK); + return eflags; +} + target_ulong helper_cc_compute_c(target_ulong dst, target_ulong src1, target_ulong src2, int op) { --=20 2.34.1