From patchwork Wed Sep 11 16:50:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 827452 Delivered-To: patch@linaro.org Received: by 2002:adf:ab1c:0:b0:367:895a:4699 with SMTP id q28csp891185wrc; Wed, 11 Sep 2024 09:51:48 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWZeS6K3/d5YbMtaXcvUmUqic3v/pHN0x+fHTNbMCgQq+3ZOPFFRVD479CoSc428+ATRPC+bQ==@linaro.org X-Google-Smtp-Source: AGHT+IHnD6MGeQkN9NkZkLFncGaaXEDkcMPqiE1pVt6hgjFIAccl1jp/RBm6652SueV5DGy1aLN/ X-Received: by 2002:ac8:7f43:0:b0:457:c54b:5a10 with SMTP id d75a77b69052e-45820210c35mr205712831cf.54.1726073508164; Wed, 11 Sep 2024 09:51:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726073508; cv=none; d=google.com; s=arc-20240605; b=dF4AqHUSa4H4UUljWVnHNiRhYVMtdyxryAHzD4sqnDRngPMsMmv8dJ/6mOJFoukkkj xH/Xgq7FOoEsKe24SpUcho78HcsZNz+izEuIM7AH093a1ftrhcs6HYn5N6USq0p3Cl8N 9LLtAs5QjgnwiB9FdbFfibMQJB+BrgBNk6Nh9vRjk33Pc+GIdtIO/wZjxUBcPRsW94YQ Ezrmf97gzgxvLST+vpCJ8/568WX/Rt2aM+Y3MA380j7NEAUNxtH4/JGadwwwxf8nTkDp 9WkzpDsMheUCQceo7pxFgjrzrT6fHShGOeIMn5eiNBNA4nuVwl+4HSSIyyJ65ON7Gd23 p6AA== 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=Z2ZjvXoH00iViMW0slYpXozl5B8ORorypWDbC2UouOc=; fh=gW8xxqNJ+GKzLr7OBpcms3Apqae8iNJSKgK4r5swIT4=; b=KbDBBgTpO8564DuddxujSwUOtlXxV+n0IOXbkbkcVtvzVHL12dJzU0BxpMOpxX5dMj nKmKWK0ig+33nPV3pL1rmhkLDzwCkHJEqcTEZc3fdD83rt3OZMg8G60faBd4A7BRoSqT Kij9LKxMZMSxFfADPx++kqUDBprkQYFyqNRWNJHsQB4n5lC2ZRMbR6qrFaPrTweefDB8 /WAM7aH5NcVecNQB+/dQpI62Sbb8SOuIwb3MLOjE8B7vIwavR1eG1/BIWErWda4BKRpB GTQN1PzOEweHH1yzSGk4U4pmkV8E76UUBJjFAFuJYkUi8Fev/J0PuvQZg94KXnl7wc9M veew==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kZH4iL8t; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-45822f3d580si13842391cf.245.2024.09.11.09.51.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Sep 2024 09:51:48 -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=kZH4iL8t; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1soQYd-0002Z2-6o; Wed, 11 Sep 2024 12:51:07 -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 1soQYZ-0002QR-Jk for qemu-devel@nongnu.org; Wed, 11 Sep 2024 12:51:03 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1soQYX-0003gP-UN for qemu-devel@nongnu.org; Wed, 11 Sep 2024 12:51:03 -0400 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-718d8d6af8fso4618040b3a.3 for ; Wed, 11 Sep 2024 09:51:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726073461; x=1726678261; 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=Z2ZjvXoH00iViMW0slYpXozl5B8ORorypWDbC2UouOc=; b=kZH4iL8tJSQHUybIcKqziBVg1d4rmlzSVGSlwZDccjvchScW3l97PhDdJiFwVKSJsQ zdNJjTSyyxdNDunMk2lv1dXBQQPpRMxgfH40XNkk/xctk5ZD9e6hDkeo27MROdwwMT2x sDN3Bp13sTFO5upJBuIZbqDObjpTgKGOTE96lJcVsdTb2uZfUh4PvFTF1Bm7znHmHlJ3 pyjWJYgynz8eBuC8lGeMspgNy0TsCCp76hsAB8VMoJ4iHDcXUhu8hULkBX4rTw5VEQF/ 9+SXqvcHN0yVmWewyY69TORXeT+ul5S6nJnp+v5OVqnMC5gv97eQqfgY1gTnDX3ELhCu D+2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726073461; x=1726678261; 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=Z2ZjvXoH00iViMW0slYpXozl5B8ORorypWDbC2UouOc=; b=VNa+QvUtJBHJEZZviHdZfxU28CEEYYqX6OCEna10QMY8wuo00neR7wtA6K/EVc45E0 MfJFnPlqpQHXqrZvwg/9UKDtMug8ow+1QLtLZBT+S93d/yzcVxLD9lHVxqwxqbFXCe+U W7uetsPTRdMty+9NboygFKlfcNM5FJB/PYHCIotFDLkYDY5HlU7MRD+OmQGaanvvmuVT ryqxOHpQtrjIc40bWk2uoMlRsIPWecCWmu/jK/bZNbRKCwg1FKXMNbXHrskBelfk4+rY 4fMD7t6l0mOGvR6nf1fXYNuYM0+CmYH3ifYgFzQzTxgSfFYuGRIUf4gqgHu+4LOz9oLP /e6A== X-Gm-Message-State: AOJu0YzGE51dZo4t6QMwolD1kI1xRWdlUCNawCi6mHbbANpMp6xXYta/ 9FcK+OXFxTQNhq4yd5i4EhWtWq+3RWL3wt9DowDUgpmfcds5baUEAsCwpBdXmuNv7R0HOmxmOKe V X-Received: by 2002:a05:6a00:b83:b0:70b:a46:7db7 with SMTP id d2e1a72fcca58-719260962c0mr12138b3a.16.1726073460572; Wed, 11 Sep 2024 09:51:00 -0700 (PDT) Received: from stoup.. (174-21-81-121.tukw.qwest.net. [174.21.81.121]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71908fe4e7esm3186947b3a.80.2024.09.11.09.50.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Sep 2024 09:51:00 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: zhiwei_liu@linux.alibaba.com, tangtiancheng.ttc@alibaba-inc.com, philmd@linaro.org Subject: [PATCH v2 12/18] tcg/i386: Add predicate parameters to tcg_out_evex_opc Date: Wed, 11 Sep 2024 09:50:41 -0700 Message-ID: <20240911165047.1035764-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240911165047.1035764-1-richard.henderson@linaro.org> References: <20240911165047.1035764-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42e.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 Extend tcg_out_evex_opc to handle the predicate and zero-merging parameters of the evex prefix. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/i386/tcg-target.c.inc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc index b1d642fc67..f94a2a2385 100644 --- a/tcg/i386/tcg-target.c.inc +++ b/tcg/i386/tcg-target.c.inc @@ -674,7 +674,7 @@ static void tcg_out_vex_opc(TCGContext *s, int opc, int r, int v, } static void tcg_out_evex_opc(TCGContext *s, int opc, int r, int v, - int rm, int index) + int rm, int index, int aaa, bool z) { /* The entire 4-byte evex prefix; with R' and V' set. */ uint32_t p = 0x08041062; @@ -711,7 +711,9 @@ static void tcg_out_evex_opc(TCGContext *s, int opc, int r, int v, p = deposit32(p, 16, 2, pp); p = deposit32(p, 19, 4, ~v); p = deposit32(p, 23, 1, (opc & P_VEXW) != 0); + p = deposit32(p, 24, 3, aaa); p = deposit32(p, 29, 2, (opc & P_VEXL) != 0); + p = deposit32(p, 31, 1, z); tcg_out32(s, p); tcg_out8(s, opc); @@ -720,7 +722,7 @@ static void tcg_out_evex_opc(TCGContext *s, int opc, int r, int v, static void tcg_out_vex_modrm(TCGContext *s, int opc, int r, int v, int rm) { if (opc & P_EVEX) { - tcg_out_evex_opc(s, opc, r, v, rm, 0); + tcg_out_evex_opc(s, opc, r, v, rm, 0, 0, false); } else { tcg_out_vex_opc(s, opc, r, v, rm, 0); }