From patchwork Mon Oct 28 15:18:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 839126 Delivered-To: patch@linaro.org Received: by 2002:adf:e287:0:b0:37d:45d0:187 with SMTP id v7csp1651061wri; Mon, 28 Oct 2024 08:21:32 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV/FBjYVHYNWNz5gm8OIcBG7dp4vmPN0T1I0S6Dvgaccy5Hd3ByY3ET4REzxikXKMT/6Qb2SQ==@linaro.org X-Google-Smtp-Source: AGHT+IFiQwyoDvYGOJXbDuLsROYro7n2g5NrHXlKB1MM3XkAtoOEBVt9INGN6joKxeT9cTa+v0M3 X-Received: by 2002:a05:6102:1610:b0:4a4:93d0:df13 with SMTP id ada2fe7eead31-4a8cfb8572amr6455856137.16.1730128892238; Mon, 28 Oct 2024 08:21:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1730128892; cv=none; d=google.com; s=arc-20240605; b=JN3Z39fC4doDU64A/UcBhGUs+KmI9U7/ZpfzmDvnjPSb83+AUbJMUDQx+ZVx+lmdEP iiXP/WGMcckUXmP/z8CPSF6DMMTwVgceDh1/f+J0hburAdyuuA1prR6DjlAVVtg4655Z /Aex4alTHghJs9XKD3gwGMDtKKn+U9//fvgDPnElIazleBxm52b34bgJx3pjFXwZ4Mzy mLAEQeHtfAf8BHyJTFt64cVpquDMoGDJ1r0TQCihieW5t3/rctWQ4430cHJHxZ7ddGAj w8fM9e+jf1htOFP52Z8TcE0aK0NsLDceh36htci9qGf/7sKXSjVUo/A7cmm3no073ymn G0qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=+8Ycd/z4FSPPHkMPrNjkGaE9+9ckB94sy40JwoCKvsU=; fh=MmLbUYMFRk+lJjthCIVqr42l66o0jnBuoFM0CcrBzlo=; b=EgalClYgNPtLKRpPHPFLiEIwGIFgvZAMPCrTXA4TOAYYuNhtgJA8ZkPnlMbOPNy6hE E+OrYcywDL85kL4TNZnWKNG5rL4x7/fkAVNSIIJPyjWlq2WiC5VoRpsyY8n5Q1sSrXnX gCw/Shon1E1aJ4OadvaFZcG/l87EImQnQJiifq573+8HmOyMXSxgdwK9bCssePubQb2e J8DPzrjszCVRr/8QQ8Nz/aORrKMd/bdYO26+zJxKFfsOJQZ1keelzL336vOzoUq6SMF5 rRLAu4gxnj3+37t1undEbFPhIuJMrsDWLQNrWAGlIsweYaoDBQR9zVG+wWI5VZaDeNqI Swbw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=a1OjoLLN; 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ada2fe7eead31-4a8c53469besi1480843137.444.2024.10.28.08.21.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 28 Oct 2024 08:21:32 -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=@redhat.com header.s=mimecast20190719 header.b=a1OjoLLN; 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=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t5RWW-00088U-3l; Mon, 28 Oct 2024 11:19:16 -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 1t5RWU-000881-6U for qemu-devel@nongnu.org; Mon, 28 Oct 2024 11:19:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t5RWS-0000lU-Nb for qemu-devel@nongnu.org; Mon, 28 Oct 2024 11:19:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1730128752; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+8Ycd/z4FSPPHkMPrNjkGaE9+9ckB94sy40JwoCKvsU=; b=a1OjoLLN+jN0/8jDTNH6hJ+V/zGDi5IQ+x7J3Ano8EbLta7q0BDUDqjGTwCnOW3SlhPn84 RhvBoUk/gBMi8rgk7d3UtPPM4NloXYMUJjMJzYzUoYDTs/+D8HMpFWRiRxAHg6VY1NIoU/ 8htWLoiLvPzLi7lXIrqWBFSSGCrt+cI= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-589-0hOPG-MMMzmhPwXmff9BiA-1; Mon, 28 Oct 2024 11:19:10 -0400 X-MC-Unique: 0hOPG-MMMzmhPwXmff9BiA-1 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-37d4922d8c7so2507929f8f.1 for ; Mon, 28 Oct 2024 08:19:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730128748; x=1730733548; 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=+8Ycd/z4FSPPHkMPrNjkGaE9+9ckB94sy40JwoCKvsU=; b=Td7fATlVkptJgKusW+TAZE0UtihVa2upBUyNssNFtw1SBZO1mXbuPssiK0WBO5Qthp 7tsdiIJzh6+KNF3USsH83NYQVYhZY6zvUp4/KK/dBXU0Zv/GGeKnCC8lzr8FM5kfEEvq VRuFDOJD3WqNAZ25O0B7X+Co2mLHjutrCzqfdTMviN/hvL/qLLDL+vnayqXSeNeyMl3/ kggStq0CrznZyN77WUXab1e+NNX1XX2k6OzIn/qyJHegqojhhRHFhCJLCCr1IlS3Jdv1 Z4Vj2Iq2FrrWBjVjUD1eDExklGMlbuKYa7iU9QH6FdlLEYeIh3rmAcLk0xoH9d40NKcE Mm7Q== X-Gm-Message-State: AOJu0YxT9veivJiX9sx8+j2tPPEJ9HKiRKtNEgti76h5VjST+Wzy6NS1 L+AExSI5pUghho3lBVWZHUB624gHckPX9cd/z4kPzk/uzsBZlXrgWBTmb4f0/zhr4CAmJnmjrPd F21w6dENG86LN76VszjAxrBBG7RK8EpMxbmi6Qbepo2YdJ7m5eJSlesFoOFXFZKKRPXECrbPCzO Qgimt8nAvxNUEynf0zBa35WdlSSZhe6z1vcgvpzGU= X-Received: by 2002:a5d:49c2:0:b0:37d:373c:ed24 with SMTP id ffacd0b85a97d-380610f41damr6656490f8f.4.1730128748390; Mon, 28 Oct 2024 08:19:08 -0700 (PDT) X-Received: by 2002:a5d:49c2:0:b0:37d:373c:ed24 with SMTP id ffacd0b85a97d-380610f41damr6656469f8f.4.1730128747994; Mon, 28 Oct 2024 08:19:07 -0700 (PDT) Received: from [192.168.10.3] ([151.49.226.83]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4319360c10asm112627335e9.43.2024.10.28.08.19.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Oct 2024 08:19:07 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org Subject: [PATCH 04/14] target/i386: Rearrange CCOp Date: Mon, 28 Oct 2024 16:18:41 +0100 Message-ID: <20241028151851.376355-5-pbonzini@redhat.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241028151851.376355-1-pbonzini@redhat.com> References: <20241028151851.376355-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.373, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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: Richard Henderson Give the first few enumerators explicit integer constants, align the BWLQ enumerators. This will be used to simplify ((op - CC_OP_*B) & 3). Signed-off-by: Richard Henderson Link: https://lore.kernel.org/r/20240701025115.1265117-4-richard.henderson@linaro.org Signed-off-by: Paolo Bonzini --- target/i386/cpu.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index c89db50eddc..b605f592521 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1292,11 +1292,10 @@ uint64_t x86_cpu_get_supported_feature_word(X86CPU *cpu, FeatureWord w); * are only needed for conditional branches. */ typedef enum { - CC_OP_DYNAMIC, /* must use dynamic code to get cc_op */ - CC_OP_EFLAGS, /* all cc are explicitly computed, CC_SRC = flags */ - CC_OP_ADCX, /* CC_DST = C, CC_SRC = rest. */ - CC_OP_ADOX, /* CC_SRC2 = O, CC_SRC = rest. */ - CC_OP_ADCOX, /* CC_DST = C, CC_SRC2 = O, CC_SRC = rest. */ + CC_OP_EFLAGS = 0, /* all cc are explicitly computed, CC_SRC = flags */ + CC_OP_ADCX = 1, /* CC_DST = C, CC_SRC = rest. */ + CC_OP_ADOX = 2, /* CC_SRC2 = O, CC_SRC = rest. */ + CC_OP_ADCOX = 3, /* CC_DST = C, CC_SRC2 = O, CC_SRC = rest. */ CC_OP_MULB, /* modify all flags, C, O = (CC_SRC != 0) */ CC_OP_MULW, @@ -1369,9 +1368,12 @@ typedef enum { CC_OP_POPCNTQ__, CC_OP_POPCNT = sizeof(target_ulong) == 8 ? CC_OP_POPCNTQ__ : CC_OP_POPCNTL__, + CC_OP_DYNAMIC, /* must use dynamic code to get cc_op */ CC_OP_NB, } CCOp; -QEMU_BUILD_BUG_ON(CC_OP_NB >= 128); + +/* See X86DecodedInsn.cc_op, using int8_t. */ +QEMU_BUILD_BUG_ON(CC_OP_DYNAMIC > INT8_MAX); typedef struct SegmentCache { uint32_t selector;