From patchwork Wed Jan 18 01:11:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 643663 Delivered-To: patch@linaro.org Received: by 2002:a17:522:b9de:b0:4b9:b062:db3b with SMTP id fj30csp1489526pvb; Tue, 17 Jan 2023 17:12:09 -0800 (PST) X-Google-Smtp-Source: AMrXdXsQbpr8oCVThkicobGDb2W4f6dPha4ahDFlF9esVYrz9Nwk3JRcaaaAySq3dK5+CJX+z5us X-Received: by 2002:ac8:754f:0:b0:3b6:2ed3:9de3 with SMTP id b15-20020ac8754f000000b003b62ed39de3mr6154173qtr.17.1674004329475; Tue, 17 Jan 2023 17:12:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674004329; cv=none; d=google.com; s=arc-20160816; b=JUpBHcYDgi3Oe8Nl/kDeJ2ifTIITCBbW6jMepR0KNa0vJ2cmGURsUBw7Y8xSXMtHl0 LoIlcxw06+1yOrY0pEy5aTJYliMXLKUY7NMpvc/UXkY52adnYx9v2kDaC8l0V9ETE/Hs NtYEBvggWfgbvSQ6vRwP2eWm8D+vrHoymSE0k/Da2pwQzE4z/ysFK80UD5Bd6z71d8mP nHO04GPrPo7zRLa5L8AJgj9zGEBJPR/ywRhdahXRkDFoNTI3Q1KOLz39y7Wm+43yPECD FPEGxfYBgHmQh/mxnYRB1VgKw5RPhCGuqrShIrov/iBinfDrgOT7Y7yvGgK/6LjnN6Rt wHdA== 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=qJICZPpEEH1YcFNc4HKSAZHC1I0j/ycDAOKP1+ciRvM=; b=ed1yn13jsgt0Wybf476AlViC7Z27dSZ15r+9WB5NmiR9TTlRya3+RLZUjn12ppLj4z APvGoG1wdUf33J+9M10wimAwauAS/ZE57/Ua4Y5S7TSOQBsSEoIfEer90m+orfyxJkUx p6Tp0e5xkKFLBGRdWNzrQplSQUB60pNujR6oOcdUdM427XSz9ZTaAiv78hDmuva39JfI 7+VdMwVHe+rpgdg0I4Q8uwPQc8Z9kvxF6ZZTZqK4fFLTxGv3KbSTbVL01UU1Gt440qzi E8KEpbs1dnLWFZSsGXeUN51ejxj+cvsTvNEWOA+JPueMztqLdeAuHatFSRV/XJ9Z2Hvb MI9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZDdSPp1l; 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 g19-20020ac870d3000000b003b631753228si3591969qtp.282.2023.01.17.17.12.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 17 Jan 2023 17:12:09 -0800 (PST) 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=ZDdSPp1l; 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 1pHwzF-0001zp-Qm; Tue, 17 Jan 2023 20:11:33 -0500 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 1pHwzD-0001yM-KL for qemu-devel@nongnu.org; Tue, 17 Jan 2023 20:11:31 -0500 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pHwzC-0002E7-1J for qemu-devel@nongnu.org; Tue, 17 Jan 2023 20:11:31 -0500 Received: by mail-pl1-x629.google.com with SMTP id b17so27832080pld.7 for ; Tue, 17 Jan 2023 17:11:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=qJICZPpEEH1YcFNc4HKSAZHC1I0j/ycDAOKP1+ciRvM=; b=ZDdSPp1lvFUT3nkatBK0VpJ036GL0DmupgGx9xVzbbAe4BFuCTfJr1iCQFUztPIzD8 Ez7HPemwTiwpX/3CE1+EAhzHsz5vovEXGDUu1ohEHGLBoI/8+EU8TIDwbNY84owiOm7v AHDNihsIBx3muvavpx6eUTpN1ptf9oA3uzgKVJ2QvWXr28f4r98dVzCHRWhkpqafXNP6 IZ209/ysTYTeELxYS1EEsUHLUaHtJNktTaJ4rcxeiHgwLrjaEyy4iPRgEl+qm+CyHC4S ncn5LXloorspmhmLbiZ9QiwpmIsGcJWErNozo/pRpiCIUOMwoVpQaReFGa3z7gvdRufh eWUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=qJICZPpEEH1YcFNc4HKSAZHC1I0j/ycDAOKP1+ciRvM=; b=pH0gu7NCZ9yW0yokrwfWbXVq5jR7/TAycbiA4fBj8UNgRWaji7zNxeGZ++FLW3rk+i mqnWe3AO85fF3IULTjmnawPCGVFGOLqJ3Oibi5Y7OVnFjG2Vf319Gv3OtHEAO3+JnjnP Pvf2Ac0HqQ78Y5euSWS21i64j9a02RiOgu0WiEgfBBMugzpmCe0vezdEzq9Sv56JFtSy ktjTk5oYusgd+pebSyEmtdLtR1iw5Cj5ulsSAXUeyz9D3hQ9lRPrQJJ0dek67eeVSSmm 5gqFvItX50ac5ZgrwjAslI96ZHKqOn2bJK1jmQqhDTFMxXgSjqKRKO807c1sFXDcNULA 8HVw== X-Gm-Message-State: AFqh2kq5v50n5pPxgVsDu+ewdkXlvo1kOOAYRa0OT0KZSTMC3M0wr6bi wHWMNV69s1YNEZUoTeTZJ97e+VpQfZZ1XASI X-Received: by 2002:a17:902:ce08:b0:193:3594:82e4 with SMTP id k8-20020a170902ce0800b00193359482e4mr6337015plg.18.1674004288619; Tue, 17 Jan 2023 17:11:28 -0800 (PST) Received: from stoup.. (rrcs-173-198-77-218.west.biz.rr.com. [173.198.77.218]) by smtp.gmail.com with ESMTPSA id s7-20020a170902988700b0017ec1b1bf9fsm21660259plp.217.2023.01.17.17.11.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Jan 2023 17:11:28 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: git@xen0n.name Subject: [PATCH v2 01/10] target/loongarch: Enable the disassembler for host tcg Date: Tue, 17 Jan 2023 15:11:14 -1000 Message-Id: <20230118011123.392823-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230118011123.392823-1-richard.henderson@linaro.org> References: <20230118011123.392823-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::629; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x629.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 Reuse the decodetree based disassembler from target/loongarch/ for tcg/loongarch64/. The generation of decode-insns.c.inc into ./libcommon.fa.p/ could eventually result in conflict, if any other host requires the same trick, but this is good enough for now. Signed-off-by: Richard Henderson Reviewed-by: WANG Xuerui Reviewed-by: Philippe Mathieu-Daudé --- disas.c | 2 ++ target/loongarch/meson.build | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/disas.c b/disas.c index 3b31315f40..c9fa38e6d7 100644 --- a/disas.c +++ b/disas.c @@ -198,6 +198,8 @@ static void initialize_debug_host(CPUDebug *s) s->info.cap_insn_split = 6; #elif defined(__hppa__) s->info.print_insn = print_insn_hppa; +#elif defined(__loongarch64) + s->info.print_insn = print_insn_loongarch; #endif } diff --git a/target/loongarch/meson.build b/target/loongarch/meson.build index 6376f9e84b..690633969f 100644 --- a/target/loongarch/meson.build +++ b/target/loongarch/meson.build @@ -3,7 +3,6 @@ gen = decodetree.process('insns.decode') loongarch_ss = ss.source_set() loongarch_ss.add(files( 'cpu.c', - 'disas.c', )) loongarch_tcg_ss = ss.source_set() loongarch_tcg_ss.add(gen) @@ -24,6 +23,8 @@ loongarch_softmmu_ss.add(files( 'iocsr_helper.c', )) +common_ss.add(when: 'CONFIG_LOONGARCH_DIS', if_true: [files('disas.c'), gen]) + loongarch_ss.add_all(when: 'CONFIG_TCG', if_true: [loongarch_tcg_ss]) target_arch += {'loongarch': loongarch_ss}