From patchwork Tue Apr 16 04:06:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 789205 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:dcf:b0:346:15ad:a2a with SMTP id dw15csp104709wrb; Mon, 15 Apr 2024 21:07:13 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVA+pOrKp78/Qqpz+512YHBcSWCfwbip7vXP5YnoaB1WCDNQBqAVHt9S4N+aQ7FP/2zmmSYVDwcKB9yQreySHI8 X-Google-Smtp-Source: AGHT+IFbE0prUxP6/6P1rpIPn9ZVXTq45Fw7X9xvSWKeSGCClrQhxVutZN2beqAi6r/p3u5dVBtu X-Received: by 2002:ac8:5d05:0:b0:437:53:4ab8 with SMTP id f5-20020ac85d05000000b0043700534ab8mr6739772qtx.1.1713240433455; Mon, 15 Apr 2024 21:07:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1713240433; cv=none; d=google.com; s=arc-20160816; b=UYjrnFB32Nc8sA0ELIjiHwGc8Io2derp+4dB+l6WZggFigl/6H96SHSKE27DpnhEIj HxeL1pqJ/vUKiSSstGQW9id/khrKJKtDkjHWJ6iLR3+56+axUeFcdR7sAdqGo4DCSHy8 MpNo2xs1TjMzJUrS/CHhLSoA4eFC3Sjll1h9WvgMAD+w2V2jH3ksLDFar+Xr63ehR3fo vK0VoUFEtYurqMSTIiGTWwmMBpAMtDSJRw7cOGhz/W9yQQ6cNTfv/Nn6BFFH8bWovSr+ 6+z1OzsVuqcsUqavHpqtVToBoQzZAjifxUJv/m6TfPIW9s7kL2LzUCG4nJTvfjEjbGfY ziAA== 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=IZaZlRSWcRP8TIIFtrlkzqwhRaKDjzyacbuo5KubVSI=; fh=HGMLmPLDRBgS2M2DmRioi6Q+pUL3jqoEM8UtJkY6Dtg=; b=XJ0OMz+wQdVJaJ8DyePC6IXStZySpXdtu5c/K+r9O55rKldVQe+aDh6S00w9+HXTaE YquiGl3Aky/F1ENpkP1sfQlk4m/MQwhqwuXbmLpkjrwOfj0JjC3rxoO8yyqml2eYo6ZZ vEA8GzUN6a46tpANDyI3wUI9WRTD8mjR+hDKW4pJOfOfvOkScXozYAcO6mt8yXJ63Adu En7q/Mh77AwxW59ZMGSyEzmWuDojnRas1gAR4Ud3f139GrO+/dIqij1VROYZfd2dJNyR OcISloTqFqL7UUQ1FTUgC2/67UGA/epFOZ8TEBeIpHc+3DNsiBJRl4thJpKN4oD1D3p5 EtAQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TS9yRPru; 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 g8-20020ac85808000000b0043699deced2si8733106qtg.475.2024.04.15.21.07.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 15 Apr 2024 21:07:13 -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=TS9yRPru; 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 1rwa5O-0008Em-4f; Tue, 16 Apr 2024 00:06:22 -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 1rwa5L-00085B-J6 for qemu-devel@nongnu.org; Tue, 16 Apr 2024 00:06:19 -0400 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rwa5J-0007AM-Qe for qemu-devel@nongnu.org; Tue, 16 Apr 2024 00:06:19 -0400 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1e4f341330fso32496925ad.0 for ; Mon, 15 Apr 2024 21:06:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713240376; x=1713845176; 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=IZaZlRSWcRP8TIIFtrlkzqwhRaKDjzyacbuo5KubVSI=; b=TS9yRPrupgnRGUxLgkS1MrwrA1KW3h7M937fpIRazfr5rJq/03hJKWyKs/7NKqB+OW XMAzqduRZWuO1BOfBvG3eGy6pZIU+4N7rRG/MRQmW6/WOvroTcGWfJRavSc0ZZD39bKa JQ7kXEdAB8nzTc618g4aNo42qYecF75DzPwvGZquzWXQ5Tfb3++sK5dU4VqPXV+vqDgi GpEEb+mNDs796AafXKkb7Zs3GjPvAn9iIFpxEdNtEc0HUUPtrQuhvmewVXOQA6nwDerG PB9KGdxA7QOnPDJgNKUaQ/cqjwDLCea5+ez7sefKNL2S31H7FmVEBTTewg8URf9ldnqO xJlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713240376; x=1713845176; 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=IZaZlRSWcRP8TIIFtrlkzqwhRaKDjzyacbuo5KubVSI=; b=LcDuJUXIXlDGCtsCBEc2sYq81DN2DEm0FaWD2cz3hVSQa8QYZpXcLl8hFzIJKn+bqv utZ6zCvCMPGmhewNLsRqkql2zv0UtqIr2+EyudHKkEKCP21hV41lOK7cDFpYVxJCH053 ANfJorONozA1tR9+sHTOXqUuvvZ3jlvSsQKHvmSSJXRCLK/Jv14oF4lO0ZlBUgYovfBD KJ8EoWhrqavLLrbT+PrrAWc//jcDpxTy+pfAoaVTPpfZP84djVYkCnJEjOOQwXqTPfKA 39J6tTsXngl025Mke+8vR0jM2+HMIHTjatQFxoSGM7Mel9BiSXsHB8y3of3MouM636ER pnJw== X-Gm-Message-State: AOJu0Yze3dHi1Ra1vrgSpiMSO4GUvPIisApym7tGoL0TqLPm+sUZYwYm njzWx3y/xu8ElG7wXnzzDLIRqISHlooQXhxSiOvhH+F38EFOK9s+yllqaxDIgr1CZmIIDQ/N3ki c X-Received: by 2002:a17:902:eacd:b0:1e2:23b9:eb24 with SMTP id p13-20020a170902eacd00b001e223b9eb24mr9864530pld.33.1713240376408; Mon, 15 Apr 2024 21:06:16 -0700 (PDT) Received: from stoup.. (174-21-72-5.tukw.qwest.net. [174.21.72.5]) by smtp.gmail.com with ESMTPSA id l1-20020a170902f68100b001e3e244e5c0sm8694439plg.78.2024.04.15.21.06.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 21:06:16 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: pierrick.bouvier@linaro.org Subject: [PATCH 6/7] target/i386: Introduce cpu_compute_eflags_ccop Date: Mon, 15 Apr 2024 21:06:08 -0700 Message-Id: <20240416040609.1313605-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240416040609.1313605-1-richard.henderson@linaro.org> References: <20240416040609.1313605-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x636.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 This is a generalization of cpu_compute_eflags, with a dynamic value of cc_op, and is thus tcg specific. Signed-off-by: Richard Henderson Reviewed-by: Pierrick Bouvier --- 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 6b05738079..285f26d99d 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -2379,6 +2379,8 @@ void cpu_x86_inject_mce(Monitor *mon, X86CPU *cpu, int bank, uint32_t cpu_cc_compute_all(CPUX86State *env1); +uint32_t cpu_compute_eflags_ccop(CPUX86State *env, CCOp op); + static inline uint32_t cpu_compute_eflags(CPUX86State *env) { uint32_t eflags = 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); } +uint32_t cpu_compute_eflags_ccop(CPUX86State *env, CCOp op) +{ + uint32_t eflags; + + eflags = helper_cc_compute_all(CC_DST, CC_SRC, CC_SRC2, op); + eflags |= env->df & DF_MASK; + eflags |= 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) {