From nobody Wed Dec 17 05:58:19 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1565836199; cv=none; d=zoho.com; s=zohoarc; b=W0JtqDCEdNPWU1LFz+i0FGiq4J60QUUZ859t9fGUDmtiz1OZWTkTEAg53xOOrdbJnww0sr6u5BZ4YXIXztwkWAQ7Jzr+2vC8soGA4yDoEMzuhUXdDLrk4Kqzl1Yd3BHLr+JeMenuW+Si8aGxp4q1Yzykd9+slZDXuGsn4aD8Tp4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565836199; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=8wDdpNnOpBiBo+lSxDp9N9yHcPIqinmnQJDNUxxNJsk=; b=SVgyF0FcAxocP6dOkvZuzuZjP37lgM3Ox8BeA11sq5/L1vq/p7GJbihMCKDXUaQyArIYkzSO5VI04oLDCGjKvU7zpGLS1wNH5P6js7N9ah5wntVK0k1RBxmB75z11k7WwbP7n4Y3mf85/uWouuWza2T5koP3eYHdW4C4fdFZPhc= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1565836199568663.2146704385505; Wed, 14 Aug 2019 19:29:59 -0700 (PDT) Received: from localhost ([::1]:37530 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hy5WR-0004E8-Mx for importer@patchew.org; Wed, 14 Aug 2019 22:29:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46782) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hy5DQ-00066k-TO for qemu-devel@nongnu.org; Wed, 14 Aug 2019 22:10:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hy5DP-0008NP-0M for qemu-devel@nongnu.org; Wed, 14 Aug 2019 22:10:12 -0400 Received: from mail-yb1-xb41.google.com ([2607:f8b0:4864:20::b41]:45960) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hy5DO-0008MY-SC for qemu-devel@nongnu.org; Wed, 14 Aug 2019 22:10:10 -0400 Received: by mail-yb1-xb41.google.com with SMTP id u32so388321ybi.12 for ; Wed, 14 Aug 2019 19:10:09 -0700 (PDT) Received: from dionysus.attlocal.net ([2601:c0:c67f:e390:8a9a:e33f:caf8:f018]) by smtp.gmail.com with ESMTPSA id j3sm374882ywk.21.2019.08.14.19.10.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Aug 2019 19:10:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8wDdpNnOpBiBo+lSxDp9N9yHcPIqinmnQJDNUxxNJsk=; b=B+LR7gzXiDcLruANd0sQMWx7C+AHdIynhqxVGnwz45WhMbi2dNlNga2mB0SAqpswDw P/vFZEKj/ctDH0MwwNpYzfWGOt3cDqnQAUWgYLkoKU40HqQuws2oRQ54+s1Gd3lTaniB 6DR+EGPqz/9vtu33MdUqT5Vc3h3POiLQooNLBcoIyz2rzLjlivWUfzJ/5F+KI1N6tmOL Hq0Ovy3kt26ADJ1OxqFG2DeB1ZFyjsv5Q6X6WKZOZJQ117RiIJDHPMJGwfjgQIusHBsL NNQlWZV0Lwzb6OOtx54pO5YLvwAAsXWjgny4p7V3B79OnoJg6LqgfXOvwF1rUWk6Iy/+ 3bfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8wDdpNnOpBiBo+lSxDp9N9yHcPIqinmnQJDNUxxNJsk=; b=Z6xsn4+8knUzGhfziEdYXCPALPMNs8rLNoinOMe0cEIbWYCHqQ29lWs4t9r7oRjorg pUph1t7qPmPV36pK3RIm59SyoVCXgnJC+P9iviUu2tgvQXlzHMngwho3MX2NYxIDxjLF URkh+2COOrRp6i9OLCU8xQJFOl/0xskLrEs+2AXiH6daf5ynDHw7d4mK76v3js3n6APj OJURxz+OAr64dY+uTvzc3OyoLohdws7xgV+WAeG/RGNZk1dKQ6/WLbVhKVjgzSd0SvRn 2d9mnI+k5nJ7LLKl3rElyZ9UPJcZJcG2GWEDz5M8qppPeap45MySWHKN3lv0zH85l7HP 7OMw== X-Gm-Message-State: APjAAAULlDV8AOQmPAb2239k+a8w/T3K68dWGbBEfi4ZPvvr83mKmh83 fYiF5gE1swG8VIwsPpt4uFn4pJkK X-Google-Smtp-Source: APXvYqx2nvM/xyHQHg/604RIs6tMoS2D/H/SxQ0eFAfhCCV4UaarB2WvfL1RRnQMqeq9eS1iFIuG7A== X-Received: by 2002:a25:9012:: with SMTP id s18mr1959286ybl.474.1565835009305; Wed, 14 Aug 2019 19:10:09 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 14 Aug 2019 22:08:58 -0400 Message-Id: <20190815020928.9679-17-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190815020928.9679-1-jan.bobek@gmail.com> References: <20190815020928.9679-1-jan.bobek@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b41 Subject: [Qemu-devel] [RFC PATCH v3 16/46] target/i386: introduce instruction operand infrastructure X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" insnop_arg_t, insnop_ctxt_t and init, prepare and finalize functions form the basis of instruction operand decoding. Introduce macros for defining a generic instruction operand; use cases for operand decoding will be introduced later. Signed-off-by: Jan Bobek --- target/i386/translate.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index 0cffa2226b..9d00b36406 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -4548,6 +4548,34 @@ static int ck_cpuid(CPUX86State *env, DisasContext *= s, CkCpuidFeat feat) } } =20 +/* + * Instruction operand + */ +#define insnop_arg_t(opT) insnop_ ## opT ## _arg_t +#define insnop_ctxt_t(opT) insnop_ ## opT ## _ctxt_t +#define insnop_init(opT) insnop_ ## opT ## _init +#define insnop_prepare(opT) insnop_ ## opT ## _prepare +#define insnop_finalize(opT) insnop_ ## opT ## _finalize + +#define INSNOP_INIT(opT) \ + static int insnop_init(opT)(insnop_ctxt_t(opT) *ctxt, \ + CPUX86State *env, \ + DisasContext *s, \ + int modrm, bool is_write) + +#define INSNOP_PREPARE(opT) \ + static insnop_arg_t(opT) insnop_prepare(opT)(insnop_ctxt_t(opT) *ctxt,= \ + CPUX86State *env, \ + DisasContext *s, \ + int modrm, bool is_write) + +#define INSNOP_FINALIZE(opT) \ + static void insnop_finalize(opT)(insnop_ctxt_t(opT) *ctxt, \ + CPUX86State *env, \ + DisasContext *s, \ + int modrm, bool is_write, \ + insnop_arg_t(opT) arg) + static void gen_sse_ng(CPUX86State *env, DisasContext *s, int b) { enum { --=20 2.20.1