From patchwork Wed Jan 8 21:51:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 855719 Delivered-To: patch@linaro.org Received: by 2002:adf:8b05:0:b0:385:e875:8a9e with SMTP id n5csp942710wra; Wed, 8 Jan 2025 13:52:55 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVh5sArxdVj32VzWBbDSwvbBCA8bubmTAQorvES5nb15zMXc604nQGCnkSa6iKC6MWZiON7WQ==@linaro.org X-Google-Smtp-Source: AGHT+IGfTeZ9hcffGkTUoF900sozIbQNcpXjbB3ITkILD5Sea2fBmfBJ3ojH97K3DOIoiNH8bP9U X-Received: by 2002:a05:620a:2454:b0:7b6:db89:2e9a with SMTP id af79cd13be357-7bcd970a86dmr639102885a.22.1736373174777; Wed, 08 Jan 2025 13:52:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736373174; cv=none; d=google.com; s=arc-20240605; b=WLONb76yX98f5R+QVUBQ0Ai5nwPG6/6fIRm93DxQ2DYvowr0NgEtOKmURwXqYh8ia3 RdkdlUJpDBjd7KCdTkZu3phHFhmGX6Au+y/hjIrZmLTziJff8oEKEm20ppDmCKsjpVXL vWCZWSaHGEU1FsWL+CMX52RFmlkwhFHUOH91tobE5eq0Ovs6zJ3zJCAPfXmpEDMh43T4 7HiMbT061kHyrMVCkQByYdmuI4BU36OffYNrpxjrm+4ta6yUZMzZ49WyyanV3A/hr9i0 G2IOdlTqKZQrExPA/ddqmWFtxO/0ApS66lGF18qvrrij8CHaWJASoCtEQlaRTIp7KUiO khiA== 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=kZJhlkmlayFpUeqjr7RAzVc9FiLlsMH2hRpk2ZVeInw=; fh=I/t+CGVRTvnlN+c1H2rL+bfx7DSzSdCxz00w+BTRVdo=; b=g1VgAVVA00NshW0cMmD7uQ9bUTh/eU4PS0GVca+51/1nEAT64+8Awg7ink+yVMnPtk A2/CuiIzaCdF6Ohat42MdccKazFaRrtAG3rinZuegQEfzOLTsKrsq3Bz+/mDDMzkxo+4 XJww++x7NmcRoI7OShqoChUAvqmhhRBdqb2xs1NftIoxOfLkexzCBFxqjegxWo1odkMH Fct7IFXG+2Vgqr0F1mbvnF6DzcyFf2BNbuUlIQ+3+z7Q92NBJAMonrmTPgb1KUmmHTAF 0S+nIEKz7OohxKUwQk3E4dmS5Qgm9nguLnllHVeKKEphqxEbG4ZlccsDL4Z/yi7150Ax zkLQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Z1hlXZRq; 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 af79cd13be357-7bce34fcb11si5365585a.380.2025.01.08.13.52.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 Jan 2025 13:52:54 -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=Z1hlXZRq; 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 1tVdyI-0008D2-Vh; Wed, 08 Jan 2025 16:52:14 -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 1tVdyF-0008Cf-S3 for qemu-devel@nongnu.org; Wed, 08 Jan 2025 16:52:11 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tVdyE-000404-8j for qemu-devel@nongnu.org; Wed, 08 Jan 2025 16:52:11 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-4361815b96cso2352495e9.1 for ; Wed, 08 Jan 2025 13:52:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736373123; x=1736977923; 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=kZJhlkmlayFpUeqjr7RAzVc9FiLlsMH2hRpk2ZVeInw=; b=Z1hlXZRqErX8xlVg8souNoD6blC7FcwO6+jQkwSa677RjH1B5n25WRl5Kc913GACp8 b8drLp+GkYxtYknOJANBDsKMvbpxPF0x/6reof4SFKyxeyjKH8jq8vUy3pgb68RGDupQ R5Hi4Gare3TjcuLQ0KSgGESHQB8NQ1+NbGEz8bOQ+SlBrVfs6aHCbRxYt44Qo4COKrah sQ4Q7R8ARaIPxaelG5UpHstZBRjK+oZuPfXa1X5sm5khRYSY6Vn0+TGjABj0BB24pxQ9 xOeImYYNSenJ+Z3cNOKW3AxOogF+EWticfrdcwH99X7oEAMaPx0Qmh2XLk3iBC8zYJLl r9rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736373123; x=1736977923; 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=kZJhlkmlayFpUeqjr7RAzVc9FiLlsMH2hRpk2ZVeInw=; b=I5teLHXL8HnpRjrKxrXZY4N6oLKGfCa6VBhWQMy13I0PQi8NrgNg2YxrSBu7nG/XHC sFsv7Q9V7tFZXgUOLbJ/7kPn/kByMTc4MD6k/s0jW4ZK1l0LDH3OnYY7LdgNw/707Qp5 2DmpVYvETgoLlqJKnR9hHbltc4x0QCMFxVvXzsFvUJsMWa7JQxEpj7Hoz9lOSVv/+axH jCli6bxNTpUVmQU3Pm4/QT7VQCKiQomxX9mWJLI6lrLABG6jgs1VgK0345tYpOzf9ZLg K9lEYm2HHzSjm9yIQZ7zxG54Eq7ONG7Eg+JYbXh8nW43hW8xDvI9KbK6oDycziJn2CaC wPcA== X-Gm-Message-State: AOJu0YzOPJlexYdOck1Arv57vMjcpATQbPs+gX2G2AS7KcoILArBiFJp xXqmU1ESjtQCYjvif1juGustSuoqr4faLletdJLTvkPSat9cqLuP11MdfrFFKQvNNR/ui2BstvD 3zvI= X-Gm-Gg: ASbGnctdZQEmOHAUCGCj5wWARBJ14Ql1th5W+JyejB7YsjmxTVyi47Xs8uaMLTsFkbk peKxTV8TEqoNUng+bkx+PgQZKV7yTHuxLPlgNx6h1Kc1pnoBlwbhTLUO5k2rk98P8WPZViY7219 Nd7f7hHYscVvuRppphkm7WSDwgnj2PfF46Y9Dil4CYdbgs9wx0VpNEmkEnsKNwa69fKvxqq1+PR xnM0NHd0meeFHtniBv0dbsDKk+UVb2cvghYmQzJ3kC3xXEcIcDe0c0GsdaqQWBnfbSw+8RScG1W kMmcOaDKiUE61NDWj6q1UtoPegigQic= X-Received: by 2002:adf:a108:0:b0:38a:88ac:ed10 with SMTP id ffacd0b85a97d-38a88acedf9mr2535671f8f.25.1736373123134; Wed, 08 Jan 2025 13:52:03 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e99b4a5asm739205e9.19.2025.01.08.13.52.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 08 Jan 2025 13:52:02 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: pierrick.bouvier@linaro.org, Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH v3 01/14] tcg/ppc: Remove TCGPowerISA enum Date: Wed, 8 Jan 2025 22:51:42 +0100 Message-ID: <20250108215156.8731-2-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250108215156.8731-1-philmd@linaro.org> References: <20250107080112.1175095-19-richard.henderson@linaro.org> <20250108215156.8731-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.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, TVD_SUBJ_WIPE_DEBT=1.004 autolearn=no 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 Left-over from commit 623d7e3551a ("util: Add cpuinfo-ppc.c"). Signed-off-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- tcg/ppc/tcg-target.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/tcg/ppc/tcg-target.h b/tcg/ppc/tcg-target.h index 8291e0127db..4fa4a30de41 100644 --- a/tcg/ppc/tcg-target.h +++ b/tcg/ppc/tcg-target.h @@ -55,14 +55,6 @@ typedef enum { TCG_AREG0 = TCG_REG_R27 } TCGReg; -typedef enum { - tcg_isa_base, - tcg_isa_2_06, - tcg_isa_2_07, - tcg_isa_3_00, - tcg_isa_3_10, -} TCGPowerISA; - #define have_isa_2_06 (cpuinfo & CPUINFO_V2_06) #define have_isa_2_07 (cpuinfo & CPUINFO_V2_07) #define have_isa_3_00 (cpuinfo & CPUINFO_V3_0) From patchwork Wed Jan 8 21:51:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 855717 Delivered-To: patch@linaro.org Received: by 2002:adf:8b05:0:b0:385:e875:8a9e with SMTP id n5csp942629wra; Wed, 8 Jan 2025 13:52:37 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXOZPFa0iUpELJnZhGiQSm7SP5n8ZTxhXjtCGL4IfcuJZmxpJCnmQZYrnnPoOjnsW76EErvbw==@linaro.org X-Google-Smtp-Source: AGHT+IHtInFnEzoRIgmdVf+MDJl6qJz0IV2A4+R69LrEHTyDhuY4Y5A2br8nbSJCrZBerAxMuFFo X-Received: by 2002:a05:620a:1791:b0:7b6:d643:59ab with SMTP id af79cd13be357-7bcd96e6844mr143263485a.10.1736373157314; Wed, 08 Jan 2025 13:52:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736373157; cv=none; d=google.com; s=arc-20240605; b=NNV6h7G35P/6Bihi6URYP4c36SnfU9L1H51PQoGWrHNn7I3clqhgg3Dkjg3dj1uEuV PDGMnXPREtfTYbMwe1hJ2lc3cGYTxgfpgmt/QY0Gurx9AhncCR9zOrp0zCzXVVC114me E48h3BBKbXzZrwpn4wx9t7KiHRcp7QifwNUMXPA23IIuknOCuWBpFtGZQDB8JsRj2eUR 2hYHau+4HUd0TDCc8oBhlbSWC2x7JcM5XhU0Pq07vITcmo5KnQDVm41VP2QjRo51c2qD bTkAFmkU93Ew1HetbquduTGwbKqRF+8Th/7ntFpXuXhsrR916GdKMi0kG+j/oO6GMyJa T3lA== 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=JVYjJ2mCAmRfPhk4CmbKvQbj1/8MWt6GFQu7OdWg7N4=; fh=I/t+CGVRTvnlN+c1H2rL+bfx7DSzSdCxz00w+BTRVdo=; b=gTD1BImaCU/LEtawYHwsexzhjitoxG7+KL4sf1BFEn0wwkvbRJdZtBQHrhwDwKbVi8 Gk4WNmFuw1nGF/N/uP4/wxL7/6sONgRn8Wc4gEEG13jdhpIQpKor7wIhm0MZ3flp56Y9 K2kfzCsmiElzR1Iyh93sMu9XT5PU+iuTzj9P4zK7F97fw2Pb2Og73ng5V4uWJqa6byd1 lUXGgfsyFPiBm/TLAdKxMAXU3JKDa5JiRSF9Ui3aGr7HwXhnJgw41B+EWwA8PWmwrVbN wDtgqTci2Ln8E3EHFVo4UQxJnyw34AXhNScxkGgCQJlr/0b+vryzIk9I0VAEMsJeop8u o8lg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uDY2nr4O; 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 af79cd13be357-7bce34fcfd6si5276185a.427.2025.01.08.13.52.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 Jan 2025 13:52:37 -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=uDY2nr4O; 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 1tVdyH-0008D1-Ja; Wed, 08 Jan 2025 16:52:13 -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 1tVdyG-0008Cp-Hu for qemu-devel@nongnu.org; Wed, 08 Jan 2025 16:52:12 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tVdyE-00040N-8x for qemu-devel@nongnu.org; Wed, 08 Jan 2025 16:52:12 -0500 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-385d7b4da2bso213316f8f.1 for ; Wed, 08 Jan 2025 13:52:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736373128; x=1736977928; 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=JVYjJ2mCAmRfPhk4CmbKvQbj1/8MWt6GFQu7OdWg7N4=; b=uDY2nr4OhYG6oErN2TttWg4YQFifjttGX/PkNdoelZ60u021i6sKeY+yoTuTnGLYbh S0Jnn+JrJB7hAcglF794l4+odyguV7jZdX21L5aRFpPa3rvCWdnVarbL/A7cukSoraeu RCI7DKJA6hBiVgPN8gWaAhPJXTI6lWo7pTGHcaHX1E3Xrd3aGQw8qIXwsvBxuzxLwnjM rYBvVziy/2OGIw7+q3CbZ+WEb+n1mLVucbyuX/4nYiE/dCAKsZZ11H26dPqLf4iJKi7l y7LfHpqBuWD3pfr98yDnUp8ypm0guheO6cuZ5xXg3eYq9jc+KWwJ4rJjabHHtawoqUVj mylw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736373128; x=1736977928; 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=JVYjJ2mCAmRfPhk4CmbKvQbj1/8MWt6GFQu7OdWg7N4=; b=jH+R2PpVqz6ygWCPy7NbsePbJQ4rBNl2t0sgZkXBAetDadS3mVwuxMKZPHxQj8DwVi w5N8VCZ+OYAPdsN8FhZvqhPfqaz5vbWB+RCEHxHbbWQjy2OA51xRxGvo2lJd6YQhY+I1 cBC1EfqlrkTw6ZbcXnZQnJcUKPRQbZNmpwuOJ5VE/+WG4EXrYm6crvjNxpI/T35MTwWU BtneUpu4xI7CQzlfhl/sv5kmD8jgzK/j9IuKGV633dI/rIWcsJNtmhkAgY+cafrx3+rD e2uDbxfXDBXcXV0wjnb7/VA9jAVt0bg7SMMMIyDw0rN6c3OKP9XwgQA5CtTJ5eiEJwsB dHNw== X-Gm-Message-State: AOJu0YyorwkdNlLGEa1ktBDatMZPUvWiWmFuM6X9DstRF9Mn5ysdq3C0 KhkEChzeWspQnzPgx0pz0HETO2/Hrlhq/9cstqVVpxql1noVxBurnZUt5iRJ9fIfkquNpwIo4OJ QIwU= X-Gm-Gg: ASbGncurgKdWL0f5cYHm7bpiQU9CqQ1gol3E+QTNAEMr/Gvae+wqLsAN/a75LPkUIlZ GgiK53gojWdCch4gd4VNP4+H/yXDNB/UgixAg3RApo/2v7r9urNOXFz+DNcPYIGPzNHKXVNnTv2 5jqFdyeVrcKsIaBB25YKIViYnIC3wgGps87dxVbdknwhjfE2Dad5xcaRe2y4aZiREzOe6FBzSIC EwaVmaKktiJnVJvNRReo8nx6DqNVx9OjpO9KOpsKb/IbWrb/l5iyk4rRmUL44hjT3ySs1WKJ/+r 0+9hovzL30uOB8VU5qtH/YG2H/mFEH8= X-Received: by 2002:a5d:584d:0:b0:385:e9de:d521 with SMTP id ffacd0b85a97d-38a872fc1camr3864082f8f.8.1736373127682; Wed, 08 Jan 2025 13:52:07 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a1c89e140sm55045077f8f.79.2025.01.08.13.52.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 08 Jan 2025 13:52:07 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: pierrick.bouvier@linaro.org, Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH v3 02/14] tcg: Extract default TCG_TARGET_HAS_foo definitions to 'tcg-has.h' Date: Wed, 8 Jan 2025 22:51:43 +0100 Message-ID: <20250108215156.8731-3-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250108215156.8731-1-philmd@linaro.org> References: <20250107080112.1175095-19-richard.henderson@linaro.org> <20250108215156.8731-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.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 From: Richard Henderson Signed-off-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- include/tcg/tcg.h | 105 +----------------------------------------- tcg/tcg-has.h | 115 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 116 insertions(+), 104 deletions(-) create mode 100644 tcg/tcg-has.h diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index 57f5fda109f..3897c2d6b28 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -64,110 +64,7 @@ typedef uint64_t TCGRegSet; #error unsupported #endif -#if TCG_TARGET_REG_BITS == 32 -/* Turn some undef macros into false macros. */ -#define TCG_TARGET_HAS_extr_i64_i32 0 -#define TCG_TARGET_HAS_div_i64 0 -#define TCG_TARGET_HAS_rem_i64 0 -#define TCG_TARGET_HAS_div2_i64 0 -#define TCG_TARGET_HAS_rot_i64 0 -#define TCG_TARGET_HAS_ext8s_i64 0 -#define TCG_TARGET_HAS_ext16s_i64 0 -#define TCG_TARGET_HAS_ext32s_i64 0 -#define TCG_TARGET_HAS_ext8u_i64 0 -#define TCG_TARGET_HAS_ext16u_i64 0 -#define TCG_TARGET_HAS_ext32u_i64 0 -#define TCG_TARGET_HAS_bswap16_i64 0 -#define TCG_TARGET_HAS_bswap32_i64 0 -#define TCG_TARGET_HAS_bswap64_i64 0 -#define TCG_TARGET_HAS_not_i64 0 -#define TCG_TARGET_HAS_andc_i64 0 -#define TCG_TARGET_HAS_orc_i64 0 -#define TCG_TARGET_HAS_eqv_i64 0 -#define TCG_TARGET_HAS_nand_i64 0 -#define TCG_TARGET_HAS_nor_i64 0 -#define TCG_TARGET_HAS_clz_i64 0 -#define TCG_TARGET_HAS_ctz_i64 0 -#define TCG_TARGET_HAS_ctpop_i64 0 -#define TCG_TARGET_HAS_deposit_i64 0 -#define TCG_TARGET_HAS_extract_i64 0 -#define TCG_TARGET_HAS_sextract_i64 0 -#define TCG_TARGET_HAS_extract2_i64 0 -#define TCG_TARGET_HAS_negsetcond_i64 0 -#define TCG_TARGET_HAS_add2_i64 0 -#define TCG_TARGET_HAS_sub2_i64 0 -#define TCG_TARGET_HAS_mulu2_i64 0 -#define TCG_TARGET_HAS_muls2_i64 0 -#define TCG_TARGET_HAS_muluh_i64 0 -#define TCG_TARGET_HAS_mulsh_i64 0 -/* Turn some undef macros into true macros. */ -#define TCG_TARGET_HAS_add2_i32 1 -#define TCG_TARGET_HAS_sub2_i32 1 -#endif - -#ifndef TCG_TARGET_deposit_i32_valid -#define TCG_TARGET_deposit_i32_valid(ofs, len) 1 -#endif -#ifndef TCG_TARGET_deposit_i64_valid -#define TCG_TARGET_deposit_i64_valid(ofs, len) 1 -#endif -#ifndef TCG_TARGET_extract_i32_valid -#define TCG_TARGET_extract_i32_valid(ofs, len) 1 -#endif -#ifndef TCG_TARGET_extract_i64_valid -#define TCG_TARGET_extract_i64_valid(ofs, len) 1 -#endif - -/* Only one of DIV or DIV2 should be defined. */ -#if defined(TCG_TARGET_HAS_div_i32) -#define TCG_TARGET_HAS_div2_i32 0 -#elif defined(TCG_TARGET_HAS_div2_i32) -#define TCG_TARGET_HAS_div_i32 0 -#define TCG_TARGET_HAS_rem_i32 0 -#endif -#if defined(TCG_TARGET_HAS_div_i64) -#define TCG_TARGET_HAS_div2_i64 0 -#elif defined(TCG_TARGET_HAS_div2_i64) -#define TCG_TARGET_HAS_div_i64 0 -#define TCG_TARGET_HAS_rem_i64 0 -#endif - -#if !defined(TCG_TARGET_HAS_v64) \ - && !defined(TCG_TARGET_HAS_v128) \ - && !defined(TCG_TARGET_HAS_v256) -#define TCG_TARGET_MAYBE_vec 0 -#define TCG_TARGET_HAS_abs_vec 0 -#define TCG_TARGET_HAS_neg_vec 0 -#define TCG_TARGET_HAS_not_vec 0 -#define TCG_TARGET_HAS_andc_vec 0 -#define TCG_TARGET_HAS_orc_vec 0 -#define TCG_TARGET_HAS_nand_vec 0 -#define TCG_TARGET_HAS_nor_vec 0 -#define TCG_TARGET_HAS_eqv_vec 0 -#define TCG_TARGET_HAS_roti_vec 0 -#define TCG_TARGET_HAS_rots_vec 0 -#define TCG_TARGET_HAS_rotv_vec 0 -#define TCG_TARGET_HAS_shi_vec 0 -#define TCG_TARGET_HAS_shs_vec 0 -#define TCG_TARGET_HAS_shv_vec 0 -#define TCG_TARGET_HAS_mul_vec 0 -#define TCG_TARGET_HAS_sat_vec 0 -#define TCG_TARGET_HAS_minmax_vec 0 -#define TCG_TARGET_HAS_bitsel_vec 0 -#define TCG_TARGET_HAS_cmpsel_vec 0 -#define TCG_TARGET_HAS_tst_vec 0 -#else -#define TCG_TARGET_MAYBE_vec 1 -#endif -#ifndef TCG_TARGET_HAS_v64 -#define TCG_TARGET_HAS_v64 0 -#endif -#ifndef TCG_TARGET_HAS_v128 -#define TCG_TARGET_HAS_v128 0 -#endif -#ifndef TCG_TARGET_HAS_v256 -#define TCG_TARGET_HAS_v256 0 -#endif +#include "tcg/tcg-has.h" typedef enum TCGOpcode { #define DEF(name, oargs, iargs, cargs, flags) INDEX_op_ ## name, diff --git a/tcg/tcg-has.h b/tcg/tcg-has.h new file mode 100644 index 00000000000..c09ce13389e --- /dev/null +++ b/tcg/tcg-has.h @@ -0,0 +1,115 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Define target-specific opcode support + * Copyright (c) 2024 Linaro, Ltd. + */ + +#ifndef TCG_HAS_H +#define TCG_HAS_H + +#if TCG_TARGET_REG_BITS == 32 +/* Turn some undef macros into false macros. */ +#define TCG_TARGET_HAS_extr_i64_i32 0 +#define TCG_TARGET_HAS_div_i64 0 +#define TCG_TARGET_HAS_rem_i64 0 +#define TCG_TARGET_HAS_div2_i64 0 +#define TCG_TARGET_HAS_rot_i64 0 +#define TCG_TARGET_HAS_ext8s_i64 0 +#define TCG_TARGET_HAS_ext16s_i64 0 +#define TCG_TARGET_HAS_ext32s_i64 0 +#define TCG_TARGET_HAS_ext8u_i64 0 +#define TCG_TARGET_HAS_ext16u_i64 0 +#define TCG_TARGET_HAS_ext32u_i64 0 +#define TCG_TARGET_HAS_bswap16_i64 0 +#define TCG_TARGET_HAS_bswap32_i64 0 +#define TCG_TARGET_HAS_bswap64_i64 0 +#define TCG_TARGET_HAS_not_i64 0 +#define TCG_TARGET_HAS_andc_i64 0 +#define TCG_TARGET_HAS_orc_i64 0 +#define TCG_TARGET_HAS_eqv_i64 0 +#define TCG_TARGET_HAS_nand_i64 0 +#define TCG_TARGET_HAS_nor_i64 0 +#define TCG_TARGET_HAS_clz_i64 0 +#define TCG_TARGET_HAS_ctz_i64 0 +#define TCG_TARGET_HAS_ctpop_i64 0 +#define TCG_TARGET_HAS_deposit_i64 0 +#define TCG_TARGET_HAS_extract_i64 0 +#define TCG_TARGET_HAS_sextract_i64 0 +#define TCG_TARGET_HAS_extract2_i64 0 +#define TCG_TARGET_HAS_negsetcond_i64 0 +#define TCG_TARGET_HAS_add2_i64 0 +#define TCG_TARGET_HAS_sub2_i64 0 +#define TCG_TARGET_HAS_mulu2_i64 0 +#define TCG_TARGET_HAS_muls2_i64 0 +#define TCG_TARGET_HAS_muluh_i64 0 +#define TCG_TARGET_HAS_mulsh_i64 0 +/* Turn some undef macros into true macros. */ +#define TCG_TARGET_HAS_add2_i32 1 +#define TCG_TARGET_HAS_sub2_i32 1 +#endif + +#ifndef TCG_TARGET_deposit_i32_valid +#define TCG_TARGET_deposit_i32_valid(ofs, len) 1 +#endif +#ifndef TCG_TARGET_deposit_i64_valid +#define TCG_TARGET_deposit_i64_valid(ofs, len) 1 +#endif +#ifndef TCG_TARGET_extract_i32_valid +#define TCG_TARGET_extract_i32_valid(ofs, len) 1 +#endif +#ifndef TCG_TARGET_extract_i64_valid +#define TCG_TARGET_extract_i64_valid(ofs, len) 1 +#endif + +/* Only one of DIV or DIV2 should be defined. */ +#if defined(TCG_TARGET_HAS_div_i32) +#define TCG_TARGET_HAS_div2_i32 0 +#elif defined(TCG_TARGET_HAS_div2_i32) +#define TCG_TARGET_HAS_div_i32 0 +#define TCG_TARGET_HAS_rem_i32 0 +#endif +#if defined(TCG_TARGET_HAS_div_i64) +#define TCG_TARGET_HAS_div2_i64 0 +#elif defined(TCG_TARGET_HAS_div2_i64) +#define TCG_TARGET_HAS_div_i64 0 +#define TCG_TARGET_HAS_rem_i64 0 +#endif + +#if !defined(TCG_TARGET_HAS_v64) \ + && !defined(TCG_TARGET_HAS_v128) \ + && !defined(TCG_TARGET_HAS_v256) +#define TCG_TARGET_MAYBE_vec 0 +#define TCG_TARGET_HAS_abs_vec 0 +#define TCG_TARGET_HAS_neg_vec 0 +#define TCG_TARGET_HAS_not_vec 0 +#define TCG_TARGET_HAS_andc_vec 0 +#define TCG_TARGET_HAS_orc_vec 0 +#define TCG_TARGET_HAS_nand_vec 0 +#define TCG_TARGET_HAS_nor_vec 0 +#define TCG_TARGET_HAS_eqv_vec 0 +#define TCG_TARGET_HAS_roti_vec 0 +#define TCG_TARGET_HAS_rots_vec 0 +#define TCG_TARGET_HAS_rotv_vec 0 +#define TCG_TARGET_HAS_shi_vec 0 +#define TCG_TARGET_HAS_shs_vec 0 +#define TCG_TARGET_HAS_shv_vec 0 +#define TCG_TARGET_HAS_mul_vec 0 +#define TCG_TARGET_HAS_sat_vec 0 +#define TCG_TARGET_HAS_minmax_vec 0 +#define TCG_TARGET_HAS_bitsel_vec 0 +#define TCG_TARGET_HAS_cmpsel_vec 0 +#define TCG_TARGET_HAS_tst_vec 0 +#else +#define TCG_TARGET_MAYBE_vec 1 +#endif +#ifndef TCG_TARGET_HAS_v64 +#define TCG_TARGET_HAS_v64 0 +#endif +#ifndef TCG_TARGET_HAS_v128 +#define TCG_TARGET_HAS_v128 0 +#endif +#ifndef TCG_TARGET_HAS_v256 +#define TCG_TARGET_HAS_v256 0 +#endif + +#endif From patchwork Wed Jan 8 21:51:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 855722 Delivered-To: patch@linaro.org Received: by 2002:adf:8b05:0:b0:385:e875:8a9e with SMTP id n5csp942826wra; Wed, 8 Jan 2025 13:53:20 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX1HYCrSco5PnzCH21zjMBJm0hHxNU0lTf7yY/kUgYoyUtUCsUpRHCmBhtg+AUyZU/LCl/BHw==@linaro.org X-Google-Smtp-Source: AGHT+IFl2DmCDDhBhyH8y1raXuZr7/bXYrhA2KgXn/J3rjrffQ6yVMxJmMpMDvWRG2lZamXRiEeW X-Received: by 2002:a05:620a:4556:b0:7b6:dc74:82a8 with SMTP id af79cd13be357-7bcd9729af4mr638810885a.9.1736373200593; Wed, 08 Jan 2025 13:53:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736373200; cv=none; d=google.com; s=arc-20240605; b=ke1k5kzWZdOuLRvDkf8AO4JNXuLNPq5i+YroZHy/BmG+8XHfB/LOk6H/FcDHU/N/Kg 8lTdweUAecGXyuvEwCCd3wFg4TNDHjcdE2Jsbup3Jas+zTuji1gTRu3DDtfM33a3oO0A mXuL2VhHBkW11JG9l1qlg/rYJBQzXe9tQOUS5bCF1E5Si4rKL4UT6j05xgFIqX7NTDV9 93L+ocTjBuFY8cYlFNFXDWHStdEBpPQyeVCRgMgBSKRVfhn0qIz0URv9uT5tZeNEZuAH Z+ZBP/mSAAg5WWLqmkoQVCKnpFlrhEDBjbEnDkNFO4T3JB63BkyhNZEQja/4gPEcgWl6 m3QQ== 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=bK0DLDa7yXdhLO72RuYI+semnMNUmEQT7VpS3MpFwG4=; fh=I/t+CGVRTvnlN+c1H2rL+bfx7DSzSdCxz00w+BTRVdo=; b=bbZKC5lLG125WEN0Ah6Ot5ghEidFsutL9QaOK3LT60xwyQvA75gPLl6dXMgJS8owbk RCGJXRTZY2TQZw1yH0j/ATDvhyyzmIvC/bqCYm6lzih6wK8V03W74A7G1wlEcUuRf7gM usA/9cfWE07UHvD2iVZ0HP5YSguX0m2VQRlRSEXB3apFdxADZeyvuZq0f8/V1GraUJa0 GNCN9DKPwdSwzt4fYPAtmSyqhp24pwkTzpChRTC7xmNXKxIMsxopQumWgVxsILp8bXeE TfG07NrefXec1AI/FQ1IfzMDOFDdBQKnuWAI5nSivxCKNWu79KBhBMTpAIi0AgKv0FUS yQLg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aRDBuFsI; 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 af79cd13be357-7bce34fee82si5660385a.478.2025.01.08.13.53.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 Jan 2025 13:53:20 -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=aRDBuFsI; 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 1tVdyQ-0008JL-UO; Wed, 08 Jan 2025 16:52:22 -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 1tVdyL-0008HP-2X for qemu-devel@nongnu.org; Wed, 08 Jan 2025 16:52:18 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tVdyI-000415-Sl for qemu-devel@nongnu.org; Wed, 08 Jan 2025 16:52:16 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-436a39e4891so2394865e9.1 for ; Wed, 08 Jan 2025 13:52:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736373132; x=1736977932; 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=bK0DLDa7yXdhLO72RuYI+semnMNUmEQT7VpS3MpFwG4=; b=aRDBuFsI2Af+gexMkJMN1RtrLoLKZeuRicpR+hIubLT2NuN8fhfa+NY2PLv0ehZDze UFAleDnMvurHl1JkYJZBWE7dIDInoEdQdYSw7cjxCCRmkeZun50iNidj657fI+UYVFWR h0Dy2YTPg6mRZ/N08fqNyYmlfjWc9xzeNQzvwXhyfwwDo9Cfk7wE+TTsofXHt41A5FIb 7sBFOlUYdH4mapGAdnIZpCe9WSxAVnEvcfgXpNKSGKwoGM46FQLFPnNvA2H4EN19WKDw Yf15u0fH26swi5NJv7IrkDrDmQ6naUXSSbwdr2R0VhLQRbEE47HJ3fDTIUHc3q11aRwa af5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736373132; x=1736977932; 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=bK0DLDa7yXdhLO72RuYI+semnMNUmEQT7VpS3MpFwG4=; b=Eggb5giXdXyrpPUoggrrrvPWIQ7hI2lqrUyy61mNmTfOk4uAMVeY1Z+UQdiNLahWQn GmhEjIgVMfzfUBPVvHfenvHw5EWuwt++frX2AIAAFxj8LttAJV/viWE9XRHSc8yqFzyx rM3CEXgEnBpczzGvlqkUqodHupxrrV+hgyThQ12aQ3bdTrLN2FIGnwZYE2bNv67H74Vf mS9sM9IktI8fqzyssDFhX+md/zQscxhyigMC8LMaCJOWJOqoYQvyi5cBNt2nKupYvcC0 bTa901o0DBtjdJ8MQQUUeOPw0sKyq/9kURgZRN0WrKYeFd/o7qUCI8zOnQYu00yHG+y4 eHRw== X-Gm-Message-State: AOJu0Yxe1GlJX3YizYTv0Zoj7oe/YckHiBSJvFcVd0Ab77H3olaRbmah YpSfjuIKDgU0HF9dCm2h2n3uU4hS07P6Ok23hOC7LQtFf8VZMaBCPLqYw6Wj4nPgWGPNTyH3BsN PTIU= X-Gm-Gg: ASbGnctvhZbDlBD1b2fZD3QUKJ8YBYejMZWhdVJKBhJHpFae4OvWtvYnaBHS8J0bxiQ n/Wj8kBJ4bmtxI1DW4idH9zdGGyP1TWlBIULHX3ZHb/yRlk1KtUHuhbTo5+cdi11N9ivUUAbxUf CNan9XKCfacbuU8BRcoVgBZn7bQPehHs9kuY0t7ZflcwLUZVcMdhycKSG8/GaJ9/wXLa1vNgRkD lPGOwlLpgBW5inoUlvcnR6XbKX2SogWoOk0/U662+qGjdeRn/zteMZr5ARZRBHPY62h5eLSWHEc vJ+2NguaoyPXihb4T0hpU17KdfEa9gY= X-Received: by 2002:a05:600c:3b91:b0:436:46f9:4fc6 with SMTP id 5b1f17b1804b1-436e26928e6mr40467985e9.8.1736373132314; Wed, 08 Jan 2025 13:52:12 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e37d050sm8784f8f.15.2025.01.08.13.52.11 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 08 Jan 2025 13:52:11 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: pierrick.bouvier@linaro.org, Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH v3 03/14] tcg/aarch64: Extract TCG_TARGET_HAS_foo defs to 'tcg-target-has.h' Date: Wed, 8 Jan 2025 22:51:44 +0100 Message-ID: <20250108215156.8731-4-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250108215156.8731-1-philmd@linaro.org> References: <20250107080112.1175095-19-richard.henderson@linaro.org> <20250108215156.8731-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.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 From: Richard Henderson Signed-off-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- tcg/aarch64/tcg-target-has.h | 119 +++++++++++++++++++++++++++++++++++ tcg/aarch64/tcg-target.h | 109 +------------------------------- 2 files changed, 120 insertions(+), 108 deletions(-) create mode 100644 tcg/aarch64/tcg-target-has.h diff --git a/tcg/aarch64/tcg-target-has.h b/tcg/aarch64/tcg-target-has.h new file mode 100644 index 00000000000..0e79e012666 --- /dev/null +++ b/tcg/aarch64/tcg-target-has.h @@ -0,0 +1,119 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * Define target-specific opcode support + * Copyright (c) 2013 Huawei Technologies Duesseldorf GmbH + */ + +#ifndef TCG_TARGET_HAS_H +#define TCG_TARGET_HAS_H + +#include "host/cpuinfo.h" + +#define have_lse (cpuinfo & CPUINFO_LSE) +#define have_lse2 (cpuinfo & CPUINFO_LSE2) + +/* optional instructions */ +#define TCG_TARGET_HAS_div_i32 1 +#define TCG_TARGET_HAS_rem_i32 1 +#define TCG_TARGET_HAS_ext8s_i32 1 +#define TCG_TARGET_HAS_ext16s_i32 1 +#define TCG_TARGET_HAS_ext8u_i32 1 +#define TCG_TARGET_HAS_ext16u_i32 1 +#define TCG_TARGET_HAS_bswap16_i32 1 +#define TCG_TARGET_HAS_bswap32_i32 1 +#define TCG_TARGET_HAS_not_i32 1 +#define TCG_TARGET_HAS_rot_i32 1 +#define TCG_TARGET_HAS_andc_i32 1 +#define TCG_TARGET_HAS_orc_i32 1 +#define TCG_TARGET_HAS_eqv_i32 1 +#define TCG_TARGET_HAS_nand_i32 0 +#define TCG_TARGET_HAS_nor_i32 0 +#define TCG_TARGET_HAS_clz_i32 1 +#define TCG_TARGET_HAS_ctz_i32 1 +#define TCG_TARGET_HAS_ctpop_i32 0 +#define TCG_TARGET_HAS_deposit_i32 1 +#define TCG_TARGET_HAS_extract_i32 1 +#define TCG_TARGET_HAS_sextract_i32 1 +#define TCG_TARGET_HAS_extract2_i32 1 +#define TCG_TARGET_HAS_negsetcond_i32 1 +#define TCG_TARGET_HAS_add2_i32 1 +#define TCG_TARGET_HAS_sub2_i32 1 +#define TCG_TARGET_HAS_mulu2_i32 0 +#define TCG_TARGET_HAS_muls2_i32 0 +#define TCG_TARGET_HAS_muluh_i32 0 +#define TCG_TARGET_HAS_mulsh_i32 0 +#define TCG_TARGET_HAS_extr_i64_i32 0 +#define TCG_TARGET_HAS_qemu_st8_i32 0 + +#define TCG_TARGET_HAS_div_i64 1 +#define TCG_TARGET_HAS_rem_i64 1 +#define TCG_TARGET_HAS_ext8s_i64 1 +#define TCG_TARGET_HAS_ext16s_i64 1 +#define TCG_TARGET_HAS_ext32s_i64 1 +#define TCG_TARGET_HAS_ext8u_i64 1 +#define TCG_TARGET_HAS_ext16u_i64 1 +#define TCG_TARGET_HAS_ext32u_i64 1 +#define TCG_TARGET_HAS_bswap16_i64 1 +#define TCG_TARGET_HAS_bswap32_i64 1 +#define TCG_TARGET_HAS_bswap64_i64 1 +#define TCG_TARGET_HAS_not_i64 1 +#define TCG_TARGET_HAS_rot_i64 1 +#define TCG_TARGET_HAS_andc_i64 1 +#define TCG_TARGET_HAS_orc_i64 1 +#define TCG_TARGET_HAS_eqv_i64 1 +#define TCG_TARGET_HAS_nand_i64 0 +#define TCG_TARGET_HAS_nor_i64 0 +#define TCG_TARGET_HAS_clz_i64 1 +#define TCG_TARGET_HAS_ctz_i64 1 +#define TCG_TARGET_HAS_ctpop_i64 0 +#define TCG_TARGET_HAS_deposit_i64 1 +#define TCG_TARGET_HAS_extract_i64 1 +#define TCG_TARGET_HAS_sextract_i64 1 +#define TCG_TARGET_HAS_extract2_i64 1 +#define TCG_TARGET_HAS_negsetcond_i64 1 +#define TCG_TARGET_HAS_add2_i64 1 +#define TCG_TARGET_HAS_sub2_i64 1 +#define TCG_TARGET_HAS_mulu2_i64 0 +#define TCG_TARGET_HAS_muls2_i64 0 +#define TCG_TARGET_HAS_muluh_i64 1 +#define TCG_TARGET_HAS_mulsh_i64 1 + +/* + * Without FEAT_LSE2, we must use LDXP+STXP to implement atomic 128-bit load, + * which requires writable pages. We must defer to the helper for user-only, + * but in system mode all ram is writable for the host. + */ +#ifdef CONFIG_USER_ONLY +#define TCG_TARGET_HAS_qemu_ldst_i128 have_lse2 +#else +#define TCG_TARGET_HAS_qemu_ldst_i128 1 +#endif + +#define TCG_TARGET_HAS_tst 1 + +#define TCG_TARGET_HAS_v64 1 +#define TCG_TARGET_HAS_v128 1 +#define TCG_TARGET_HAS_v256 0 + +#define TCG_TARGET_HAS_andc_vec 1 +#define TCG_TARGET_HAS_orc_vec 1 +#define TCG_TARGET_HAS_nand_vec 0 +#define TCG_TARGET_HAS_nor_vec 0 +#define TCG_TARGET_HAS_eqv_vec 0 +#define TCG_TARGET_HAS_not_vec 1 +#define TCG_TARGET_HAS_neg_vec 1 +#define TCG_TARGET_HAS_abs_vec 1 +#define TCG_TARGET_HAS_roti_vec 0 +#define TCG_TARGET_HAS_rots_vec 0 +#define TCG_TARGET_HAS_rotv_vec 0 +#define TCG_TARGET_HAS_shi_vec 1 +#define TCG_TARGET_HAS_shs_vec 0 +#define TCG_TARGET_HAS_shv_vec 1 +#define TCG_TARGET_HAS_mul_vec 1 +#define TCG_TARGET_HAS_sat_vec 1 +#define TCG_TARGET_HAS_minmax_vec 1 +#define TCG_TARGET_HAS_bitsel_vec 1 +#define TCG_TARGET_HAS_cmpsel_vec 0 +#define TCG_TARGET_HAS_tst_vec 1 + +#endif diff --git a/tcg/aarch64/tcg-target.h b/tcg/aarch64/tcg-target.h index d8ca52d32da..9a682e51a47 100644 --- a/tcg/aarch64/tcg-target.h +++ b/tcg/aarch64/tcg-target.h @@ -13,8 +13,6 @@ #ifndef AARCH64_TCG_TARGET_H #define AARCH64_TCG_TARGET_H -#include "host/cpuinfo.h" - #define TCG_TARGET_INSN_UNIT_SIZE 4 #define MAX_CODE_GEN_BUFFER_SIZE ((size_t)-1) @@ -49,112 +47,7 @@ typedef enum { #define TCG_TARGET_NB_REGS 64 -#define have_lse (cpuinfo & CPUINFO_LSE) -#define have_lse2 (cpuinfo & CPUINFO_LSE2) - -/* optional instructions */ -#define TCG_TARGET_HAS_div_i32 1 -#define TCG_TARGET_HAS_rem_i32 1 -#define TCG_TARGET_HAS_ext8s_i32 1 -#define TCG_TARGET_HAS_ext16s_i32 1 -#define TCG_TARGET_HAS_ext8u_i32 1 -#define TCG_TARGET_HAS_ext16u_i32 1 -#define TCG_TARGET_HAS_bswap16_i32 1 -#define TCG_TARGET_HAS_bswap32_i32 1 -#define TCG_TARGET_HAS_not_i32 1 -#define TCG_TARGET_HAS_rot_i32 1 -#define TCG_TARGET_HAS_andc_i32 1 -#define TCG_TARGET_HAS_orc_i32 1 -#define TCG_TARGET_HAS_eqv_i32 1 -#define TCG_TARGET_HAS_nand_i32 0 -#define TCG_TARGET_HAS_nor_i32 0 -#define TCG_TARGET_HAS_clz_i32 1 -#define TCG_TARGET_HAS_ctz_i32 1 -#define TCG_TARGET_HAS_ctpop_i32 0 -#define TCG_TARGET_HAS_deposit_i32 1 -#define TCG_TARGET_HAS_extract_i32 1 -#define TCG_TARGET_HAS_sextract_i32 1 -#define TCG_TARGET_HAS_extract2_i32 1 -#define TCG_TARGET_HAS_negsetcond_i32 1 -#define TCG_TARGET_HAS_add2_i32 1 -#define TCG_TARGET_HAS_sub2_i32 1 -#define TCG_TARGET_HAS_mulu2_i32 0 -#define TCG_TARGET_HAS_muls2_i32 0 -#define TCG_TARGET_HAS_muluh_i32 0 -#define TCG_TARGET_HAS_mulsh_i32 0 -#define TCG_TARGET_HAS_extr_i64_i32 0 -#define TCG_TARGET_HAS_qemu_st8_i32 0 - -#define TCG_TARGET_HAS_div_i64 1 -#define TCG_TARGET_HAS_rem_i64 1 -#define TCG_TARGET_HAS_ext8s_i64 1 -#define TCG_TARGET_HAS_ext16s_i64 1 -#define TCG_TARGET_HAS_ext32s_i64 1 -#define TCG_TARGET_HAS_ext8u_i64 1 -#define TCG_TARGET_HAS_ext16u_i64 1 -#define TCG_TARGET_HAS_ext32u_i64 1 -#define TCG_TARGET_HAS_bswap16_i64 1 -#define TCG_TARGET_HAS_bswap32_i64 1 -#define TCG_TARGET_HAS_bswap64_i64 1 -#define TCG_TARGET_HAS_not_i64 1 -#define TCG_TARGET_HAS_rot_i64 1 -#define TCG_TARGET_HAS_andc_i64 1 -#define TCG_TARGET_HAS_orc_i64 1 -#define TCG_TARGET_HAS_eqv_i64 1 -#define TCG_TARGET_HAS_nand_i64 0 -#define TCG_TARGET_HAS_nor_i64 0 -#define TCG_TARGET_HAS_clz_i64 1 -#define TCG_TARGET_HAS_ctz_i64 1 -#define TCG_TARGET_HAS_ctpop_i64 0 -#define TCG_TARGET_HAS_deposit_i64 1 -#define TCG_TARGET_HAS_extract_i64 1 -#define TCG_TARGET_HAS_sextract_i64 1 -#define TCG_TARGET_HAS_extract2_i64 1 -#define TCG_TARGET_HAS_negsetcond_i64 1 -#define TCG_TARGET_HAS_add2_i64 1 -#define TCG_TARGET_HAS_sub2_i64 1 -#define TCG_TARGET_HAS_mulu2_i64 0 -#define TCG_TARGET_HAS_muls2_i64 0 -#define TCG_TARGET_HAS_muluh_i64 1 -#define TCG_TARGET_HAS_mulsh_i64 1 - -/* - * Without FEAT_LSE2, we must use LDXP+STXP to implement atomic 128-bit load, - * which requires writable pages. We must defer to the helper for user-only, - * but in system mode all ram is writable for the host. - */ -#ifdef CONFIG_USER_ONLY -#define TCG_TARGET_HAS_qemu_ldst_i128 have_lse2 -#else -#define TCG_TARGET_HAS_qemu_ldst_i128 1 -#endif - -#define TCG_TARGET_HAS_tst 1 - -#define TCG_TARGET_HAS_v64 1 -#define TCG_TARGET_HAS_v128 1 -#define TCG_TARGET_HAS_v256 0 - -#define TCG_TARGET_HAS_andc_vec 1 -#define TCG_TARGET_HAS_orc_vec 1 -#define TCG_TARGET_HAS_nand_vec 0 -#define TCG_TARGET_HAS_nor_vec 0 -#define TCG_TARGET_HAS_eqv_vec 0 -#define TCG_TARGET_HAS_not_vec 1 -#define TCG_TARGET_HAS_neg_vec 1 -#define TCG_TARGET_HAS_abs_vec 1 -#define TCG_TARGET_HAS_roti_vec 0 -#define TCG_TARGET_HAS_rots_vec 0 -#define TCG_TARGET_HAS_rotv_vec 0 -#define TCG_TARGET_HAS_shi_vec 1 -#define TCG_TARGET_HAS_shs_vec 0 -#define TCG_TARGET_HAS_shv_vec 1 -#define TCG_TARGET_HAS_mul_vec 1 -#define TCG_TARGET_HAS_sat_vec 1 -#define TCG_TARGET_HAS_minmax_vec 1 -#define TCG_TARGET_HAS_bitsel_vec 1 -#define TCG_TARGET_HAS_cmpsel_vec 0 -#define TCG_TARGET_HAS_tst_vec 1 +#include "tcg-target-has.h" #define TCG_TARGET_DEFAULT_MO (0) From patchwork Wed Jan 8 21:51:45 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 855718 Delivered-To: patch@linaro.org Received: by 2002:adf:8b05:0:b0:385:e875:8a9e with SMTP id n5csp942656wra; Wed, 8 Jan 2025 13:52:43 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXcJ8nwy1qKxE3lcoUFsiQEw9GkIdtMnHVCBkAQw7W09f3cQJkQwg+Op4GlMQU+AEXk9Kyutg==@linaro.org X-Google-Smtp-Source: AGHT+IGljRJ2xiclhfVTWBjQGY9zlF1uKNVkQTpu5/ynaaR3URXf+ps4kJRLuc4Whu7rSA4xXtf9 X-Received: by 2002:a05:620a:2684:b0:7a9:a883:e22b with SMTP id af79cd13be357-7bcd96e5806mr637892785a.7.1736373163158; Wed, 08 Jan 2025 13:52:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736373163; cv=none; d=google.com; s=arc-20240605; b=B7+Hi7vWuyhklDrjWCNnEE4Qt5ih9m0KD8zIXp3FK4CoGtJ7ig/rRvrUYhLguXzqdE KOTezq6tAhysak6UpxsDGdc/7S2d8lfIk/SoHGOtJavteMa4dDDiSIdh7X8ahS+9n+fI mDaycv2P7aPi8VmdAv2tHC9EODbZz4hLmCZruFfKL0WBPW7t5ByI9kCpcfBYWAWpRxhi hR9wzStlrc+cvGQX1iZ5YkpXHlvU++7RV1PDEEZ5R+F2uyv8Ocf6vqp1rC5P/VwqiIOz 7Mc8/dz6++HMZeFJ1oTPnzJJmtDCxyaYbe92sCyek76zPTzFw9UOOVxeX2EsuyT3mkdV w6fQ== 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=dPc0RMXPFSRjmvC46uKlBuUNK0EsBD0eabl7VwWoO+8=; fh=I/t+CGVRTvnlN+c1H2rL+bfx7DSzSdCxz00w+BTRVdo=; b=AypbaVkzvPoqaTQMstVaKvlWUwuKU+xTPZE/3H8k0jRi0GKTBZVb3aEhxy0geFh5Wf +XKCl7eGp5/xHGe10DGVG5luFiyp1sXwI437Krz2htTRuaEYX5z6naHX/IwFSzVE6+7G NkUQ000foRCCXVaIX9tYOxBK/BTHvUOzAXqhw1IOrQFaVteNLvriR3m3pVLEgOnO0B9M Br95av9m5udRq4WSoLC2JCxHC7UHMIB5XoA1Pt+U4OJsNUiaR3ArWHxv19Vg4pkP/Dvi fyJoK16VmdQdw2j2NcbtpVCweZVToogIYrGXi6VFK8VRfN+yBv7qhVyy7ZJlCHfneXk8 z0HQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ty71UYrh; 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 af79cd13be357-7bce322a756si6836485a.61.2025.01.08.13.52.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 Jan 2025 13:52:43 -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=Ty71UYrh; 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 1tVdyS-0008LQ-KD; Wed, 08 Jan 2025 16:52:24 -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 1tVdyP-0008IU-Lk for qemu-devel@nongnu.org; Wed, 08 Jan 2025 16:52:22 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tVdyM-00041W-Pi for qemu-devel@nongnu.org; Wed, 08 Jan 2025 16:52:21 -0500 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-385e06af753so140724f8f.2 for ; Wed, 08 Jan 2025 13:52:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736373137; x=1736977937; 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=dPc0RMXPFSRjmvC46uKlBuUNK0EsBD0eabl7VwWoO+8=; b=Ty71UYrhmIlS4zFTQwOS/uqWGnrg+TNNBCY+Mq4dHJN7ECytLQODUeLTFbxKLMD7pJ Bf2eJLUC5OVraO9NeMQCwn5ph9g4oXITnnoNCisTPU9RfU7kJzaeVbIJW9W2aKdTeO/3 jVFQYNnDM4TXe/8dAA+pjTaGooonTtr34RcEms1emAdJx6uD+Xy12QRztc8OXZntssK5 p6hiC27OpFRWgurMqGckFwVuQ7/+zcsiASlh8M3ErWk/pKvqHq3dQ4anssjfA+UHh0P7 MYHJBpdlMDzpvZebsD4whfUP324WsMDUNEk7qdkzzGyITbTyBpQ+6GJa8CaN2yK6kxCK Nt6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736373137; x=1736977937; 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=dPc0RMXPFSRjmvC46uKlBuUNK0EsBD0eabl7VwWoO+8=; b=LmJpv3ISkxv6exmdMjJ/Wan55j31vm7zfq5djHr9YFPb8NGwKQrLGG4mNyNdWwrORp yTHbLRg9ZM3FbyxYeHFJPTHTahsW2hj45BcFPTQ07ywNVu3oqi6f3GBjx+kiyLsgXseG rwus3IFqoTtGsf7+83Lpo2VKRim32Lk1soGqIkBGDWqiOuTQm2Pll8U0CpjK/DBz3zDW ny6+ofFqlUphMWpa+vlYpw9imlOCCtWgtF77CXdxBpQVeQnA2wYIIMVcWRgqM1qMk5hQ 37s+WTVBwyiAJeejzX8SMP/lhzbqEbjQVf6bsHBj+hg1u/+VktXJ403i7FAqnjeEpBIA Iddw== X-Gm-Message-State: AOJu0YzzeMaKP7hinTAONP9+FttVwenbax2EIWBC7VAivLrMyRP6/BEY eBhpZnrZsQN54DLqfRga4Y1pFcb/8m4bTe+Fp0i7LocJ3q1bQIyZy4PX1DTB5n8LAhbTaAolaRI Ez1A= X-Gm-Gg: ASbGncuVZRSTc5IW/jwCj898rwOJsCLFn1xQ0Ync5CnEWL576j3ymlgzoDXSRtjnBVw adpUPnq7N4KOpWS4Ci/Y53UlB7jrbojfORHfSlpwwNiXJnxG9aHTNh5k6EiLfUGHf57MrjR6DFh 8NMp2EAdIszUQN06+yGxnc1h9NENNSvqCFBxMDf3b3chchspMaHoFGzLEa8ADpNtGxQNGilx3JV KdBGNfQZXi+krUCU0+9UFiD0FRVnfV75+NDRM0lbekiWhY0Te5kLXuGItBvp6FnXlzon7J5+xnK vwsOJ3Q6JrKAbpR5m8GJ0giOGUzN7X8= X-Received: by 2002:a5d:64eb:0:b0:38a:50fa:d582 with SMTP id ffacd0b85a97d-38a87363364mr2894960f8f.59.1736373136966; Wed, 08 Jan 2025 13:52:16 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a1c89e4ebsm54316355f8f.85.2025.01.08.13.52.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 08 Jan 2025 13:52:16 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: pierrick.bouvier@linaro.org, Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH v3 04/14] tcg/arm: Extract TCG_TARGET_HAS_foo defs to 'tcg-target-has.h' Date: Wed, 8 Jan 2025 22:51:45 +0100 Message-ID: <20250108215156.8731-5-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250108215156.8731-1-philmd@linaro.org> References: <20250107080112.1175095-19-richard.henderson@linaro.org> <20250108215156.8731-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.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 From: Richard Henderson Signed-off-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- tcg/arm/tcg-target-has.h | 85 ++++++++++++++++++++++++++++++++++++++++ tcg/arm/tcg-target.h | 74 +--------------------------------- 2 files changed, 86 insertions(+), 73 deletions(-) create mode 100644 tcg/arm/tcg-target-has.h diff --git a/tcg/arm/tcg-target-has.h b/tcg/arm/tcg-target-has.h new file mode 100644 index 00000000000..316185500d3 --- /dev/null +++ b/tcg/arm/tcg-target-has.h @@ -0,0 +1,85 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Define target-specific opcode support + * Copyright (c) 2008 Fabrice Bellard + * Copyright (c) 2008 Andrzej Zaborowski + */ + +#ifndef TCG_TARGET_HAS_H +#define TCG_TARGET_HAS_H + +extern int arm_arch; + +#define use_armv7_instructions (__ARM_ARCH >= 7 || arm_arch >= 7) + +#ifdef __ARM_ARCH_EXT_IDIV__ +#define use_idiv_instructions 1 +#else +extern bool use_idiv_instructions; +#endif +#ifdef __ARM_NEON__ +#define use_neon_instructions 1 +#else +extern bool use_neon_instructions; +#endif + +/* optional instructions */ +#define TCG_TARGET_HAS_ext8s_i32 1 +#define TCG_TARGET_HAS_ext16s_i32 1 +#define TCG_TARGET_HAS_ext8u_i32 0 /* and r0, r1, #0xff */ +#define TCG_TARGET_HAS_ext16u_i32 1 +#define TCG_TARGET_HAS_bswap16_i32 1 +#define TCG_TARGET_HAS_bswap32_i32 1 +#define TCG_TARGET_HAS_not_i32 1 +#define TCG_TARGET_HAS_rot_i32 1 +#define TCG_TARGET_HAS_andc_i32 1 +#define TCG_TARGET_HAS_orc_i32 0 +#define TCG_TARGET_HAS_eqv_i32 0 +#define TCG_TARGET_HAS_nand_i32 0 +#define TCG_TARGET_HAS_nor_i32 0 +#define TCG_TARGET_HAS_clz_i32 1 +#define TCG_TARGET_HAS_ctz_i32 use_armv7_instructions +#define TCG_TARGET_HAS_ctpop_i32 0 +#define TCG_TARGET_HAS_deposit_i32 use_armv7_instructions +#define TCG_TARGET_HAS_extract_i32 use_armv7_instructions +#define TCG_TARGET_HAS_sextract_i32 use_armv7_instructions +#define TCG_TARGET_HAS_extract2_i32 1 +#define TCG_TARGET_HAS_negsetcond_i32 1 +#define TCG_TARGET_HAS_mulu2_i32 1 +#define TCG_TARGET_HAS_muls2_i32 1 +#define TCG_TARGET_HAS_muluh_i32 0 +#define TCG_TARGET_HAS_mulsh_i32 0 +#define TCG_TARGET_HAS_div_i32 use_idiv_instructions +#define TCG_TARGET_HAS_rem_i32 0 +#define TCG_TARGET_HAS_qemu_st8_i32 0 + +#define TCG_TARGET_HAS_qemu_ldst_i128 0 + +#define TCG_TARGET_HAS_tst 1 + +#define TCG_TARGET_HAS_v64 use_neon_instructions +#define TCG_TARGET_HAS_v128 use_neon_instructions +#define TCG_TARGET_HAS_v256 0 + +#define TCG_TARGET_HAS_andc_vec 1 +#define TCG_TARGET_HAS_orc_vec 1 +#define TCG_TARGET_HAS_nand_vec 0 +#define TCG_TARGET_HAS_nor_vec 0 +#define TCG_TARGET_HAS_eqv_vec 0 +#define TCG_TARGET_HAS_not_vec 1 +#define TCG_TARGET_HAS_neg_vec 1 +#define TCG_TARGET_HAS_abs_vec 1 +#define TCG_TARGET_HAS_roti_vec 0 +#define TCG_TARGET_HAS_rots_vec 0 +#define TCG_TARGET_HAS_rotv_vec 0 +#define TCG_TARGET_HAS_shi_vec 1 +#define TCG_TARGET_HAS_shs_vec 0 +#define TCG_TARGET_HAS_shv_vec 0 +#define TCG_TARGET_HAS_mul_vec 1 +#define TCG_TARGET_HAS_sat_vec 1 +#define TCG_TARGET_HAS_minmax_vec 1 +#define TCG_TARGET_HAS_bitsel_vec 1 +#define TCG_TARGET_HAS_cmpsel_vec 0 +#define TCG_TARGET_HAS_tst_vec 1 + +#endif diff --git a/tcg/arm/tcg-target.h b/tcg/arm/tcg-target.h index 7f6e24f8610..e114f7ddf40 100644 --- a/tcg/arm/tcg-target.h +++ b/tcg/arm/tcg-target.h @@ -26,10 +26,6 @@ #ifndef ARM_TCG_TARGET_H #define ARM_TCG_TARGET_H -extern int arm_arch; - -#define use_armv7_instructions (__ARM_ARCH >= 7 || arm_arch >= 7) - #define TCG_TARGET_INSN_UNIT_SIZE 4 #define MAX_CODE_GEN_BUFFER_SIZE UINT32_MAX @@ -74,75 +70,7 @@ typedef enum { #define TCG_TARGET_NB_REGS 32 -#ifdef __ARM_ARCH_EXT_IDIV__ -#define use_idiv_instructions 1 -#else -extern bool use_idiv_instructions; -#endif -#ifdef __ARM_NEON__ -#define use_neon_instructions 1 -#else -extern bool use_neon_instructions; -#endif - -/* optional instructions */ -#define TCG_TARGET_HAS_ext8s_i32 1 -#define TCG_TARGET_HAS_ext16s_i32 1 -#define TCG_TARGET_HAS_ext8u_i32 0 /* and r0, r1, #0xff */ -#define TCG_TARGET_HAS_ext16u_i32 1 -#define TCG_TARGET_HAS_bswap16_i32 1 -#define TCG_TARGET_HAS_bswap32_i32 1 -#define TCG_TARGET_HAS_not_i32 1 -#define TCG_TARGET_HAS_rot_i32 1 -#define TCG_TARGET_HAS_andc_i32 1 -#define TCG_TARGET_HAS_orc_i32 0 -#define TCG_TARGET_HAS_eqv_i32 0 -#define TCG_TARGET_HAS_nand_i32 0 -#define TCG_TARGET_HAS_nor_i32 0 -#define TCG_TARGET_HAS_clz_i32 1 -#define TCG_TARGET_HAS_ctz_i32 use_armv7_instructions -#define TCG_TARGET_HAS_ctpop_i32 0 -#define TCG_TARGET_HAS_deposit_i32 use_armv7_instructions -#define TCG_TARGET_HAS_extract_i32 use_armv7_instructions -#define TCG_TARGET_HAS_sextract_i32 use_armv7_instructions -#define TCG_TARGET_HAS_extract2_i32 1 -#define TCG_TARGET_HAS_negsetcond_i32 1 -#define TCG_TARGET_HAS_mulu2_i32 1 -#define TCG_TARGET_HAS_muls2_i32 1 -#define TCG_TARGET_HAS_muluh_i32 0 -#define TCG_TARGET_HAS_mulsh_i32 0 -#define TCG_TARGET_HAS_div_i32 use_idiv_instructions -#define TCG_TARGET_HAS_rem_i32 0 -#define TCG_TARGET_HAS_qemu_st8_i32 0 - -#define TCG_TARGET_HAS_qemu_ldst_i128 0 - -#define TCG_TARGET_HAS_tst 1 - -#define TCG_TARGET_HAS_v64 use_neon_instructions -#define TCG_TARGET_HAS_v128 use_neon_instructions -#define TCG_TARGET_HAS_v256 0 - -#define TCG_TARGET_HAS_andc_vec 1 -#define TCG_TARGET_HAS_orc_vec 1 -#define TCG_TARGET_HAS_nand_vec 0 -#define TCG_TARGET_HAS_nor_vec 0 -#define TCG_TARGET_HAS_eqv_vec 0 -#define TCG_TARGET_HAS_not_vec 1 -#define TCG_TARGET_HAS_neg_vec 1 -#define TCG_TARGET_HAS_abs_vec 1 -#define TCG_TARGET_HAS_roti_vec 0 -#define TCG_TARGET_HAS_rots_vec 0 -#define TCG_TARGET_HAS_rotv_vec 0 -#define TCG_TARGET_HAS_shi_vec 1 -#define TCG_TARGET_HAS_shs_vec 0 -#define TCG_TARGET_HAS_shv_vec 0 -#define TCG_TARGET_HAS_mul_vec 1 -#define TCG_TARGET_HAS_sat_vec 1 -#define TCG_TARGET_HAS_minmax_vec 1 -#define TCG_TARGET_HAS_bitsel_vec 1 -#define TCG_TARGET_HAS_cmpsel_vec 0 -#define TCG_TARGET_HAS_tst_vec 1 +#include "tcg-target-has.h" #define TCG_TARGET_DEFAULT_MO (0) From patchwork Wed Jan 8 21:51:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 855727 Delivered-To: patch@linaro.org Received: by 2002:adf:8b05:0:b0:385:e875:8a9e with SMTP id n5csp942926wra; Wed, 8 Jan 2025 13:53:45 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVa5kGuO8CQitFBPyxk9419FNWMDl8UzC5MdOQ4SZPHxYHrIM1krPsNANSz1dAiN+du9yssMw==@linaro.org X-Google-Smtp-Source: AGHT+IHlg1L6R0PMi+bwOoJwWmufyjoaYuftsxZtQiTIqBLVNRfTkhO952AAkrsSAunPcQYCR+T0 X-Received: by 2002:a05:6214:48d:b0:6dd:5f90:16bd with SMTP id 6a1803df08f44-6df9b2ea6ddmr65389116d6.41.1736373224741; Wed, 08 Jan 2025 13:53:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736373224; cv=none; d=google.com; s=arc-20240605; b=k+FiW6Wj9TMF+SsvK18xgXYJ2i82BNO73X2eax9AOSLtErVKCbjCO+Lr7HtR2yfUOj YmYTLgZarCYW70lK2QkdjBg1okpkAPpqccMwLLaTpaZBDgTdfkKdKKcvS9858dCsVcHO xXkqt4NWsSJoS2IwHutt3phyG6ryPZPmekYqghzKDJwxZZHRnuRnzhfAE+C2y0tNvhgb oaIFYxLpttuPE6hX+V+ZBwUvifKvZPZ7AgxLJw8+0ULfzSY5S31m983MiMGQU4MINo16 logYjaiIQ5F4UozWEn1i6m2RO7K9w+NOfc4s+nggxtbJFADmNEY2mQ33nxmt0aOXgLJ/ 4KCw== 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=qsLfIB5HVYuIPzxAk6X9Uyz9K0eCu9XCNoN8YsZX/Hw=; fh=I/t+CGVRTvnlN+c1H2rL+bfx7DSzSdCxz00w+BTRVdo=; b=bybCFKdyfs5WgdOU/8koHg8JLuS7ghrRlmMHmq3S1gibY1PhespZ+6yvPyNxYo015Z xD4rdZajar3v8ZI8o7v4s5ZkZyymXggzZjd0gHqnyrhFp/qF1ng6AwmrsYec4CPhNRmG h8fA81vz4LKdVTDNuwwvcHBqpOzBJUHQW204bmCpEHcrhWZeafnql/jRlhvVJoe8/Sc7 lcfan/wcHSiD47W81QQlWsSum4VLmVV+N0VQD0UOi2PL9P2vLpU8BKiUZZDN8AAnLJmo hf4sNIOv/A6jEI4tmjuR965gfy5JocvGB3kbCMGLOEvFaDSBggixurzrqj+KnnOCt+0b Mirg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SlLKAJDt; 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 6a1803df08f44-6dd1836f754si491886216d6.499.2025.01.08.13.53.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 Jan 2025 13:53:44 -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=SlLKAJDt; 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 1tVdyW-0008Q4-UQ; Wed, 08 Jan 2025 16:52:28 -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 1tVdyT-0008Lg-Kn for qemu-devel@nongnu.org; Wed, 08 Jan 2025 16:52:25 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tVdyR-000421-Di for qemu-devel@nongnu.org; Wed, 08 Jan 2025 16:52:25 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-4368a293339so3574305e9.3 for ; Wed, 08 Jan 2025 13:52:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736373142; x=1736977942; 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=qsLfIB5HVYuIPzxAk6X9Uyz9K0eCu9XCNoN8YsZX/Hw=; b=SlLKAJDtG+GnPaTwEC7RzkpB29np92hgh3A/qZwJDOO3Ajvp8aQ6ETi2wJjYWeiUDd DpNT6kSNf1AmAqUiqRHIarBQqCTHH3u5BvvEFaaP3Ul0p4JSdgFyL7cLAgCzM9UN3zAH 3I+9jezU2Iy0CAXyWe4leTxF8/4gDnfeo9KHHm1MFngG90fMl4/TYGBKnxzngXOujvlz R2jclnSTtm3kH0RKQiT4BjXVcTGjunhMdi5CS9TSnPaaI3tL2fyPH/6j/qT4fmYqiEBh csIZ/X12Jg9ZkHrsVj7eJknVh/Eznpyxziacqe6bkp7fwxBjN2DV9V7Zqz3eRZ9tx/Ku U4gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736373142; x=1736977942; 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=qsLfIB5HVYuIPzxAk6X9Uyz9K0eCu9XCNoN8YsZX/Hw=; b=YPJFDnGh3T2t9r6gFxV6B6GoutR4n+V+hWT71Fdq4VOGjeQNNYQ/tg6EoVMXKDOVit ulfSijtm182x6YKO1QoeihP/Rm5l58H5Cpn7va0Tb9zih5unNZq+egRWwrSRMkl/FqoN JF0oev1KmDVl/xy5/rzSuv+kUmJlYr413cDCIgmj5gVRSSeByf3dgMMug0cEiSIq6EW/ 5FpgCZ8AXwBEXBWGHiy9g3b1bmdBX+jyZ/X2RUTQYvLD0Y7U/h3OPUmD8AbxOP9Ge5XY YxSaKgv65yS8mF7iRy9xgV27XXMPwGnPrbQxK1HB3YCr9/533HJycHuicpy6GmqMMLYW SM+A== X-Gm-Message-State: AOJu0Yww8RZNRxPfRwMy+ubD4hcD2LBZLVY5iqpYq7k4C0TgfuIOv5UJ RFFAAHq7s+qo6UiyREuifHFU5YShORZcKKTTvVX9FUSN0kh7ClVe7RZL6qhVTg2JgnJK086T4ZI bSnA= X-Gm-Gg: ASbGncuf2sNYcDuk+YO2mE6S+LSebEjRm6JfQMWjvw7SbjeHcXkpgfNH/S1kudx/FKI 0yLxW6b5KmliEVRLxTJLF3fEUgF48Kph8z3ssASvTnsX3EB6E6a8+AKEdc3TH57HEfTobDaVN87 3VDAI/56inmwx+dDMFEUkQOTwNTkaUdeavHFDlGrint5Bh9ZTbpTDS9TePxMIbS1X97o8eKTU6z RGH9SPaP70tVwmi3wCfSa39DE49U3yqm9HSQ2wswduwqLzxOjNQZv+AxYorgbIuSPUnoejPS+Bl zvu57H+dQeQbCFxxFxVIcNCZKtDOp14= X-Received: by 2002:a05:6000:18ae:b0:38a:4b8b:1ba with SMTP id ffacd0b85a97d-38a873049e3mr3227272f8f.14.1736373141536; Wed, 08 Jan 2025 13:52:21 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e99b4ff8sm750435e9.20.2025.01.08.13.52.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 08 Jan 2025 13:52:21 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: pierrick.bouvier@linaro.org, Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH v3 05/14] tcg/i386: Extract TCG_TARGET_HAS_foo defs to 'tcg-target-has.h' Date: Wed, 8 Jan 2025 22:51:46 +0100 Message-ID: <20250108215156.8731-6-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250108215156.8731-1-philmd@linaro.org> References: <20250107080112.1175095-19-richard.henderson@linaro.org> <20250108215156.8731-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.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 From: Richard Henderson Signed-off-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- tcg/i386/tcg-target-has.h | 139 ++++++++++++++++++++++++++++++++++++++ tcg/i386/tcg-target.h | 129 +---------------------------------- 2 files changed, 140 insertions(+), 128 deletions(-) create mode 100644 tcg/i386/tcg-target-has.h diff --git a/tcg/i386/tcg-target-has.h b/tcg/i386/tcg-target-has.h new file mode 100644 index 00000000000..3ea2eab8071 --- /dev/null +++ b/tcg/i386/tcg-target-has.h @@ -0,0 +1,139 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Define target-specific opcode support + * Copyright (c) 2008 Fabrice Bellard + */ + +#ifndef TCG_TARGET_HAS_H +#define TCG_TARGET_HAS_H + +#include "host/cpuinfo.h" + +#define have_bmi1 (cpuinfo & CPUINFO_BMI1) +#define have_popcnt (cpuinfo & CPUINFO_POPCNT) +#define have_avx1 (cpuinfo & CPUINFO_AVX1) +#define have_avx2 (cpuinfo & CPUINFO_AVX2) +#define have_movbe (cpuinfo & CPUINFO_MOVBE) + +/* + * There are interesting instructions in AVX512, so long as we have AVX512VL, + * which indicates support for EVEX on sizes smaller than 512 bits. + */ +#define have_avx512vl ((cpuinfo & CPUINFO_AVX512VL) && \ + (cpuinfo & CPUINFO_AVX512F)) +#define have_avx512bw ((cpuinfo & CPUINFO_AVX512BW) && have_avx512vl) +#define have_avx512dq ((cpuinfo & CPUINFO_AVX512DQ) && have_avx512vl) +#define have_avx512vbmi2 ((cpuinfo & CPUINFO_AVX512VBMI2) && have_avx512vl) + +/* optional instructions */ +#define TCG_TARGET_HAS_div2_i32 1 +#define TCG_TARGET_HAS_rot_i32 1 +#define TCG_TARGET_HAS_ext8s_i32 1 +#define TCG_TARGET_HAS_ext16s_i32 1 +#define TCG_TARGET_HAS_ext8u_i32 1 +#define TCG_TARGET_HAS_ext16u_i32 1 +#define TCG_TARGET_HAS_bswap16_i32 1 +#define TCG_TARGET_HAS_bswap32_i32 1 +#define TCG_TARGET_HAS_not_i32 1 +#define TCG_TARGET_HAS_andc_i32 have_bmi1 +#define TCG_TARGET_HAS_orc_i32 0 +#define TCG_TARGET_HAS_eqv_i32 0 +#define TCG_TARGET_HAS_nand_i32 0 +#define TCG_TARGET_HAS_nor_i32 0 +#define TCG_TARGET_HAS_clz_i32 1 +#define TCG_TARGET_HAS_ctz_i32 1 +#define TCG_TARGET_HAS_ctpop_i32 have_popcnt +#define TCG_TARGET_HAS_deposit_i32 1 +#define TCG_TARGET_HAS_extract_i32 1 +#define TCG_TARGET_HAS_sextract_i32 1 +#define TCG_TARGET_HAS_extract2_i32 1 +#define TCG_TARGET_HAS_negsetcond_i32 1 +#define TCG_TARGET_HAS_add2_i32 1 +#define TCG_TARGET_HAS_sub2_i32 1 +#define TCG_TARGET_HAS_mulu2_i32 1 +#define TCG_TARGET_HAS_muls2_i32 1 +#define TCG_TARGET_HAS_muluh_i32 0 +#define TCG_TARGET_HAS_mulsh_i32 0 + +#if TCG_TARGET_REG_BITS == 64 +/* Keep 32-bit values zero-extended in a register. */ +#define TCG_TARGET_HAS_extr_i64_i32 1 +#define TCG_TARGET_HAS_div2_i64 1 +#define TCG_TARGET_HAS_rot_i64 1 +#define TCG_TARGET_HAS_ext8s_i64 1 +#define TCG_TARGET_HAS_ext16s_i64 1 +#define TCG_TARGET_HAS_ext32s_i64 1 +#define TCG_TARGET_HAS_ext8u_i64 1 +#define TCG_TARGET_HAS_ext16u_i64 1 +#define TCG_TARGET_HAS_ext32u_i64 1 +#define TCG_TARGET_HAS_bswap16_i64 1 +#define TCG_TARGET_HAS_bswap32_i64 1 +#define TCG_TARGET_HAS_bswap64_i64 1 +#define TCG_TARGET_HAS_not_i64 1 +#define TCG_TARGET_HAS_andc_i64 have_bmi1 +#define TCG_TARGET_HAS_orc_i64 0 +#define TCG_TARGET_HAS_eqv_i64 0 +#define TCG_TARGET_HAS_nand_i64 0 +#define TCG_TARGET_HAS_nor_i64 0 +#define TCG_TARGET_HAS_clz_i64 1 +#define TCG_TARGET_HAS_ctz_i64 1 +#define TCG_TARGET_HAS_ctpop_i64 have_popcnt +#define TCG_TARGET_HAS_deposit_i64 1 +#define TCG_TARGET_HAS_extract_i64 1 +#define TCG_TARGET_HAS_sextract_i64 0 +#define TCG_TARGET_HAS_extract2_i64 1 +#define TCG_TARGET_HAS_negsetcond_i64 1 +#define TCG_TARGET_HAS_add2_i64 1 +#define TCG_TARGET_HAS_sub2_i64 1 +#define TCG_TARGET_HAS_mulu2_i64 1 +#define TCG_TARGET_HAS_muls2_i64 1 +#define TCG_TARGET_HAS_muluh_i64 0 +#define TCG_TARGET_HAS_mulsh_i64 0 +#define TCG_TARGET_HAS_qemu_st8_i32 0 +#else +#define TCG_TARGET_HAS_qemu_st8_i32 1 +#endif + +#define TCG_TARGET_HAS_qemu_ldst_i128 \ + (TCG_TARGET_REG_BITS == 64 && (cpuinfo & CPUINFO_ATOMIC_VMOVDQA)) + +#define TCG_TARGET_HAS_tst 1 + +/* We do not support older SSE systems, only beginning with AVX1. */ +#define TCG_TARGET_HAS_v64 have_avx1 +#define TCG_TARGET_HAS_v128 have_avx1 +#define TCG_TARGET_HAS_v256 have_avx2 + +#define TCG_TARGET_HAS_andc_vec 1 +#define TCG_TARGET_HAS_orc_vec have_avx512vl +#define TCG_TARGET_HAS_nand_vec have_avx512vl +#define TCG_TARGET_HAS_nor_vec have_avx512vl +#define TCG_TARGET_HAS_eqv_vec have_avx512vl +#define TCG_TARGET_HAS_not_vec have_avx512vl +#define TCG_TARGET_HAS_neg_vec 0 +#define TCG_TARGET_HAS_abs_vec 1 +#define TCG_TARGET_HAS_roti_vec have_avx512vl +#define TCG_TARGET_HAS_rots_vec 0 +#define TCG_TARGET_HAS_rotv_vec have_avx512vl +#define TCG_TARGET_HAS_shi_vec 1 +#define TCG_TARGET_HAS_shs_vec 1 +#define TCG_TARGET_HAS_shv_vec have_avx2 +#define TCG_TARGET_HAS_mul_vec 1 +#define TCG_TARGET_HAS_sat_vec 1 +#define TCG_TARGET_HAS_minmax_vec 1 +#define TCG_TARGET_HAS_bitsel_vec have_avx512vl +#define TCG_TARGET_HAS_cmpsel_vec 1 +#define TCG_TARGET_HAS_tst_vec have_avx512bw + +#define TCG_TARGET_deposit_i32_valid(ofs, len) \ + (((ofs) == 0 && ((len) == 8 || (len) == 16)) || \ + (TCG_TARGET_REG_BITS == 32 && (ofs) == 8 && (len) == 8)) +#define TCG_TARGET_deposit_i64_valid TCG_TARGET_deposit_i32_valid + +/* Check for the possibility of high-byte extraction and, for 64-bit, + zero-extending 32-bit right-shift. */ +#define TCG_TARGET_extract_i32_valid(ofs, len) ((ofs) == 8 && (len) == 8) +#define TCG_TARGET_extract_i64_valid(ofs, len) \ + (((ofs) == 8 && (len) == 8) || ((ofs) + (len)) == 32) + +#endif diff --git a/tcg/i386/tcg-target.h b/tcg/i386/tcg-target.h index 9961d8e7576..a1dfdeb28d4 100644 --- a/tcg/i386/tcg-target.h +++ b/tcg/i386/tcg-target.h @@ -25,8 +25,6 @@ #ifndef I386_TCG_TARGET_H #define I386_TCG_TARGET_H -#include "host/cpuinfo.h" - #define TCG_TARGET_INSN_UNIT_SIZE 1 #ifdef __x86_64__ @@ -90,132 +88,7 @@ typedef enum { TCG_REG_CALL_STACK = TCG_REG_ESP } TCGReg; -#define have_bmi1 (cpuinfo & CPUINFO_BMI1) -#define have_popcnt (cpuinfo & CPUINFO_POPCNT) -#define have_avx1 (cpuinfo & CPUINFO_AVX1) -#define have_avx2 (cpuinfo & CPUINFO_AVX2) -#define have_movbe (cpuinfo & CPUINFO_MOVBE) - -/* - * There are interesting instructions in AVX512, so long as we have AVX512VL, - * which indicates support for EVEX on sizes smaller than 512 bits. - */ -#define have_avx512vl ((cpuinfo & CPUINFO_AVX512VL) && \ - (cpuinfo & CPUINFO_AVX512F)) -#define have_avx512bw ((cpuinfo & CPUINFO_AVX512BW) && have_avx512vl) -#define have_avx512dq ((cpuinfo & CPUINFO_AVX512DQ) && have_avx512vl) -#define have_avx512vbmi2 ((cpuinfo & CPUINFO_AVX512VBMI2) && have_avx512vl) - -/* optional instructions */ -#define TCG_TARGET_HAS_div2_i32 1 -#define TCG_TARGET_HAS_rot_i32 1 -#define TCG_TARGET_HAS_ext8s_i32 1 -#define TCG_TARGET_HAS_ext16s_i32 1 -#define TCG_TARGET_HAS_ext8u_i32 1 -#define TCG_TARGET_HAS_ext16u_i32 1 -#define TCG_TARGET_HAS_bswap16_i32 1 -#define TCG_TARGET_HAS_bswap32_i32 1 -#define TCG_TARGET_HAS_not_i32 1 -#define TCG_TARGET_HAS_andc_i32 have_bmi1 -#define TCG_TARGET_HAS_orc_i32 0 -#define TCG_TARGET_HAS_eqv_i32 0 -#define TCG_TARGET_HAS_nand_i32 0 -#define TCG_TARGET_HAS_nor_i32 0 -#define TCG_TARGET_HAS_clz_i32 1 -#define TCG_TARGET_HAS_ctz_i32 1 -#define TCG_TARGET_HAS_ctpop_i32 have_popcnt -#define TCG_TARGET_HAS_deposit_i32 1 -#define TCG_TARGET_HAS_extract_i32 1 -#define TCG_TARGET_HAS_sextract_i32 1 -#define TCG_TARGET_HAS_extract2_i32 1 -#define TCG_TARGET_HAS_negsetcond_i32 1 -#define TCG_TARGET_HAS_add2_i32 1 -#define TCG_TARGET_HAS_sub2_i32 1 -#define TCG_TARGET_HAS_mulu2_i32 1 -#define TCG_TARGET_HAS_muls2_i32 1 -#define TCG_TARGET_HAS_muluh_i32 0 -#define TCG_TARGET_HAS_mulsh_i32 0 - -#if TCG_TARGET_REG_BITS == 64 -/* Keep 32-bit values zero-extended in a register. */ -#define TCG_TARGET_HAS_extr_i64_i32 1 -#define TCG_TARGET_HAS_div2_i64 1 -#define TCG_TARGET_HAS_rot_i64 1 -#define TCG_TARGET_HAS_ext8s_i64 1 -#define TCG_TARGET_HAS_ext16s_i64 1 -#define TCG_TARGET_HAS_ext32s_i64 1 -#define TCG_TARGET_HAS_ext8u_i64 1 -#define TCG_TARGET_HAS_ext16u_i64 1 -#define TCG_TARGET_HAS_ext32u_i64 1 -#define TCG_TARGET_HAS_bswap16_i64 1 -#define TCG_TARGET_HAS_bswap32_i64 1 -#define TCG_TARGET_HAS_bswap64_i64 1 -#define TCG_TARGET_HAS_not_i64 1 -#define TCG_TARGET_HAS_andc_i64 have_bmi1 -#define TCG_TARGET_HAS_orc_i64 0 -#define TCG_TARGET_HAS_eqv_i64 0 -#define TCG_TARGET_HAS_nand_i64 0 -#define TCG_TARGET_HAS_nor_i64 0 -#define TCG_TARGET_HAS_clz_i64 1 -#define TCG_TARGET_HAS_ctz_i64 1 -#define TCG_TARGET_HAS_ctpop_i64 have_popcnt -#define TCG_TARGET_HAS_deposit_i64 1 -#define TCG_TARGET_HAS_extract_i64 1 -#define TCG_TARGET_HAS_sextract_i64 0 -#define TCG_TARGET_HAS_extract2_i64 1 -#define TCG_TARGET_HAS_negsetcond_i64 1 -#define TCG_TARGET_HAS_add2_i64 1 -#define TCG_TARGET_HAS_sub2_i64 1 -#define TCG_TARGET_HAS_mulu2_i64 1 -#define TCG_TARGET_HAS_muls2_i64 1 -#define TCG_TARGET_HAS_muluh_i64 0 -#define TCG_TARGET_HAS_mulsh_i64 0 -#define TCG_TARGET_HAS_qemu_st8_i32 0 -#else -#define TCG_TARGET_HAS_qemu_st8_i32 1 -#endif - -#define TCG_TARGET_HAS_qemu_ldst_i128 \ - (TCG_TARGET_REG_BITS == 64 && (cpuinfo & CPUINFO_ATOMIC_VMOVDQA)) - -#define TCG_TARGET_HAS_tst 1 - -/* We do not support older SSE systems, only beginning with AVX1. */ -#define TCG_TARGET_HAS_v64 have_avx1 -#define TCG_TARGET_HAS_v128 have_avx1 -#define TCG_TARGET_HAS_v256 have_avx2 - -#define TCG_TARGET_HAS_andc_vec 1 -#define TCG_TARGET_HAS_orc_vec have_avx512vl -#define TCG_TARGET_HAS_nand_vec have_avx512vl -#define TCG_TARGET_HAS_nor_vec have_avx512vl -#define TCG_TARGET_HAS_eqv_vec have_avx512vl -#define TCG_TARGET_HAS_not_vec have_avx512vl -#define TCG_TARGET_HAS_neg_vec 0 -#define TCG_TARGET_HAS_abs_vec 1 -#define TCG_TARGET_HAS_roti_vec have_avx512vl -#define TCG_TARGET_HAS_rots_vec 0 -#define TCG_TARGET_HAS_rotv_vec have_avx512vl -#define TCG_TARGET_HAS_shi_vec 1 -#define TCG_TARGET_HAS_shs_vec 1 -#define TCG_TARGET_HAS_shv_vec have_avx2 -#define TCG_TARGET_HAS_mul_vec 1 -#define TCG_TARGET_HAS_sat_vec 1 -#define TCG_TARGET_HAS_minmax_vec 1 -#define TCG_TARGET_HAS_bitsel_vec have_avx512vl -#define TCG_TARGET_HAS_cmpsel_vec 1 -#define TCG_TARGET_HAS_tst_vec have_avx512bw - -#define TCG_TARGET_deposit_i32_valid(ofs, len) \ - (((ofs) == 0 && ((len) == 8 || (len) == 16)) || \ - (TCG_TARGET_REG_BITS == 32 && (ofs) == 8 && (len) == 8)) -#define TCG_TARGET_deposit_i64_valid TCG_TARGET_deposit_i32_valid - -/* Check for the possibility of high-byte extraction and, for 64-bit, - zero-extending 32-bit right-shift. */ -#define TCG_TARGET_extract_i32_valid(ofs, len) ((ofs) == 8 && (len) == 8) -#define TCG_TARGET_extract_i64_valid(ofs, len) \ - (((ofs) == 8 && (len) == 8) || ((ofs) + (len)) == 32) +#include "tcg-target-has.h" /* This defines the natural memory order supported by this * architecture before guarantees made by various barrier From patchwork Wed Jan 8 21:51:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 855729 Delivered-To: patch@linaro.org Received: by 2002:adf:8b05:0:b0:385:e875:8a9e with SMTP id n5csp942933wra; Wed, 8 Jan 2025 13:53:45 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXA6dzELLfH125XKx1qVeqYV0zLKwCkai8130qm/YGFlajwtAclIOBGs9+uBi+QCJ88nCkk7w==@linaro.org X-Google-Smtp-Source: AGHT+IEJgXf3FslQtXBEVzuQp+cJjKYCombkjS9S0kVaoA5ZIlPXywtlCphBzNLu4cmvgR4PSj8a X-Received: by 2002:a05:6214:2586:b0:6d8:883b:142a with SMTP id 6a1803df08f44-6df9b1b4fdfmr74864986d6.2.1736373225265; Wed, 08 Jan 2025 13:53:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736373225; cv=none; d=google.com; s=arc-20240605; b=ikycgBK7CqvCFyyZxR1fk2gms62FwE7gAKGvpzVlGBIA6FANPZL3SBKeZSaSLiiJoz I2TZoFofKJHS40vpZjQKs7JD3juBCf3XtMA8voyxabcsdEyhEyhy2Z+X2qFxPbM3xkIw y2tozh1CgOxmBU0BqUefEZtaLnBdYr41b3JiOgLyH56ykbPsR8us1+nK224dY+KCgugR AtgmZvfJJGplzZWKnbZ9q8a4LB2XTZt0TzohK24zbNo9EZm4rEGZekGFxOh0iGflJJQK bdQqNAosKhwDlYtBUxfIpdr1gDHpAG6vBL42374VRkpuNaVLL/e58gncou90adFyQWtl O6XQ== 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=BjurB30feh31L4vvKnOWTjLO5NeT2JI+C6yferOyGvM=; fh=I/t+CGVRTvnlN+c1H2rL+bfx7DSzSdCxz00w+BTRVdo=; b=TunFreAoeXbPcMmyKcHBNQ/xpuz+lsaAtqfbsT4+rBaJCwAoqnCjugq9+sqOpoEuY2 DpTW+uMO+ZrEGzeCFlK2Tkev4wnL6FBDrMkGNwTTcXDSOnwwOa59yhYPKwThQ5lu7gW0 qaHQ8CHpAWuS+1V33LKprbNBJ1GWnArvOhgART1H02QTc7Lc66hZ37AY9wZ22YyiGjaM vvgQb/eEa5UdEI8izcDR3oh86035ss0GLKDfEBEDDvwi96HMJi1quEN7bpAjWtAYb0BX /8BlMhBx4pD978/jCliYEnyIxHUoPFXvNr9R7rgCk7jWRGhZkljwwJMoQ5vS+ffpD+nG g15Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=umtpk+XL; 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-46a3e68189asi121311581cf.31.2025.01.08.13.53.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 Jan 2025 13:53:45 -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=umtpk+XL; 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 1tVdyf-0008Sv-HQ; Wed, 08 Jan 2025 16:52:37 -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 1tVdyY-0008QS-BK for qemu-devel@nongnu.org; Wed, 08 Jan 2025 16:52:30 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tVdyW-00042a-6c for qemu-devel@nongnu.org; Wed, 08 Jan 2025 16:52:29 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-435f8f29f8aso2366815e9.2 for ; Wed, 08 Jan 2025 13:52:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736373146; x=1736977946; 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=BjurB30feh31L4vvKnOWTjLO5NeT2JI+C6yferOyGvM=; b=umtpk+XLh8nRu3R0os2n2MCggzRW9i+qREl5FewbqDkVFOD8oYx3yqcvDEixqbyPBv tcCogVW/pe68lF2+Wu97wo5e+xPnM7KsI+cqsrilbOmY4iCzrl4EX+f7y7YyT+Bm4u/M SeJmOhQyQDEg30LITILgDseMFLRoBPW9GbyAKtQDIujS9qPfcub1wuUOjGzQYIBNERRt IUaP++kQR8C3tGCXAsXbE36mrK+9jupxfmQCJYVQIVVsr7WnUc+FI2KyDs9WlTH5o/0E 1aAmFHFzi4L4yTQX0nqeaA5JQrEvuXHljM7RqMcyN5kMwFLzwUcM2oDMCzhpPEIw1B5v Dv+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736373146; x=1736977946; 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=BjurB30feh31L4vvKnOWTjLO5NeT2JI+C6yferOyGvM=; b=J+P71GLVvCMSpvWz4CW9TyibJ8hQFrvvhbxAIGdPPVsWp0s1nOZ7aXMsbh+NSn5Vjw fUNvRoux2UU1tYl9eKgBZDkevyBw3ppP64AhHSpxht3nCzeEroUSBxY7yOfUHCi1y1Tb PEfXTngsWodaNl9vJzRlpl0AV55fZuB+qjcm/wCI2n8p9meygUs/mHU1In1eVKr4cedi 8V2DKds5OkSCgmupTx1hyRzk/mdouPtWhab2KXOR2NWA5jYshlISlKYyWzPlZn/dt/uj 9gb9o19jZodmn2YuEYkGyo1VX24nWC5GaJn6/KaDUgIMbPNVU+IScqDmsFWoLYWmkRkT WjLg== X-Gm-Message-State: AOJu0YzEN808JItmcOigaH+MEbdAGKGTpqypOALd59CziS4fnReGJgfU BH1biwcLGVdFTJLtjmeqCZ8LGV+rl+U1JGTG9mcHX0QvcPjfsGY40QRC2SZHlZLVJcK0c69jLpw MDFQ= X-Gm-Gg: ASbGncvFNj1xt4ueMcb6PEMeymzwI1FpRXKMXvCeybug3ljkk8EbjSiSkMPYcb1beSi 9pqN03SnwruPNloOXg90mVPEaLdeR5Gw7G797n3KBqpyoLS5pFnvgqso7EtJzTo5Rh7TZXBlj8X htC/u8pDdoes3OjoOg6SIQ6/rR/XMnGqDtAqUUEZh4sNabPM+gzHBYXbAa0q7T76mR7grY4CC+K Jj1YHGloa3O07jR1/zvLoM7Ozy5aIcMQLlc6AKFL8RQnln45ZE7Ecr5Rayrz5M0/09wcNHlsNOv Dl+RV7Ca6Ex9pk8aBD3Uh+CDTeF3r3s= X-Received: by 2002:a05:600c:3514:b0:434:a367:2bd9 with SMTP id 5b1f17b1804b1-436e26a607fmr40625175e9.14.1736373146134; Wed, 08 Jan 2025 13:52:26 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e2ddcda3sm33842665e9.22.2025.01.08.13.52.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 08 Jan 2025 13:52:25 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: pierrick.bouvier@linaro.org, Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH v3 06/14] tcg/loongarch64: Extract TCG_TARGET_HAS_foo defs to 'tcg-target-has.h' Date: Wed, 8 Jan 2025 22:51:47 +0100 Message-ID: <20250108215156.8731-7-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250108215156.8731-1-philmd@linaro.org> References: <20250107080112.1175095-19-richard.henderson@linaro.org> <20250108215156.8731-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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 From: Richard Henderson Signed-off-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- tcg/loongarch64/tcg-target-has.h | 113 +++++++++++++++++++++++++++++++ tcg/loongarch64/tcg-target.h | 102 +--------------------------- 2 files changed, 114 insertions(+), 101 deletions(-) create mode 100644 tcg/loongarch64/tcg-target-has.h diff --git a/tcg/loongarch64/tcg-target-has.h b/tcg/loongarch64/tcg-target-has.h new file mode 100644 index 00000000000..e4333c36c65 --- /dev/null +++ b/tcg/loongarch64/tcg-target-has.h @@ -0,0 +1,113 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Define target-specific opcode support + * Copyright (c) 2021 WANG Xuerui + */ + +#ifndef TCG_TARGET_HAS_H +#define TCG_TARGET_HAS_H + +#include "host/cpuinfo.h" + +/* optional instructions */ +#define TCG_TARGET_HAS_negsetcond_i32 0 +#define TCG_TARGET_HAS_div_i32 1 +#define TCG_TARGET_HAS_rem_i32 1 +#define TCG_TARGET_HAS_div2_i32 0 +#define TCG_TARGET_HAS_rot_i32 1 +#define TCG_TARGET_HAS_deposit_i32 1 +#define TCG_TARGET_HAS_extract_i32 1 +#define TCG_TARGET_HAS_sextract_i32 0 +#define TCG_TARGET_HAS_extract2_i32 0 +#define TCG_TARGET_HAS_add2_i32 0 +#define TCG_TARGET_HAS_sub2_i32 0 +#define TCG_TARGET_HAS_mulu2_i32 0 +#define TCG_TARGET_HAS_muls2_i32 0 +#define TCG_TARGET_HAS_muluh_i32 1 +#define TCG_TARGET_HAS_mulsh_i32 1 +#define TCG_TARGET_HAS_ext8s_i32 1 +#define TCG_TARGET_HAS_ext16s_i32 1 +#define TCG_TARGET_HAS_ext8u_i32 1 +#define TCG_TARGET_HAS_ext16u_i32 1 +#define TCG_TARGET_HAS_bswap16_i32 1 +#define TCG_TARGET_HAS_bswap32_i32 1 +#define TCG_TARGET_HAS_not_i32 1 +#define TCG_TARGET_HAS_andc_i32 1 +#define TCG_TARGET_HAS_orc_i32 1 +#define TCG_TARGET_HAS_eqv_i32 0 +#define TCG_TARGET_HAS_nand_i32 0 +#define TCG_TARGET_HAS_nor_i32 1 +#define TCG_TARGET_HAS_clz_i32 1 +#define TCG_TARGET_HAS_ctz_i32 1 +#define TCG_TARGET_HAS_ctpop_i32 0 +#define TCG_TARGET_HAS_brcond2 0 +#define TCG_TARGET_HAS_setcond2 0 +#define TCG_TARGET_HAS_qemu_st8_i32 0 + +/* 64-bit operations */ +#define TCG_TARGET_HAS_negsetcond_i64 0 +#define TCG_TARGET_HAS_div_i64 1 +#define TCG_TARGET_HAS_rem_i64 1 +#define TCG_TARGET_HAS_div2_i64 0 +#define TCG_TARGET_HAS_rot_i64 1 +#define TCG_TARGET_HAS_deposit_i64 1 +#define TCG_TARGET_HAS_extract_i64 1 +#define TCG_TARGET_HAS_sextract_i64 0 +#define TCG_TARGET_HAS_extract2_i64 0 +#define TCG_TARGET_HAS_extr_i64_i32 1 +#define TCG_TARGET_HAS_ext8s_i64 1 +#define TCG_TARGET_HAS_ext16s_i64 1 +#define TCG_TARGET_HAS_ext32s_i64 1 +#define TCG_TARGET_HAS_ext8u_i64 1 +#define TCG_TARGET_HAS_ext16u_i64 1 +#define TCG_TARGET_HAS_ext32u_i64 1 +#define TCG_TARGET_HAS_bswap16_i64 1 +#define TCG_TARGET_HAS_bswap32_i64 1 +#define TCG_TARGET_HAS_bswap64_i64 1 +#define TCG_TARGET_HAS_not_i64 1 +#define TCG_TARGET_HAS_andc_i64 1 +#define TCG_TARGET_HAS_orc_i64 1 +#define TCG_TARGET_HAS_eqv_i64 0 +#define TCG_TARGET_HAS_nand_i64 0 +#define TCG_TARGET_HAS_nor_i64 1 +#define TCG_TARGET_HAS_clz_i64 1 +#define TCG_TARGET_HAS_ctz_i64 1 +#define TCG_TARGET_HAS_ctpop_i64 0 +#define TCG_TARGET_HAS_add2_i64 0 +#define TCG_TARGET_HAS_sub2_i64 0 +#define TCG_TARGET_HAS_mulu2_i64 0 +#define TCG_TARGET_HAS_muls2_i64 0 +#define TCG_TARGET_HAS_muluh_i64 1 +#define TCG_TARGET_HAS_mulsh_i64 1 + +#define TCG_TARGET_HAS_qemu_ldst_i128 (cpuinfo & CPUINFO_LSX) + +#define TCG_TARGET_HAS_tst 0 + +#define TCG_TARGET_HAS_v64 (cpuinfo & CPUINFO_LSX) +#define TCG_TARGET_HAS_v128 (cpuinfo & CPUINFO_LSX) +#define TCG_TARGET_HAS_v256 (cpuinfo & CPUINFO_LASX) + +#define TCG_TARGET_HAS_not_vec 1 +#define TCG_TARGET_HAS_neg_vec 1 +#define TCG_TARGET_HAS_abs_vec 0 +#define TCG_TARGET_HAS_andc_vec 1 +#define TCG_TARGET_HAS_orc_vec 1 +#define TCG_TARGET_HAS_nand_vec 0 +#define TCG_TARGET_HAS_nor_vec 1 +#define TCG_TARGET_HAS_eqv_vec 0 +#define TCG_TARGET_HAS_mul_vec 1 +#define TCG_TARGET_HAS_shi_vec 1 +#define TCG_TARGET_HAS_shs_vec 0 +#define TCG_TARGET_HAS_shv_vec 1 +#define TCG_TARGET_HAS_roti_vec 1 +#define TCG_TARGET_HAS_rots_vec 0 +#define TCG_TARGET_HAS_rotv_vec 1 +#define TCG_TARGET_HAS_sat_vec 1 +#define TCG_TARGET_HAS_minmax_vec 1 +#define TCG_TARGET_HAS_bitsel_vec 1 +#define TCG_TARGET_HAS_cmpsel_vec 0 +#define TCG_TARGET_HAS_tst_vec 0 + + +#endif diff --git a/tcg/loongarch64/tcg-target.h b/tcg/loongarch64/tcg-target.h index 3bc9aafaf24..a3a6130720b 100644 --- a/tcg/loongarch64/tcg-target.h +++ b/tcg/loongarch64/tcg-target.h @@ -29,8 +29,6 @@ #ifndef LOONGARCH_TCG_TARGET_H #define LOONGARCH_TCG_TARGET_H -#include "host/cpuinfo.h" - #define TCG_TARGET_INSN_UNIT_SIZE 4 #define TCG_TARGET_NB_REGS 64 @@ -87,105 +85,7 @@ typedef enum { TCG_VEC_TMP0 = TCG_REG_V23, } TCGReg; -/* optional instructions */ -#define TCG_TARGET_HAS_negsetcond_i32 0 -#define TCG_TARGET_HAS_div_i32 1 -#define TCG_TARGET_HAS_rem_i32 1 -#define TCG_TARGET_HAS_div2_i32 0 -#define TCG_TARGET_HAS_rot_i32 1 -#define TCG_TARGET_HAS_deposit_i32 1 -#define TCG_TARGET_HAS_extract_i32 1 -#define TCG_TARGET_HAS_sextract_i32 0 -#define TCG_TARGET_HAS_extract2_i32 0 -#define TCG_TARGET_HAS_add2_i32 0 -#define TCG_TARGET_HAS_sub2_i32 0 -#define TCG_TARGET_HAS_mulu2_i32 0 -#define TCG_TARGET_HAS_muls2_i32 0 -#define TCG_TARGET_HAS_muluh_i32 1 -#define TCG_TARGET_HAS_mulsh_i32 1 -#define TCG_TARGET_HAS_ext8s_i32 1 -#define TCG_TARGET_HAS_ext16s_i32 1 -#define TCG_TARGET_HAS_ext8u_i32 1 -#define TCG_TARGET_HAS_ext16u_i32 1 -#define TCG_TARGET_HAS_bswap16_i32 1 -#define TCG_TARGET_HAS_bswap32_i32 1 -#define TCG_TARGET_HAS_not_i32 1 -#define TCG_TARGET_HAS_andc_i32 1 -#define TCG_TARGET_HAS_orc_i32 1 -#define TCG_TARGET_HAS_eqv_i32 0 -#define TCG_TARGET_HAS_nand_i32 0 -#define TCG_TARGET_HAS_nor_i32 1 -#define TCG_TARGET_HAS_clz_i32 1 -#define TCG_TARGET_HAS_ctz_i32 1 -#define TCG_TARGET_HAS_ctpop_i32 0 -#define TCG_TARGET_HAS_brcond2 0 -#define TCG_TARGET_HAS_setcond2 0 -#define TCG_TARGET_HAS_qemu_st8_i32 0 - -/* 64-bit operations */ -#define TCG_TARGET_HAS_negsetcond_i64 0 -#define TCG_TARGET_HAS_div_i64 1 -#define TCG_TARGET_HAS_rem_i64 1 -#define TCG_TARGET_HAS_div2_i64 0 -#define TCG_TARGET_HAS_rot_i64 1 -#define TCG_TARGET_HAS_deposit_i64 1 -#define TCG_TARGET_HAS_extract_i64 1 -#define TCG_TARGET_HAS_sextract_i64 0 -#define TCG_TARGET_HAS_extract2_i64 0 -#define TCG_TARGET_HAS_extr_i64_i32 1 -#define TCG_TARGET_HAS_ext8s_i64 1 -#define TCG_TARGET_HAS_ext16s_i64 1 -#define TCG_TARGET_HAS_ext32s_i64 1 -#define TCG_TARGET_HAS_ext8u_i64 1 -#define TCG_TARGET_HAS_ext16u_i64 1 -#define TCG_TARGET_HAS_ext32u_i64 1 -#define TCG_TARGET_HAS_bswap16_i64 1 -#define TCG_TARGET_HAS_bswap32_i64 1 -#define TCG_TARGET_HAS_bswap64_i64 1 -#define TCG_TARGET_HAS_not_i64 1 -#define TCG_TARGET_HAS_andc_i64 1 -#define TCG_TARGET_HAS_orc_i64 1 -#define TCG_TARGET_HAS_eqv_i64 0 -#define TCG_TARGET_HAS_nand_i64 0 -#define TCG_TARGET_HAS_nor_i64 1 -#define TCG_TARGET_HAS_clz_i64 1 -#define TCG_TARGET_HAS_ctz_i64 1 -#define TCG_TARGET_HAS_ctpop_i64 0 -#define TCG_TARGET_HAS_add2_i64 0 -#define TCG_TARGET_HAS_sub2_i64 0 -#define TCG_TARGET_HAS_mulu2_i64 0 -#define TCG_TARGET_HAS_muls2_i64 0 -#define TCG_TARGET_HAS_muluh_i64 1 -#define TCG_TARGET_HAS_mulsh_i64 1 - -#define TCG_TARGET_HAS_qemu_ldst_i128 (cpuinfo & CPUINFO_LSX) - -#define TCG_TARGET_HAS_tst 0 - -#define TCG_TARGET_HAS_v64 (cpuinfo & CPUINFO_LSX) -#define TCG_TARGET_HAS_v128 (cpuinfo & CPUINFO_LSX) -#define TCG_TARGET_HAS_v256 (cpuinfo & CPUINFO_LASX) - -#define TCG_TARGET_HAS_not_vec 1 -#define TCG_TARGET_HAS_neg_vec 1 -#define TCG_TARGET_HAS_abs_vec 0 -#define TCG_TARGET_HAS_andc_vec 1 -#define TCG_TARGET_HAS_orc_vec 1 -#define TCG_TARGET_HAS_nand_vec 0 -#define TCG_TARGET_HAS_nor_vec 1 -#define TCG_TARGET_HAS_eqv_vec 0 -#define TCG_TARGET_HAS_mul_vec 1 -#define TCG_TARGET_HAS_shi_vec 1 -#define TCG_TARGET_HAS_shs_vec 0 -#define TCG_TARGET_HAS_shv_vec 1 -#define TCG_TARGET_HAS_roti_vec 1 -#define TCG_TARGET_HAS_rots_vec 0 -#define TCG_TARGET_HAS_rotv_vec 1 -#define TCG_TARGET_HAS_sat_vec 1 -#define TCG_TARGET_HAS_minmax_vec 1 -#define TCG_TARGET_HAS_bitsel_vec 1 -#define TCG_TARGET_HAS_cmpsel_vec 0 -#define TCG_TARGET_HAS_tst_vec 0 +#include "tcg-target-has.h" #define TCG_TARGET_DEFAULT_MO (0) From patchwork Wed Jan 8 21:51:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 855724 Delivered-To: patch@linaro.org Received: by 2002:adf:8b05:0:b0:385:e875:8a9e with SMTP id n5csp942886wra; Wed, 8 Jan 2025 13:53:30 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXm8pNeCmceAed4D69KKOtC2oWVyvkzZBvp9ARaTOQunG7PoIBZyugECiZ3n0pYNdIx6N95jQ==@linaro.org X-Google-Smtp-Source: AGHT+IEWBEjyNX+Oj4+qbv9ZpUlhsl68Q7vUpU7mFDpn+Lm5t0yLPokA+IuYrjEmIwhKr4z1e2kO X-Received: by 2002:a05:6214:dc4:b0:6d8:acde:8a98 with SMTP id 6a1803df08f44-6dfa3a56ad6mr13875166d6.14.1736373209801; Wed, 08 Jan 2025 13:53:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736373209; cv=none; d=google.com; s=arc-20240605; b=UbQXTvb0AtWNlg/gT7HzVXapP8a94kAsW42K1S4PGmM4g+bkJZ9vqvxaLfrWhCoxsU bYFLKpYkbryEkS7Q7KR5UkyxBIbkJpEaxtV0IQsNp9EykROsgy8bc5hx7ssgiVrz4Ifu mKwpLmQ4KmiHoMNSGkPRRhV8QkQXwwf6eTjjwUumpgWsYv0RH24diJJDVYQpZbKRlSLV 08jdWbxdP5t/WFp8D97QTHYoniGF66XXst34dLNDF9QPM9jtd9GRiaz3JSYwracnX18S VTsfhGwzzxALtgnh2YAvoBE7t6PtnAark+5E2oLi8nLBRHfwVldDqsfpXk6tw81lLCM6 poCA== 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=mhNLLMwi6Cebqx2oq1pwIo7rhsmfrdmF/Yz25JdLB8o=; fh=I/t+CGVRTvnlN+c1H2rL+bfx7DSzSdCxz00w+BTRVdo=; b=Urtzmg8WI1cs+MsAWid1gVccXT+oa4mgklWdFCsghTQWDkGArBcRVq8yZuG1wJRbur yUwkGfo8GSxGJaEXEypdeZvzxgsRVong6EGHoxja/ea+otfIgXwCAGUBGC0hx9U4FaU4 AX3fzF6OBQqtCndNO5lAzpWO/WKGItpxT6htAv4LND4Ml2YInU0A1fiX57b/MXY92Puc Vwu2zQTpN8YUd9a45V3YDYPjrOZ/QJCAFg2M3JUNKZ44iMLPSMjmdZmlG3NskoNMCTWO XAPuMr6c9PPo6AOZ/sx3QFFkZMVNDox6sLomIJc38wxg+ydb1O1tvBVUGySKhOSDvYTU LHEA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zts8OzFi; 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 6a1803df08f44-6dd18250810si487223056d6.361.2025.01.08.13.53.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 Jan 2025 13:53:29 -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=zts8OzFi; 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 1tVdyk-0000OX-FU; Wed, 08 Jan 2025 16:52:42 -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 1tVdyi-0000Hw-Mh for qemu-devel@nongnu.org; Wed, 08 Jan 2025 16:52:40 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tVdyf-000434-Ej for qemu-devel@nongnu.org; Wed, 08 Jan 2025 16:52:40 -0500 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-388cae9eb9fso135505f8f.3 for ; Wed, 08 Jan 2025 13:52:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736373151; x=1736977951; 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=mhNLLMwi6Cebqx2oq1pwIo7rhsmfrdmF/Yz25JdLB8o=; b=zts8OzFi00nFa53uIDgsvvlG5IWrD9ke3rCviJ7N6Vw+pCZk40qjvlKCZajTR5EXB/ dBG99tWudFFNEWnIY0fbHzcRwAjbfEPCZ09fjepnyVQmrq4Z9DeyyNHmJ1m8DxVFSbww Qo9OrlKxvhwBIwmuRr/Nhm0GNswM5F0m5ZFLihkMSxiU9SdxIpwN8dt14D2kshht3ywP bPZo+achqYMzwsmFCnWbznXu3H80bbYrSlKxNatrYzmMqhKk+O90d0tlhFsJPJg1us/v vRcPRJYc69rqeB6gXY8yZXUmnCmy++GKW0CzhYduqThZE3ESi5kOGt/IO0uyXDOaVRG3 uciQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736373151; x=1736977951; 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=mhNLLMwi6Cebqx2oq1pwIo7rhsmfrdmF/Yz25JdLB8o=; b=p0sLtumWN9k1XkwrIHeYusF0T7xpX4/PTr65nQ2Rcq+9f7hRM6tgBG9AqMlnQy74JR Owrw8uk32iRhiqvDrYbaf7yCICz3jZkTwcU4dEZDL7bAu/DNAmPkuNHT/s9TDivtrZ3F 08nEhui5u2knmVgAz3Ms57ywN354ocUBmzbq8SQ5eOBQv6yiDHQoiiwW5YCganOWv4m3 fXMnCvQl4vlVqeRc9iOPm8chXOFCZ34euyxsbbels9fZt+stWByywIV6L0L7JnvbD3pG UpAh1oOxztSxaGKyrycITahMC845ouhaZmE6QE2LgkozWOWnTpeOAELeZftG3flpx4XF YJtw== X-Gm-Message-State: AOJu0Yz5c1XRVv7+uDLfJ7pZ8PqXCU3ddnwP8C9P6a/90QkEnmnEc6He b62y/x0Bkvl9J1W9AkC2QP5eG7ZTb/3SyJ2w5ARM2vtOqmIVtz9yYZcsAhNRMn5mpZt28qgpVzd 8ies= X-Gm-Gg: ASbGncvTPXYbgZw3oZKzOakfw/V0WQHFnXLv+SboVZAHCOagW+5SO19BvMonwl0BS82 i1aH6JyaUlN7w1dFMqYX+yJtHRZx4/6FJ6nWM53WffgEn5YZ1uo+faZcUtCU53uYmA+PzdOW0N4 h16RTbJn6xnoNChVtsPBqSezQaObTV1xUGZmtEtIgDWhdwwcxoMZmg1W3JIpjOpX7nS3AUtQXim 9I0Ahh5dHdN+iWEs0pDVwjueLMfNJhNhwaASvI1gDWEdHXVgPlcNJsFHQRNVmloOSkfOCmPp/VG QKiHycQFYa1OrZLGXSvyvRvNCgDhDLk= X-Received: by 2002:a05:6000:4012:b0:388:e2a7:74c8 with SMTP id ffacd0b85a97d-38a87308b75mr3411442f8f.44.1736373151448; Wed, 08 Jan 2025 13:52:31 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e2da6336sm33756405e9.8.2025.01.08.13.52.29 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 08 Jan 2025 13:52:30 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: pierrick.bouvier@linaro.org, Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH v3 07/14] tcg/mips: Extract TCG_TARGET_HAS_foo defs to 'tcg-target-has.h' Date: Wed, 8 Jan 2025 22:51:48 +0100 Message-ID: <20250108215156.8731-8-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250108215156.8731-1-philmd@linaro.org> References: <20250107080112.1175095-19-richard.henderson@linaro.org> <20250108215156.8731-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.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 From: Richard Henderson Signed-off-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- tcg/mips/tcg-target-has.h | 122 ++++++++++++++++++++++++++++++++++++++ tcg/mips/tcg-target.h | 112 +--------------------------------- 2 files changed, 123 insertions(+), 111 deletions(-) create mode 100644 tcg/mips/tcg-target-has.h diff --git a/tcg/mips/tcg-target-has.h b/tcg/mips/tcg-target-has.h new file mode 100644 index 00000000000..5dbc63cef6d --- /dev/null +++ b/tcg/mips/tcg-target-has.h @@ -0,0 +1,122 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Define target-specific opcode support + * Copyright (c) 2008-2009 Arnaud Patard + * Copyright (c) 2009 Aurelien Jarno + */ + +#ifndef TCG_TARGET_HAS_H +#define TCG_TARGET_HAS_H + +/* MOVN/MOVZ instructions detection */ +#if (defined(__mips_isa_rev) && (__mips_isa_rev >= 1)) || \ + defined(_MIPS_ARCH_LOONGSON2E) || defined(_MIPS_ARCH_LOONGSON2F) || \ + defined(_MIPS_ARCH_MIPS4) +#define use_movnz_instructions 1 +#else +extern bool use_movnz_instructions; +#endif + +/* MIPS32 instruction set detection */ +#if defined(__mips_isa_rev) && (__mips_isa_rev >= 1) +#define use_mips32_instructions 1 +#else +extern bool use_mips32_instructions; +#endif + +/* MIPS32R2 instruction set detection */ +#if defined(__mips_isa_rev) && (__mips_isa_rev >= 2) +#define use_mips32r2_instructions 1 +#else +extern bool use_mips32r2_instructions; +#endif + +/* MIPS32R6 instruction set detection */ +#if defined(__mips_isa_rev) && (__mips_isa_rev >= 6) +#define use_mips32r6_instructions 1 +#else +#define use_mips32r6_instructions 0 +#endif + +/* optional instructions */ +#define TCG_TARGET_HAS_div_i32 1 +#define TCG_TARGET_HAS_rem_i32 1 +#define TCG_TARGET_HAS_not_i32 1 +#define TCG_TARGET_HAS_nor_i32 1 +#define TCG_TARGET_HAS_andc_i32 0 +#define TCG_TARGET_HAS_orc_i32 0 +#define TCG_TARGET_HAS_eqv_i32 0 +#define TCG_TARGET_HAS_nand_i32 0 +#define TCG_TARGET_HAS_mulu2_i32 (!use_mips32r6_instructions) +#define TCG_TARGET_HAS_muls2_i32 (!use_mips32r6_instructions) +#define TCG_TARGET_HAS_muluh_i32 1 +#define TCG_TARGET_HAS_mulsh_i32 1 +#define TCG_TARGET_HAS_bswap32_i32 1 +#define TCG_TARGET_HAS_negsetcond_i32 0 + +#if TCG_TARGET_REG_BITS == 64 +#define TCG_TARGET_HAS_add2_i32 0 +#define TCG_TARGET_HAS_sub2_i32 0 +#define TCG_TARGET_HAS_extr_i64_i32 1 +#define TCG_TARGET_HAS_div_i64 1 +#define TCG_TARGET_HAS_rem_i64 1 +#define TCG_TARGET_HAS_not_i64 1 +#define TCG_TARGET_HAS_nor_i64 1 +#define TCG_TARGET_HAS_andc_i64 0 +#define TCG_TARGET_HAS_orc_i64 0 +#define TCG_TARGET_HAS_eqv_i64 0 +#define TCG_TARGET_HAS_nand_i64 0 +#define TCG_TARGET_HAS_add2_i64 0 +#define TCG_TARGET_HAS_sub2_i64 0 +#define TCG_TARGET_HAS_mulu2_i64 (!use_mips32r6_instructions) +#define TCG_TARGET_HAS_muls2_i64 (!use_mips32r6_instructions) +#define TCG_TARGET_HAS_muluh_i64 1 +#define TCG_TARGET_HAS_mulsh_i64 1 +#define TCG_TARGET_HAS_ext32s_i64 1 +#define TCG_TARGET_HAS_ext32u_i64 1 +#define TCG_TARGET_HAS_negsetcond_i64 0 +#endif + +/* optional instructions detected at runtime */ +#define TCG_TARGET_HAS_bswap16_i32 use_mips32r2_instructions +#define TCG_TARGET_HAS_deposit_i32 use_mips32r2_instructions +#define TCG_TARGET_HAS_extract_i32 use_mips32r2_instructions +#define TCG_TARGET_HAS_sextract_i32 0 +#define TCG_TARGET_HAS_extract2_i32 0 +#define TCG_TARGET_HAS_ext8s_i32 use_mips32r2_instructions +#define TCG_TARGET_HAS_ext16s_i32 use_mips32r2_instructions +#define TCG_TARGET_HAS_rot_i32 use_mips32r2_instructions +#define TCG_TARGET_HAS_clz_i32 use_mips32r2_instructions +#define TCG_TARGET_HAS_ctz_i32 0 +#define TCG_TARGET_HAS_ctpop_i32 0 +#define TCG_TARGET_HAS_qemu_st8_i32 0 + +#if TCG_TARGET_REG_BITS == 64 +#define TCG_TARGET_HAS_bswap16_i64 use_mips32r2_instructions +#define TCG_TARGET_HAS_bswap32_i64 use_mips32r2_instructions +#define TCG_TARGET_HAS_bswap64_i64 use_mips32r2_instructions +#define TCG_TARGET_HAS_deposit_i64 use_mips32r2_instructions +#define TCG_TARGET_HAS_extract_i64 use_mips32r2_instructions +#define TCG_TARGET_HAS_sextract_i64 0 +#define TCG_TARGET_HAS_extract2_i64 0 +#define TCG_TARGET_HAS_ext8s_i64 use_mips32r2_instructions +#define TCG_TARGET_HAS_ext16s_i64 use_mips32r2_instructions +#define TCG_TARGET_HAS_rot_i64 use_mips32r2_instructions +#define TCG_TARGET_HAS_clz_i64 use_mips32r2_instructions +#define TCG_TARGET_HAS_ctz_i64 0 +#define TCG_TARGET_HAS_ctpop_i64 0 +#endif + +/* optional instructions automatically implemented */ +#define TCG_TARGET_HAS_ext8u_i32 0 /* andi rt, rs, 0xff */ +#define TCG_TARGET_HAS_ext16u_i32 0 /* andi rt, rs, 0xffff */ + +#if TCG_TARGET_REG_BITS == 64 +#define TCG_TARGET_HAS_ext8u_i64 0 /* andi rt, rs, 0xff */ +#define TCG_TARGET_HAS_ext16u_i64 0 /* andi rt, rs, 0xffff */ +#endif + +#define TCG_TARGET_HAS_qemu_ldst_i128 0 +#define TCG_TARGET_HAS_tst 0 + +#endif diff --git a/tcg/mips/tcg-target.h b/tcg/mips/tcg-target.h index db60eb7c1b7..a34765b3894 100644 --- a/tcg/mips/tcg-target.h +++ b/tcg/mips/tcg-target.h @@ -70,117 +70,7 @@ typedef enum { TCG_AREG0 = TCG_REG_S8, } TCGReg; -/* MOVN/MOVZ instructions detection */ -#if (defined(__mips_isa_rev) && (__mips_isa_rev >= 1)) || \ - defined(_MIPS_ARCH_LOONGSON2E) || defined(_MIPS_ARCH_LOONGSON2F) || \ - defined(_MIPS_ARCH_MIPS4) -#define use_movnz_instructions 1 -#else -extern bool use_movnz_instructions; -#endif - -/* MIPS32 instruction set detection */ -#if defined(__mips_isa_rev) && (__mips_isa_rev >= 1) -#define use_mips32_instructions 1 -#else -extern bool use_mips32_instructions; -#endif - -/* MIPS32R2 instruction set detection */ -#if defined(__mips_isa_rev) && (__mips_isa_rev >= 2) -#define use_mips32r2_instructions 1 -#else -extern bool use_mips32r2_instructions; -#endif - -/* MIPS32R6 instruction set detection */ -#if defined(__mips_isa_rev) && (__mips_isa_rev >= 6) -#define use_mips32r6_instructions 1 -#else -#define use_mips32r6_instructions 0 -#endif - -/* optional instructions */ -#define TCG_TARGET_HAS_div_i32 1 -#define TCG_TARGET_HAS_rem_i32 1 -#define TCG_TARGET_HAS_not_i32 1 -#define TCG_TARGET_HAS_nor_i32 1 -#define TCG_TARGET_HAS_andc_i32 0 -#define TCG_TARGET_HAS_orc_i32 0 -#define TCG_TARGET_HAS_eqv_i32 0 -#define TCG_TARGET_HAS_nand_i32 0 -#define TCG_TARGET_HAS_mulu2_i32 (!use_mips32r6_instructions) -#define TCG_TARGET_HAS_muls2_i32 (!use_mips32r6_instructions) -#define TCG_TARGET_HAS_muluh_i32 1 -#define TCG_TARGET_HAS_mulsh_i32 1 -#define TCG_TARGET_HAS_bswap32_i32 1 -#define TCG_TARGET_HAS_negsetcond_i32 0 - -#if TCG_TARGET_REG_BITS == 64 -#define TCG_TARGET_HAS_add2_i32 0 -#define TCG_TARGET_HAS_sub2_i32 0 -#define TCG_TARGET_HAS_extr_i64_i32 1 -#define TCG_TARGET_HAS_div_i64 1 -#define TCG_TARGET_HAS_rem_i64 1 -#define TCG_TARGET_HAS_not_i64 1 -#define TCG_TARGET_HAS_nor_i64 1 -#define TCG_TARGET_HAS_andc_i64 0 -#define TCG_TARGET_HAS_orc_i64 0 -#define TCG_TARGET_HAS_eqv_i64 0 -#define TCG_TARGET_HAS_nand_i64 0 -#define TCG_TARGET_HAS_add2_i64 0 -#define TCG_TARGET_HAS_sub2_i64 0 -#define TCG_TARGET_HAS_mulu2_i64 (!use_mips32r6_instructions) -#define TCG_TARGET_HAS_muls2_i64 (!use_mips32r6_instructions) -#define TCG_TARGET_HAS_muluh_i64 1 -#define TCG_TARGET_HAS_mulsh_i64 1 -#define TCG_TARGET_HAS_ext32s_i64 1 -#define TCG_TARGET_HAS_ext32u_i64 1 -#define TCG_TARGET_HAS_negsetcond_i64 0 -#endif - -/* optional instructions detected at runtime */ -#define TCG_TARGET_HAS_bswap16_i32 use_mips32r2_instructions -#define TCG_TARGET_HAS_deposit_i32 use_mips32r2_instructions -#define TCG_TARGET_HAS_extract_i32 use_mips32r2_instructions -#define TCG_TARGET_HAS_sextract_i32 0 -#define TCG_TARGET_HAS_extract2_i32 0 -#define TCG_TARGET_HAS_ext8s_i32 use_mips32r2_instructions -#define TCG_TARGET_HAS_ext16s_i32 use_mips32r2_instructions -#define TCG_TARGET_HAS_rot_i32 use_mips32r2_instructions -#define TCG_TARGET_HAS_clz_i32 use_mips32r2_instructions -#define TCG_TARGET_HAS_ctz_i32 0 -#define TCG_TARGET_HAS_ctpop_i32 0 -#define TCG_TARGET_HAS_qemu_st8_i32 0 - -#if TCG_TARGET_REG_BITS == 64 -#define TCG_TARGET_HAS_bswap16_i64 use_mips32r2_instructions -#define TCG_TARGET_HAS_bswap32_i64 use_mips32r2_instructions -#define TCG_TARGET_HAS_bswap64_i64 use_mips32r2_instructions -#define TCG_TARGET_HAS_deposit_i64 use_mips32r2_instructions -#define TCG_TARGET_HAS_extract_i64 use_mips32r2_instructions -#define TCG_TARGET_HAS_sextract_i64 0 -#define TCG_TARGET_HAS_extract2_i64 0 -#define TCG_TARGET_HAS_ext8s_i64 use_mips32r2_instructions -#define TCG_TARGET_HAS_ext16s_i64 use_mips32r2_instructions -#define TCG_TARGET_HAS_rot_i64 use_mips32r2_instructions -#define TCG_TARGET_HAS_clz_i64 use_mips32r2_instructions -#define TCG_TARGET_HAS_ctz_i64 0 -#define TCG_TARGET_HAS_ctpop_i64 0 -#endif - -/* optional instructions automatically implemented */ -#define TCG_TARGET_HAS_ext8u_i32 0 /* andi rt, rs, 0xff */ -#define TCG_TARGET_HAS_ext16u_i32 0 /* andi rt, rs, 0xffff */ - -#if TCG_TARGET_REG_BITS == 64 -#define TCG_TARGET_HAS_ext8u_i64 0 /* andi rt, rs, 0xff */ -#define TCG_TARGET_HAS_ext16u_i64 0 /* andi rt, rs, 0xffff */ -#endif - -#define TCG_TARGET_HAS_qemu_ldst_i128 0 - -#define TCG_TARGET_HAS_tst 0 +#include "tcg-target-has.h" #define TCG_TARGET_DEFAULT_MO 0 From patchwork Wed Jan 8 21:51:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 855726 Delivered-To: patch@linaro.org Received: by 2002:adf:8b05:0:b0:385:e875:8a9e with SMTP id n5csp942909wra; Wed, 8 Jan 2025 13:53:40 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVAZJ3CFwQCOi9mtRK/Djf8568PYtlM0pIE9QXQeE9l4di8BLDQ0hFzQAL9VPPIFbHhad57nQ==@linaro.org X-Google-Smtp-Source: AGHT+IFRGGrL00c1tkosC3k1NHR4/mrEZOnLR4oUwvCLU8sdGhSV+q4sU/zKh8u1AlE2NeCiNMhS X-Received: by 2002:a05:622a:50a:b0:467:84df:92ee with SMTP id d75a77b69052e-46c7108c087mr64155921cf.40.1736373220478; Wed, 08 Jan 2025 13:53:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736373220; cv=none; d=google.com; s=arc-20240605; b=hKWerM2REzjx3dNyzQLtFmf2dSs9NNYxzUrNECKaD2F4OL0e0yIvzK4EzxFaC6cyqi bqwHFiNrNNbM369BNNDcax+u2TcslTxxufCRpgCrkCVSqjfCnFTcJESItxCA38mGac20 a1WXQEdY3ooIyxeZ/3xcaJ/pIXHBe/tCWifzkl363eXSTPUsIDY3lbB4DfM/qJnXNeRV weGpekRPvtLYXMUPYQWcli+TqLFVmQ8KGyJCuiZqFhrdT7qjJE7AaWW39CmUg8tF/dQi txHblJY8jVqlSO7QywkH09oGo217Sgdabv7egJLSHxXYWIW8IqW/yM2EmVydOAq4pXnr /SEg== 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=WsIbd2lcGoALdXZR+OvweRzuxqGd5A616jGuDBmreAo=; fh=I/t+CGVRTvnlN+c1H2rL+bfx7DSzSdCxz00w+BTRVdo=; b=WDSbT5mJ4Wezf1Php9HFHFcVddmSd+atkanQiIfcOKdWQI/Diio6DRSfLTw8kd5HUu r4TdxkNjZczGDjsQZzFOI39uDx64ie/QTi1yqnMFCwLPgKRiv9Rqb3TSopqqxjp25Uxh GdbLMedj5eUBY4yBlzcwvO7tR/q/Cq9doF+c0BR1pN88MMcFm9+mqk1rq/QyJmoQJ7/l JTSR/bT/Lhn6mzLQPLwLAUAMQLlIkwQcUesKkId8F5WIX2Tqy3+w7oRJN5Ff6nrS4aHU pE+DCAFYGOwVusNz/TLH3ugts8vWICs6U7VFT10BewjsTIe5FeZ8qCXwBdoMMaRUHY6G yOzg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=n9vaTzfD; 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-46a3ebc546bsi500967401cf.408.2025.01.08.13.53.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 Jan 2025 13:53:40 -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=n9vaTzfD; 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 1tVdyn-0000eJ-In; Wed, 08 Jan 2025 16:52:45 -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 1tVdyj-0000J0-Hv for qemu-devel@nongnu.org; Wed, 08 Jan 2025 16:52:41 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tVdyg-00043D-Rx for qemu-devel@nongnu.org; Wed, 08 Jan 2025 16:52:41 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-436249df846so2310315e9.3 for ; Wed, 08 Jan 2025 13:52:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736373156; x=1736977956; 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=WsIbd2lcGoALdXZR+OvweRzuxqGd5A616jGuDBmreAo=; b=n9vaTzfDzo3msJegoW7vZyzEEywLiRKOKDf76yMnicrEFXuc4GFkYUFp/KV1/oEV/G iM+xMUdg7/GYDcv8g2DiOhUOPMhrHgsEtMhiKyfTdPdYiFNppJqWNlfl2FnBjN69vuf+ uAFvPpQYxYv20ogSyd+d43J7otjZD+BghWTDc310smergiCxomhL8O1d6HjYP/2sEdnU pDQdIQMY9NNkSNwZtSs9esmviig9R60Ce9k0V1TOVWw/OS6PHFWTI2K07EHHtGWr3vkK O8KTB3zrDpeUy0R6eAiI9+/LDi/DyPEi3OQhZwaxbk1amgZHc2esDylYje3OMDcujoSR 43ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736373156; x=1736977956; 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=WsIbd2lcGoALdXZR+OvweRzuxqGd5A616jGuDBmreAo=; b=IzwGRzDutbDpS2buag/Bk34ivECdcs0CKFkJnYCSYIUubW8C/ltlZbuPOsM3ZLm7pP FrIDg70TQPvld8Z5rufqBgTCxaiLeubZt9zRsj5dy7+8Xd3o+5IRlgwuVeRrA+o2mmGe QFv9c/tMUwdanGGnQxnmcVTUm0M/x74HYSQLGuvCMRAlo7DV8QCeAKjqcExiERJ+Epk9 V6CIoDJHhTs4W5A47GnqtVQ2us3DWnjjj8q468J5X3F42xnqHhhWFfSmaWChGCXnhFEf qsX0SR3+uSLvLZvnoGJKSw8Qmg+/k26MUzafWaEVNbCv2LN+wW7feneBYgoRRn8MlVX9 I8IA== X-Gm-Message-State: AOJu0YwfvG4LWgy7mIYBwHEYfvCbNEnyptAgD6RtIdqa0c1V8ekMuPPg tDicEQLUhhaTIOogrdpH1lGP3RujJbFv5WQNugQyGrWP2RqjVRZxrMrxMPLjNM9RwRu8GE/nfj9 wWmc= X-Gm-Gg: ASbGnctmSTzAgxG3LU7lEaiQzpVjBLmPyD4FzFlkq8sn6qTX1egD2DrzjhBB6op4GX8 vVgaOZkvI8fEur/fuWy9O0LFgH6ebA4lqpQnWmuH/27EJK4I7YNMYMHQ/MjL+O0+gkJd6FY39TJ 2EM/Wb7t5aZh3hpngjyanrsqBkEOKjjwhxcIRTw49J0hVQxHZCG32/t8k3jbOEwTYhAznk6cQlu HXszih69bkWzHrPLDUyqN98kt8IiEa18f5TxvtnU02SHoR9BzAhLE7mY0T+BUDPnNCbMCb60jP/ 471b5hAV/R78lJD9JpB4DJmmymlJ/bA= X-Received: by 2002:a5d:598b:0:b0:385:ee40:2d75 with SMTP id ffacd0b85a97d-38a872da8b6mr3339093f8f.20.1736373156085; Wed, 08 Jan 2025 13:52:36 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e2da65a3sm34280505e9.7.2025.01.08.13.52.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 08 Jan 2025 13:52:35 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: pierrick.bouvier@linaro.org, Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH v3 08/14] tcg/ppc: Extract TCG_TARGET_HAS_foo defs to 'tcg-target-has.h' Date: Wed, 8 Jan 2025 22:51:49 +0100 Message-ID: <20250108215156.8731-9-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250108215156.8731-1-philmd@linaro.org> References: <20250107080112.1175095-19-richard.henderson@linaro.org> <20250108215156.8731-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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 From: Richard Henderson Signed-off-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- tcg/ppc/tcg-target-has.h | 124 +++++++++++++++++++++++++++++++++++++++ tcg/ppc/tcg-target.h | 114 +---------------------------------- 2 files changed, 125 insertions(+), 113 deletions(-) create mode 100644 tcg/ppc/tcg-target-has.h diff --git a/tcg/ppc/tcg-target-has.h b/tcg/ppc/tcg-target-has.h new file mode 100644 index 00000000000..a6c7cdba5d5 --- /dev/null +++ b/tcg/ppc/tcg-target-has.h @@ -0,0 +1,124 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Define target-specific opcode support + * Copyright (c) 2008 Fabrice Bellard + */ + +#ifndef TCG_TARGET_HAS_H +#define TCG_TARGET_HAS_H + +#include "host/cpuinfo.h" + +#define have_isa_2_06 (cpuinfo & CPUINFO_V2_06) +#define have_isa_2_07 (cpuinfo & CPUINFO_V2_07) +#define have_isa_3_00 (cpuinfo & CPUINFO_V3_0) +#define have_isa_3_10 (cpuinfo & CPUINFO_V3_1) +#define have_altivec (cpuinfo & CPUINFO_ALTIVEC) +#define have_vsx (cpuinfo & CPUINFO_VSX) + +/* optional instructions automatically implemented */ +#define TCG_TARGET_HAS_ext8u_i32 0 /* andi */ +#define TCG_TARGET_HAS_ext16u_i32 0 + +/* optional instructions */ +#define TCG_TARGET_HAS_div_i32 1 +#define TCG_TARGET_HAS_rem_i32 have_isa_3_00 +#define TCG_TARGET_HAS_rot_i32 1 +#define TCG_TARGET_HAS_ext8s_i32 1 +#define TCG_TARGET_HAS_ext16s_i32 1 +#define TCG_TARGET_HAS_bswap16_i32 1 +#define TCG_TARGET_HAS_bswap32_i32 1 +#define TCG_TARGET_HAS_not_i32 1 +#define TCG_TARGET_HAS_andc_i32 1 +#define TCG_TARGET_HAS_orc_i32 1 +#define TCG_TARGET_HAS_eqv_i32 1 +#define TCG_TARGET_HAS_nand_i32 1 +#define TCG_TARGET_HAS_nor_i32 1 +#define TCG_TARGET_HAS_clz_i32 1 +#define TCG_TARGET_HAS_ctz_i32 have_isa_3_00 +#define TCG_TARGET_HAS_ctpop_i32 have_isa_2_06 +#define TCG_TARGET_HAS_deposit_i32 1 +#define TCG_TARGET_HAS_extract_i32 1 +#define TCG_TARGET_HAS_sextract_i32 0 +#define TCG_TARGET_HAS_extract2_i32 0 +#define TCG_TARGET_HAS_negsetcond_i32 1 +#define TCG_TARGET_HAS_mulu2_i32 0 +#define TCG_TARGET_HAS_muls2_i32 0 +#define TCG_TARGET_HAS_muluh_i32 1 +#define TCG_TARGET_HAS_mulsh_i32 1 +#define TCG_TARGET_HAS_qemu_st8_i32 0 + +#if TCG_TARGET_REG_BITS == 64 +#define TCG_TARGET_HAS_add2_i32 0 +#define TCG_TARGET_HAS_sub2_i32 0 +#define TCG_TARGET_HAS_extr_i64_i32 0 +#define TCG_TARGET_HAS_div_i64 1 +#define TCG_TARGET_HAS_rem_i64 have_isa_3_00 +#define TCG_TARGET_HAS_rot_i64 1 +#define TCG_TARGET_HAS_ext8s_i64 1 +#define TCG_TARGET_HAS_ext16s_i64 1 +#define TCG_TARGET_HAS_ext32s_i64 1 +#define TCG_TARGET_HAS_ext8u_i64 0 +#define TCG_TARGET_HAS_ext16u_i64 0 +#define TCG_TARGET_HAS_ext32u_i64 0 +#define TCG_TARGET_HAS_bswap16_i64 1 +#define TCG_TARGET_HAS_bswap32_i64 1 +#define TCG_TARGET_HAS_bswap64_i64 1 +#define TCG_TARGET_HAS_not_i64 1 +#define TCG_TARGET_HAS_andc_i64 1 +#define TCG_TARGET_HAS_orc_i64 1 +#define TCG_TARGET_HAS_eqv_i64 1 +#define TCG_TARGET_HAS_nand_i64 1 +#define TCG_TARGET_HAS_nor_i64 1 +#define TCG_TARGET_HAS_clz_i64 1 +#define TCG_TARGET_HAS_ctz_i64 have_isa_3_00 +#define TCG_TARGET_HAS_ctpop_i64 have_isa_2_06 +#define TCG_TARGET_HAS_deposit_i64 1 +#define TCG_TARGET_HAS_extract_i64 1 +#define TCG_TARGET_HAS_sextract_i64 0 +#define TCG_TARGET_HAS_extract2_i64 0 +#define TCG_TARGET_HAS_negsetcond_i64 1 +#define TCG_TARGET_HAS_add2_i64 1 +#define TCG_TARGET_HAS_sub2_i64 1 +#define TCG_TARGET_HAS_mulu2_i64 0 +#define TCG_TARGET_HAS_muls2_i64 0 +#define TCG_TARGET_HAS_muluh_i64 1 +#define TCG_TARGET_HAS_mulsh_i64 1 +#endif + +#define TCG_TARGET_HAS_qemu_ldst_i128 \ + (TCG_TARGET_REG_BITS == 64 && have_isa_2_07) + +#define TCG_TARGET_HAS_tst 1 + +/* + * While technically Altivec could support V64, it has no 64-bit store + * instruction and substituting two 32-bit stores makes the generated + * code quite large. + */ +#define TCG_TARGET_HAS_v64 have_vsx +#define TCG_TARGET_HAS_v128 have_altivec +#define TCG_TARGET_HAS_v256 0 + +#define TCG_TARGET_HAS_andc_vec 1 +#define TCG_TARGET_HAS_orc_vec have_isa_2_07 +#define TCG_TARGET_HAS_nand_vec have_isa_2_07 +#define TCG_TARGET_HAS_nor_vec 1 +#define TCG_TARGET_HAS_eqv_vec have_isa_2_07 +#define TCG_TARGET_HAS_not_vec 1 +#define TCG_TARGET_HAS_neg_vec have_isa_3_00 +#define TCG_TARGET_HAS_abs_vec 0 +#define TCG_TARGET_HAS_roti_vec 0 +#define TCG_TARGET_HAS_rots_vec 0 +#define TCG_TARGET_HAS_rotv_vec 1 +#define TCG_TARGET_HAS_shi_vec 0 +#define TCG_TARGET_HAS_shs_vec 0 +#define TCG_TARGET_HAS_shv_vec 1 +#define TCG_TARGET_HAS_mul_vec 1 +#define TCG_TARGET_HAS_sat_vec 1 +#define TCG_TARGET_HAS_minmax_vec 1 +#define TCG_TARGET_HAS_bitsel_vec have_vsx +#define TCG_TARGET_HAS_cmpsel_vec 1 +#define TCG_TARGET_HAS_tst_vec 0 + +#endif diff --git a/tcg/ppc/tcg-target.h b/tcg/ppc/tcg-target.h index 4fa4a30de41..fa2cc281838 100644 --- a/tcg/ppc/tcg-target.h +++ b/tcg/ppc/tcg-target.h @@ -25,8 +25,6 @@ #ifndef PPC_TCG_TARGET_H #define PPC_TCG_TARGET_H -#include "host/cpuinfo.h" - #define MAX_CODE_GEN_BUFFER_SIZE ((size_t)-1) #define TCG_TARGET_NB_REGS 64 @@ -55,117 +53,7 @@ typedef enum { TCG_AREG0 = TCG_REG_R27 } TCGReg; -#define have_isa_2_06 (cpuinfo & CPUINFO_V2_06) -#define have_isa_2_07 (cpuinfo & CPUINFO_V2_07) -#define have_isa_3_00 (cpuinfo & CPUINFO_V3_0) -#define have_isa_3_10 (cpuinfo & CPUINFO_V3_1) -#define have_altivec (cpuinfo & CPUINFO_ALTIVEC) -#define have_vsx (cpuinfo & CPUINFO_VSX) - -/* optional instructions automatically implemented */ -#define TCG_TARGET_HAS_ext8u_i32 0 /* andi */ -#define TCG_TARGET_HAS_ext16u_i32 0 - -/* optional instructions */ -#define TCG_TARGET_HAS_div_i32 1 -#define TCG_TARGET_HAS_rem_i32 have_isa_3_00 -#define TCG_TARGET_HAS_rot_i32 1 -#define TCG_TARGET_HAS_ext8s_i32 1 -#define TCG_TARGET_HAS_ext16s_i32 1 -#define TCG_TARGET_HAS_bswap16_i32 1 -#define TCG_TARGET_HAS_bswap32_i32 1 -#define TCG_TARGET_HAS_not_i32 1 -#define TCG_TARGET_HAS_andc_i32 1 -#define TCG_TARGET_HAS_orc_i32 1 -#define TCG_TARGET_HAS_eqv_i32 1 -#define TCG_TARGET_HAS_nand_i32 1 -#define TCG_TARGET_HAS_nor_i32 1 -#define TCG_TARGET_HAS_clz_i32 1 -#define TCG_TARGET_HAS_ctz_i32 have_isa_3_00 -#define TCG_TARGET_HAS_ctpop_i32 have_isa_2_06 -#define TCG_TARGET_HAS_deposit_i32 1 -#define TCG_TARGET_HAS_extract_i32 1 -#define TCG_TARGET_HAS_sextract_i32 0 -#define TCG_TARGET_HAS_extract2_i32 0 -#define TCG_TARGET_HAS_negsetcond_i32 1 -#define TCG_TARGET_HAS_mulu2_i32 0 -#define TCG_TARGET_HAS_muls2_i32 0 -#define TCG_TARGET_HAS_muluh_i32 1 -#define TCG_TARGET_HAS_mulsh_i32 1 -#define TCG_TARGET_HAS_qemu_st8_i32 0 - -#if TCG_TARGET_REG_BITS == 64 -#define TCG_TARGET_HAS_add2_i32 0 -#define TCG_TARGET_HAS_sub2_i32 0 -#define TCG_TARGET_HAS_extr_i64_i32 0 -#define TCG_TARGET_HAS_div_i64 1 -#define TCG_TARGET_HAS_rem_i64 have_isa_3_00 -#define TCG_TARGET_HAS_rot_i64 1 -#define TCG_TARGET_HAS_ext8s_i64 1 -#define TCG_TARGET_HAS_ext16s_i64 1 -#define TCG_TARGET_HAS_ext32s_i64 1 -#define TCG_TARGET_HAS_ext8u_i64 0 -#define TCG_TARGET_HAS_ext16u_i64 0 -#define TCG_TARGET_HAS_ext32u_i64 0 -#define TCG_TARGET_HAS_bswap16_i64 1 -#define TCG_TARGET_HAS_bswap32_i64 1 -#define TCG_TARGET_HAS_bswap64_i64 1 -#define TCG_TARGET_HAS_not_i64 1 -#define TCG_TARGET_HAS_andc_i64 1 -#define TCG_TARGET_HAS_orc_i64 1 -#define TCG_TARGET_HAS_eqv_i64 1 -#define TCG_TARGET_HAS_nand_i64 1 -#define TCG_TARGET_HAS_nor_i64 1 -#define TCG_TARGET_HAS_clz_i64 1 -#define TCG_TARGET_HAS_ctz_i64 have_isa_3_00 -#define TCG_TARGET_HAS_ctpop_i64 have_isa_2_06 -#define TCG_TARGET_HAS_deposit_i64 1 -#define TCG_TARGET_HAS_extract_i64 1 -#define TCG_TARGET_HAS_sextract_i64 0 -#define TCG_TARGET_HAS_extract2_i64 0 -#define TCG_TARGET_HAS_negsetcond_i64 1 -#define TCG_TARGET_HAS_add2_i64 1 -#define TCG_TARGET_HAS_sub2_i64 1 -#define TCG_TARGET_HAS_mulu2_i64 0 -#define TCG_TARGET_HAS_muls2_i64 0 -#define TCG_TARGET_HAS_muluh_i64 1 -#define TCG_TARGET_HAS_mulsh_i64 1 -#endif - -#define TCG_TARGET_HAS_qemu_ldst_i128 \ - (TCG_TARGET_REG_BITS == 64 && have_isa_2_07) - -#define TCG_TARGET_HAS_tst 1 - -/* - * While technically Altivec could support V64, it has no 64-bit store - * instruction and substituting two 32-bit stores makes the generated - * code quite large. - */ -#define TCG_TARGET_HAS_v64 have_vsx -#define TCG_TARGET_HAS_v128 have_altivec -#define TCG_TARGET_HAS_v256 0 - -#define TCG_TARGET_HAS_andc_vec 1 -#define TCG_TARGET_HAS_orc_vec have_isa_2_07 -#define TCG_TARGET_HAS_nand_vec have_isa_2_07 -#define TCG_TARGET_HAS_nor_vec 1 -#define TCG_TARGET_HAS_eqv_vec have_isa_2_07 -#define TCG_TARGET_HAS_not_vec 1 -#define TCG_TARGET_HAS_neg_vec have_isa_3_00 -#define TCG_TARGET_HAS_abs_vec 0 -#define TCG_TARGET_HAS_roti_vec 0 -#define TCG_TARGET_HAS_rots_vec 0 -#define TCG_TARGET_HAS_rotv_vec 1 -#define TCG_TARGET_HAS_shi_vec 0 -#define TCG_TARGET_HAS_shs_vec 0 -#define TCG_TARGET_HAS_shv_vec 1 -#define TCG_TARGET_HAS_mul_vec 1 -#define TCG_TARGET_HAS_sat_vec 1 -#define TCG_TARGET_HAS_minmax_vec 1 -#define TCG_TARGET_HAS_bitsel_vec have_vsx -#define TCG_TARGET_HAS_cmpsel_vec 1 -#define TCG_TARGET_HAS_tst_vec 0 +#include "tcg-target-has.h" #define TCG_TARGET_DEFAULT_MO (0) From patchwork Wed Jan 8 21:51:50 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 855720 Delivered-To: patch@linaro.org Received: by 2002:adf:8b05:0:b0:385:e875:8a9e with SMTP id n5csp942759wra; Wed, 8 Jan 2025 13:53:05 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUR2yCBbNASRQlICCJXYapm9e+sycbg6ntAYnhbyPb+zaqkyQEv5y8Vr0hyhiFMYkqdI0dHLw==@linaro.org X-Google-Smtp-Source: AGHT+IFI5GFbt2T84r+bPormuAlbhR4BmA1Il6p24oYN8VycOl1SR8KuYKgmM413Nus6cdFcmJDI X-Received: by 2002:ad4:5c4b:0:b0:6d4:21f6:a0d4 with SMTP id 6a1803df08f44-6df9b2d0ac6mr63204226d6.37.1736373185283; Wed, 08 Jan 2025 13:53:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736373185; cv=none; d=google.com; s=arc-20240605; b=iqfwVr1nT71qtM31eqkLQ1+fKyNci7Z9bWwtEEqlFOXrMr27AJLs/NWGuRPSp1KlxU WiRjQ5HDUcwbfdogdlVmZ3LKnX3SnSH1E43O7rq1dlFKlVO103gHPvCdmr1jCzc4pDwj kBhx5jbgHLkNJYi7PrlQhBWmMwqMlW/Bz6cOY1iATijOcqjfnxIfPcR0VARf6Z7vZc12 VAMCLFjt1A0J2wsN6xMyNAv/mmA4pFFzoVdnjP5DibtTgHKEYEMVH1/JQxQKkiUTUB+s 71LKe640vpPVbzwsoqRdz/LKT1P+WnL0IJNrAdNLoVdb0f4ocm/iRNXirSi+MB6tD47i iq6w== 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=Jmp/eIvUox9yzP6innBi1tkyaYkm/ULvVqWsjQV17u0=; fh=I/t+CGVRTvnlN+c1H2rL+bfx7DSzSdCxz00w+BTRVdo=; b=j6VEuTDLnEonfft0impZ9ipc6NN/9QhzwCjG67Qyv6ohwn3M8Z6C7UBz3idrPLwWai 2MH6/4KjNHs/g3Lq0QKT+ADl4OpiemdzkrZsTaRznNimzd788189AFVmMc1PV8s15vAB lxRxEZpW8WXSHtYEO0l25K9tXIZsHbjznXCPE6mrJd+Pjt7ODLTLqSS7DR1+LdHBetAc KZBDKFmLiihZ8VE+Gl44EmH2FHXGDAgnfcBMhn1t12B5z6dOSrvMaOoPlk/3DCbvRbKB xKSZdZKuFicw5dnRkVzTkg1iPWjGkArZH3AQRNYk60zsTpxO3SEOfpNMKGRYL9+u3xDC nxNg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pLoDqJMM; 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 6a1803df08f44-6dd1835a7bcsi530024306d6.447.2025.01.08.13.53.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 Jan 2025 13:53:05 -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=pLoDqJMM; 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 1tVdyo-0000lu-Qy; Wed, 08 Jan 2025 16:52:46 -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 1tVdym-0000cO-Lb for qemu-devel@nongnu.org; Wed, 08 Jan 2025 16:52:44 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tVdyk-00043u-Js for qemu-devel@nongnu.org; Wed, 08 Jan 2025 16:52:44 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-435f8f29f8aso2367995e9.2 for ; Wed, 08 Jan 2025 13:52:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736373161; x=1736977961; 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=Jmp/eIvUox9yzP6innBi1tkyaYkm/ULvVqWsjQV17u0=; b=pLoDqJMMiedSPIR6PUn/rDu8LWgUatvZ5dt9kzGcQpPjROru59fiZYMMIuho2e7t8A PUdx0LAURSWPKSdBTPbMsTrsRAcemKX/pQTJGqopi2T+dqApe65NV7U8rPm0wmzIoOOa +LC9YjQosLHxyBrDxaXjPLNDMjyIJTF1sgdzMOhcH05BciNFtP5NMQ6R62iPhP+wJMDn ZQDpi5HvtzC7lnUkwz5XBc6G7Ewb2EvhR2Dq2p0r0bfOHgrQtBs+GAhyCUESTiB2Jkrx pQ5TWEvtXE61bD0O3cTraDcwUYbXwJ17hjfayBLOMs3kFna6vgDh6oW80mj3qyMRw4lB HYSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736373161; x=1736977961; 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=Jmp/eIvUox9yzP6innBi1tkyaYkm/ULvVqWsjQV17u0=; b=ngVrK+6KK6Lvfug7v3r+Bkm8rD7wNaIha1XTAt+L3zjZhV1+uZDgqFKQITGHxv/97l RoQBJDpsUVaRap5ivVuy3G6wmf5AfbX8ory2QABQlYH0WNcfoZpy+cajZKta26G2qCT+ 5RrrgwrKoNmx+IhwpmLdWtkxDF+a3QOzV/lwyQbiFOvAynEhEKNvcB9w7cCCZKkjDDTU l0FBE2dTXBkZ06bqRnpc1wLd7ZkFPNx8aT5C4IHbuOlrdK8pW6ApZzjcTX76l7zT3i08 wY9eKXlHr6ph8fkhmD1fXePVSodiWwpiw6VBUPWk3FIDTRcFFTmkBREBVmUcFD8zVjeg 5JsA== X-Gm-Message-State: AOJu0Yz17sEU6NCR76F8VwgCaxdx6EDD9XdgAHSoA38hOwyhzDeXHFx3 H0EywejfhJzvS/TMRwfdzOa9olGiZ1HUp6a/6RoEmfbBb5WLkrZp4KD8zSLspzXaS2lmaMPaVAi bEW8= X-Gm-Gg: ASbGncvUlEwKAtjoa+nxibNufNOxvLMt98sTmk0+eKjTwRT10cuERWCZpLycph4vYfC SllxVuSfFES6GwkwRlZnpHPezvaIpO2STmsGDE2nRqdZlEoM/jtSRW3VJRe6YK4vr+LVQI1vXC9 SWqL8pnursF3dq2l5nVH/hOfCEzUmQQIGvov1nPXDpG+KnwPRnpvH40aM8OpblVzExcHMdo2DrR R9Btk7TpPuQHYjn27AkPSA2iVqdU3XibpY1eZN0MQ3Q4HcIonosuNFUUFqFwENS8TazYKEB6EWs Uo8sPSVDG6Lmv9Y/NkNKqONvLV7dA+M= X-Received: by 2002:a5d:5985:0:b0:38a:2798:c3e0 with SMTP id ffacd0b85a97d-38a87358f3bmr3413659f8f.54.1736373160858; Wed, 08 Jan 2025 13:52:40 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e2e89df1sm33315515e9.27.2025.01.08.13.52.39 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 08 Jan 2025 13:52:40 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: pierrick.bouvier@linaro.org, Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH v3 09/14] tcg/riscv: Extract TCG_TARGET_HAS_foo defs to 'tcg-target-has.h' Date: Wed, 8 Jan 2025 22:51:50 +0100 Message-ID: <20250108215156.8731-10-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250108215156.8731-1-philmd@linaro.org> References: <20250107080112.1175095-19-richard.henderson@linaro.org> <20250108215156.8731-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.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 From: Richard Henderson Signed-off-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- tcg/riscv/tcg-target-has.h | 112 +++++++++++++++++++++++++++++++++++++ tcg/riscv/tcg-target.h | 102 +-------------------------------- 2 files changed, 113 insertions(+), 101 deletions(-) create mode 100644 tcg/riscv/tcg-target-has.h diff --git a/tcg/riscv/tcg-target-has.h b/tcg/riscv/tcg-target-has.h new file mode 100644 index 00000000000..ddc759a5339 --- /dev/null +++ b/tcg/riscv/tcg-target-has.h @@ -0,0 +1,112 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Define target-specific opcode support + * Copyright (c) 2018 SiFive, Inc + */ + +#ifndef TCG_TARGET_HAS_H +#define TCG_TARGET_HAS_H + +#include "host/cpuinfo.h" + +/* optional instructions */ +#define TCG_TARGET_HAS_negsetcond_i32 1 +#define TCG_TARGET_HAS_div_i32 1 +#define TCG_TARGET_HAS_rem_i32 1 +#define TCG_TARGET_HAS_div2_i32 0 +#define TCG_TARGET_HAS_rot_i32 (cpuinfo & CPUINFO_ZBB) +#define TCG_TARGET_HAS_deposit_i32 0 +#define TCG_TARGET_HAS_extract_i32 0 +#define TCG_TARGET_HAS_sextract_i32 0 +#define TCG_TARGET_HAS_extract2_i32 0 +#define TCG_TARGET_HAS_add2_i32 1 +#define TCG_TARGET_HAS_sub2_i32 1 +#define TCG_TARGET_HAS_mulu2_i32 0 +#define TCG_TARGET_HAS_muls2_i32 0 +#define TCG_TARGET_HAS_muluh_i32 0 +#define TCG_TARGET_HAS_mulsh_i32 0 +#define TCG_TARGET_HAS_ext8s_i32 1 +#define TCG_TARGET_HAS_ext16s_i32 1 +#define TCG_TARGET_HAS_ext8u_i32 1 +#define TCG_TARGET_HAS_ext16u_i32 1 +#define TCG_TARGET_HAS_bswap16_i32 (cpuinfo & CPUINFO_ZBB) +#define TCG_TARGET_HAS_bswap32_i32 (cpuinfo & CPUINFO_ZBB) +#define TCG_TARGET_HAS_not_i32 1 +#define TCG_TARGET_HAS_andc_i32 (cpuinfo & CPUINFO_ZBB) +#define TCG_TARGET_HAS_orc_i32 (cpuinfo & CPUINFO_ZBB) +#define TCG_TARGET_HAS_eqv_i32 (cpuinfo & CPUINFO_ZBB) +#define TCG_TARGET_HAS_nand_i32 0 +#define TCG_TARGET_HAS_nor_i32 0 +#define TCG_TARGET_HAS_clz_i32 (cpuinfo & CPUINFO_ZBB) +#define TCG_TARGET_HAS_ctz_i32 (cpuinfo & CPUINFO_ZBB) +#define TCG_TARGET_HAS_ctpop_i32 (cpuinfo & CPUINFO_ZBB) +#define TCG_TARGET_HAS_brcond2 1 +#define TCG_TARGET_HAS_setcond2 1 +#define TCG_TARGET_HAS_qemu_st8_i32 0 + +#define TCG_TARGET_HAS_negsetcond_i64 1 +#define TCG_TARGET_HAS_div_i64 1 +#define TCG_TARGET_HAS_rem_i64 1 +#define TCG_TARGET_HAS_div2_i64 0 +#define TCG_TARGET_HAS_rot_i64 (cpuinfo & CPUINFO_ZBB) +#define TCG_TARGET_HAS_deposit_i64 0 +#define TCG_TARGET_HAS_extract_i64 0 +#define TCG_TARGET_HAS_sextract_i64 0 +#define TCG_TARGET_HAS_extract2_i64 0 +#define TCG_TARGET_HAS_extr_i64_i32 1 +#define TCG_TARGET_HAS_ext8s_i64 1 +#define TCG_TARGET_HAS_ext16s_i64 1 +#define TCG_TARGET_HAS_ext32s_i64 1 +#define TCG_TARGET_HAS_ext8u_i64 1 +#define TCG_TARGET_HAS_ext16u_i64 1 +#define TCG_TARGET_HAS_ext32u_i64 1 +#define TCG_TARGET_HAS_bswap16_i64 (cpuinfo & CPUINFO_ZBB) +#define TCG_TARGET_HAS_bswap32_i64 (cpuinfo & CPUINFO_ZBB) +#define TCG_TARGET_HAS_bswap64_i64 (cpuinfo & CPUINFO_ZBB) +#define TCG_TARGET_HAS_not_i64 1 +#define TCG_TARGET_HAS_andc_i64 (cpuinfo & CPUINFO_ZBB) +#define TCG_TARGET_HAS_orc_i64 (cpuinfo & CPUINFO_ZBB) +#define TCG_TARGET_HAS_eqv_i64 (cpuinfo & CPUINFO_ZBB) +#define TCG_TARGET_HAS_nand_i64 0 +#define TCG_TARGET_HAS_nor_i64 0 +#define TCG_TARGET_HAS_clz_i64 (cpuinfo & CPUINFO_ZBB) +#define TCG_TARGET_HAS_ctz_i64 (cpuinfo & CPUINFO_ZBB) +#define TCG_TARGET_HAS_ctpop_i64 (cpuinfo & CPUINFO_ZBB) +#define TCG_TARGET_HAS_add2_i64 1 +#define TCG_TARGET_HAS_sub2_i64 1 +#define TCG_TARGET_HAS_mulu2_i64 0 +#define TCG_TARGET_HAS_muls2_i64 0 +#define TCG_TARGET_HAS_muluh_i64 1 +#define TCG_TARGET_HAS_mulsh_i64 1 + +#define TCG_TARGET_HAS_qemu_ldst_i128 0 + +#define TCG_TARGET_HAS_tst 0 + +/* vector instructions */ +#define TCG_TARGET_HAS_v64 (cpuinfo & CPUINFO_ZVE64X) +#define TCG_TARGET_HAS_v128 (cpuinfo & CPUINFO_ZVE64X) +#define TCG_TARGET_HAS_v256 (cpuinfo & CPUINFO_ZVE64X) +#define TCG_TARGET_HAS_andc_vec 0 +#define TCG_TARGET_HAS_orc_vec 0 +#define TCG_TARGET_HAS_nand_vec 0 +#define TCG_TARGET_HAS_nor_vec 0 +#define TCG_TARGET_HAS_eqv_vec 0 +#define TCG_TARGET_HAS_not_vec 1 +#define TCG_TARGET_HAS_neg_vec 1 +#define TCG_TARGET_HAS_abs_vec 0 +#define TCG_TARGET_HAS_roti_vec 1 +#define TCG_TARGET_HAS_rots_vec 1 +#define TCG_TARGET_HAS_rotv_vec 1 +#define TCG_TARGET_HAS_shi_vec 1 +#define TCG_TARGET_HAS_shs_vec 1 +#define TCG_TARGET_HAS_shv_vec 1 +#define TCG_TARGET_HAS_mul_vec 1 +#define TCG_TARGET_HAS_sat_vec 1 +#define TCG_TARGET_HAS_minmax_vec 1 +#define TCG_TARGET_HAS_bitsel_vec 0 +#define TCG_TARGET_HAS_cmpsel_vec 1 + +#define TCG_TARGET_HAS_tst_vec 0 + +#endif diff --git a/tcg/riscv/tcg-target.h b/tcg/riscv/tcg-target.h index bfaa99ccddd..c710321bdb9 100644 --- a/tcg/riscv/tcg-target.h +++ b/tcg/riscv/tcg-target.h @@ -25,8 +25,6 @@ #ifndef RISCV_TCG_TARGET_H #define RISCV_TCG_TARGET_H -#include "host/cpuinfo.h" - #define TCG_TARGET_INSN_UNIT_SIZE 4 #define TCG_TARGET_NB_REGS 64 #define MAX_CODE_GEN_BUFFER_SIZE ((size_t)-1) @@ -59,105 +57,7 @@ typedef enum { TCG_REG_TMP2 = TCG_REG_T4, } TCGReg; -/* optional instructions */ -#define TCG_TARGET_HAS_negsetcond_i32 1 -#define TCG_TARGET_HAS_div_i32 1 -#define TCG_TARGET_HAS_rem_i32 1 -#define TCG_TARGET_HAS_div2_i32 0 -#define TCG_TARGET_HAS_rot_i32 (cpuinfo & CPUINFO_ZBB) -#define TCG_TARGET_HAS_deposit_i32 0 -#define TCG_TARGET_HAS_extract_i32 0 -#define TCG_TARGET_HAS_sextract_i32 0 -#define TCG_TARGET_HAS_extract2_i32 0 -#define TCG_TARGET_HAS_add2_i32 1 -#define TCG_TARGET_HAS_sub2_i32 1 -#define TCG_TARGET_HAS_mulu2_i32 0 -#define TCG_TARGET_HAS_muls2_i32 0 -#define TCG_TARGET_HAS_muluh_i32 0 -#define TCG_TARGET_HAS_mulsh_i32 0 -#define TCG_TARGET_HAS_ext8s_i32 1 -#define TCG_TARGET_HAS_ext16s_i32 1 -#define TCG_TARGET_HAS_ext8u_i32 1 -#define TCG_TARGET_HAS_ext16u_i32 1 -#define TCG_TARGET_HAS_bswap16_i32 (cpuinfo & CPUINFO_ZBB) -#define TCG_TARGET_HAS_bswap32_i32 (cpuinfo & CPUINFO_ZBB) -#define TCG_TARGET_HAS_not_i32 1 -#define TCG_TARGET_HAS_andc_i32 (cpuinfo & CPUINFO_ZBB) -#define TCG_TARGET_HAS_orc_i32 (cpuinfo & CPUINFO_ZBB) -#define TCG_TARGET_HAS_eqv_i32 (cpuinfo & CPUINFO_ZBB) -#define TCG_TARGET_HAS_nand_i32 0 -#define TCG_TARGET_HAS_nor_i32 0 -#define TCG_TARGET_HAS_clz_i32 (cpuinfo & CPUINFO_ZBB) -#define TCG_TARGET_HAS_ctz_i32 (cpuinfo & CPUINFO_ZBB) -#define TCG_TARGET_HAS_ctpop_i32 (cpuinfo & CPUINFO_ZBB) -#define TCG_TARGET_HAS_brcond2 1 -#define TCG_TARGET_HAS_setcond2 1 -#define TCG_TARGET_HAS_qemu_st8_i32 0 - -#define TCG_TARGET_HAS_negsetcond_i64 1 -#define TCG_TARGET_HAS_div_i64 1 -#define TCG_TARGET_HAS_rem_i64 1 -#define TCG_TARGET_HAS_div2_i64 0 -#define TCG_TARGET_HAS_rot_i64 (cpuinfo & CPUINFO_ZBB) -#define TCG_TARGET_HAS_deposit_i64 0 -#define TCG_TARGET_HAS_extract_i64 0 -#define TCG_TARGET_HAS_sextract_i64 0 -#define TCG_TARGET_HAS_extract2_i64 0 -#define TCG_TARGET_HAS_extr_i64_i32 1 -#define TCG_TARGET_HAS_ext8s_i64 1 -#define TCG_TARGET_HAS_ext16s_i64 1 -#define TCG_TARGET_HAS_ext32s_i64 1 -#define TCG_TARGET_HAS_ext8u_i64 1 -#define TCG_TARGET_HAS_ext16u_i64 1 -#define TCG_TARGET_HAS_ext32u_i64 1 -#define TCG_TARGET_HAS_bswap16_i64 (cpuinfo & CPUINFO_ZBB) -#define TCG_TARGET_HAS_bswap32_i64 (cpuinfo & CPUINFO_ZBB) -#define TCG_TARGET_HAS_bswap64_i64 (cpuinfo & CPUINFO_ZBB) -#define TCG_TARGET_HAS_not_i64 1 -#define TCG_TARGET_HAS_andc_i64 (cpuinfo & CPUINFO_ZBB) -#define TCG_TARGET_HAS_orc_i64 (cpuinfo & CPUINFO_ZBB) -#define TCG_TARGET_HAS_eqv_i64 (cpuinfo & CPUINFO_ZBB) -#define TCG_TARGET_HAS_nand_i64 0 -#define TCG_TARGET_HAS_nor_i64 0 -#define TCG_TARGET_HAS_clz_i64 (cpuinfo & CPUINFO_ZBB) -#define TCG_TARGET_HAS_ctz_i64 (cpuinfo & CPUINFO_ZBB) -#define TCG_TARGET_HAS_ctpop_i64 (cpuinfo & CPUINFO_ZBB) -#define TCG_TARGET_HAS_add2_i64 1 -#define TCG_TARGET_HAS_sub2_i64 1 -#define TCG_TARGET_HAS_mulu2_i64 0 -#define TCG_TARGET_HAS_muls2_i64 0 -#define TCG_TARGET_HAS_muluh_i64 1 -#define TCG_TARGET_HAS_mulsh_i64 1 - -#define TCG_TARGET_HAS_qemu_ldst_i128 0 - -#define TCG_TARGET_HAS_tst 0 - -/* vector instructions */ -#define TCG_TARGET_HAS_v64 (cpuinfo & CPUINFO_ZVE64X) -#define TCG_TARGET_HAS_v128 (cpuinfo & CPUINFO_ZVE64X) -#define TCG_TARGET_HAS_v256 (cpuinfo & CPUINFO_ZVE64X) -#define TCG_TARGET_HAS_andc_vec 0 -#define TCG_TARGET_HAS_orc_vec 0 -#define TCG_TARGET_HAS_nand_vec 0 -#define TCG_TARGET_HAS_nor_vec 0 -#define TCG_TARGET_HAS_eqv_vec 0 -#define TCG_TARGET_HAS_not_vec 1 -#define TCG_TARGET_HAS_neg_vec 1 -#define TCG_TARGET_HAS_abs_vec 0 -#define TCG_TARGET_HAS_roti_vec 1 -#define TCG_TARGET_HAS_rots_vec 1 -#define TCG_TARGET_HAS_rotv_vec 1 -#define TCG_TARGET_HAS_shi_vec 1 -#define TCG_TARGET_HAS_shs_vec 1 -#define TCG_TARGET_HAS_shv_vec 1 -#define TCG_TARGET_HAS_mul_vec 1 -#define TCG_TARGET_HAS_sat_vec 1 -#define TCG_TARGET_HAS_minmax_vec 1 -#define TCG_TARGET_HAS_bitsel_vec 0 -#define TCG_TARGET_HAS_cmpsel_vec 1 - -#define TCG_TARGET_HAS_tst_vec 0 +#include "tcg-target-has.h" #define TCG_TARGET_DEFAULT_MO (0) From patchwork Wed Jan 8 21:51:51 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 855721 Delivered-To: patch@linaro.org Received: by 2002:adf:8b05:0:b0:385:e875:8a9e with SMTP id n5csp942784wra; Wed, 8 Jan 2025 13:53:10 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXt56cFIKRi/7Vggnj+8CwbNPnpGVGPTbwP1zW9odARyeDoIJD+MkIhBKFgToPggMU7Rj1pBg==@linaro.org X-Google-Smtp-Source: AGHT+IEl1WZxgqyzzpRcyb0nibqxh7pj17Q6hD9W2gdQpMyCP5QbWV9ZGfwfxBJvAwwROlDW0M2u X-Received: by 2002:a05:622a:24e:b0:467:61c1:df38 with SMTP id d75a77b69052e-46c7b025ed4mr15717951cf.12.1736373190273; Wed, 08 Jan 2025 13:53:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736373190; cv=none; d=google.com; s=arc-20240605; b=fKvm54LJQPZomDfKEkKKctUCxL8bQx2SLiNveradPHRseDg75UJz9Pd1MxoeA9tz2e hAsdlDjJxVhTSujrO5G5BOKLLjV0SCUBs3sMmKDWllCQAohJG7pvKLBHV1gBYSqae33R lBarWtJy9+1ZRc0fvmhOJ5vIlbuV8++RHC7bHw9kmjDGtoBqidm+G41vKdLFO1zcqeWG 13XYz55rAvp8Kt1eMu3yfxqAfzN4fY5cMti4QoemcGnh6o7AseCpp/MfRaCMiVoaeSqw CJA4BKU3G6lYAy5ReehILmqA9vgR2d2570VpWSsVsnBLIaH3VBRQ2rbCTu26fGDREyHb g4yg== 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=TtnSTTCpVdWQWGkOoMv6FUutNJoBmMFz6ElIS3cget8=; fh=I/t+CGVRTvnlN+c1H2rL+bfx7DSzSdCxz00w+BTRVdo=; b=YM4XVegIMDQ7KEq5sXVKo6CB4cVOpQ0xrNM90oYZQiqWQ8iDXtGjMua1cpbWXkeloX R6YJkAjuu7AcgxTeIVMeJH4t2uWeLd1eExw5sxoHjV97oSmj7GmzrBdahrSrNsuYF/cK pTed0kdN8MAu+rlSITHca+Ybnrd6AgYhrI0ZguvNJP0Tae4KEngU07dRzjDxeNmgxPn5 Egu0qpfgC1XQOzC1vFPNxCECZAdTiWrZJSqTY2RU4xixDsahZHda8+A5Z4fr2jfZ9jdd Cu5ZvNbpnUSTLVlpEG4B14LMiuZ6Wq85IrikUc3HkhI8b6IuSzFkXDQMfYxk2fPrI4ag 22Mw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Y++c56Z1; 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-46a3ebd5ab3si458820421cf.512.2025.01.08.13.53.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 Jan 2025 13:53:10 -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=Y++c56Z1; 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 1tVdyt-0001Gg-Rb; Wed, 08 Jan 2025 16:52:51 -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 1tVdyr-00012c-8g for qemu-devel@nongnu.org; Wed, 08 Jan 2025 16:52:49 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tVdyp-00044R-53 for qemu-devel@nongnu.org; Wed, 08 Jan 2025 16:52:48 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-4364a37a1d7so3238375e9.3 for ; Wed, 08 Jan 2025 13:52:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736373165; x=1736977965; 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=TtnSTTCpVdWQWGkOoMv6FUutNJoBmMFz6ElIS3cget8=; b=Y++c56Z1DEshnwxA5NtTQ8D61Mn/omrwMChTdzR5bnhJiY4w3sSucIVQp7QeqTF7wQ yjZEHv6W9l3xTxLZFAoGZegj1TrDsDnNo+TOPBKTojdHvHEk2Xb86l0WL0hP2woyKnRl +LG+qGXldZPJoMDZS+R8Avtby4zo7e9FiTp/tmfmNwd7tKei1glsPyBs8wiOJM0TQQWG EDLpyAHmusSyaUCmrit37rZwFMlq007FQD9hUqNShnv3e7Y60zaJm9JtUaeD3HBQE0oh 0OINAvwnVtDRF/i93jK4ZW/72DF+Ae3/8+bcSib/u2vO6B/UE1cpS4VRv1r0cqJzUneS P0uA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736373165; x=1736977965; 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=TtnSTTCpVdWQWGkOoMv6FUutNJoBmMFz6ElIS3cget8=; b=Tgno4ZTZJyXvRtx7kZ/Rc69Z8vWtwtisN2kptOrfXsvXJKtrAwuZenoKzy08pp7e34 6q+hHNGa0XahrHzrNOXJ3DqmSValuaXojmUu1qZoyXR+di6xMucHDjgrLlaePN8fRb/E /RnJr6/pSHF+48fOMRfbw47mkRMHnVe/xInZ5xH0DKaNHdrNdapLD4ctmOdVaYQ/eaCR 0gPL9s8pw0Yk1UJVctmqhjgiYCICyatK+tJ5FIV8o51eLZs50QxIuop0legNLVlgLrtl +ZQKnh8zUEfxiDyrvCTgPKH8sB8uMBTKiKoeSsOo4E3K97KOyxSyeH7Q0zLSm7/nXepr k2iA== X-Gm-Message-State: AOJu0Yyo5AhAUCQWTt4cQM54E/dfEMp86gBIY6DXMD2R8LoEUeUs85ed 5bWhe5qsYCjC2yMLJvoIiiZoC1FFAqagiA17lYMjcM5FDqAkO9M3k+hhXKj0/RFHQRcyLqY88F3 /1TM= X-Gm-Gg: ASbGncse55gQ3UXNj1KVcw9khirn9PwvggynQ3hayJnrnZpYINlyTxSxtyU6BfWCX0R 71QAfTDy/3edoOSIijnMqGgH2FAmoY8WhMhmTpe9ZsD/kG0yr42CRZBUR8O38xhKgKL8mB/PANO iD0cVoZ72Nz10dASphPoAR9vq1wEeIUMSN/r2W9VZzlge0VcaXjKKoyzy9ub/3fqfwxoAqz9d0x oxCZRD43lcF8Xh7pJQI5EZcdnd6K2C3Wew/moRA7udqHZbKKnWXP6norvgbUIs36i/a+ck2nLwD 9AnXiTYejWnfYIZfHETkoZKEi5YkOR8= X-Received: by 2002:a05:6000:1884:b0:385:f1d9:4b90 with SMTP id ffacd0b85a97d-38a8730531cmr3170355f8f.13.1736373165400; Wed, 08 Jan 2025 13:52:45 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e9a431a8sm622215e9.33.2025.01.08.13.52.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 08 Jan 2025 13:52:44 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: pierrick.bouvier@linaro.org, Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH v3 10/14] tcg/s390x: Extract TCG_TARGET_HAS_foo defs to 'tcg-target-has.h' Date: Wed, 8 Jan 2025 22:51:51 +0100 Message-ID: <20250108215156.8731-11-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250108215156.8731-1-philmd@linaro.org> References: <20250107080112.1175095-19-richard.henderson@linaro.org> <20250108215156.8731-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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 From: Richard Henderson Signed-off-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- tcg/s390x/tcg-target-has.h | 124 +++++++++++++++++++++++++++++++++++++ tcg/s390x/tcg-target.h | 114 +--------------------------------- 2 files changed, 125 insertions(+), 113 deletions(-) create mode 100644 tcg/s390x/tcg-target-has.h diff --git a/tcg/s390x/tcg-target-has.h b/tcg/s390x/tcg-target-has.h new file mode 100644 index 00000000000..4992d74f121 --- /dev/null +++ b/tcg/s390x/tcg-target-has.h @@ -0,0 +1,124 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Define target-specific opcode support + * Copyright (c) 2009 Ulrich Hecht + */ + +#ifndef TCG_TARGET_HAS_H +#define TCG_TARGET_HAS_H + +/* Facilities required for proper operation; checked at startup. */ + +#define FACILITY_ZARCH_ACTIVE 2 +#define FACILITY_LONG_DISP 18 +#define FACILITY_EXT_IMM 21 +#define FACILITY_GEN_INST_EXT 34 +#define FACILITY_45 45 + +/* Facilities that are checked at runtime. */ + +#define FACILITY_LOAD_ON_COND2 53 +#define FACILITY_MISC_INSN_EXT2 58 +#define FACILITY_MISC_INSN_EXT3 61 +#define FACILITY_VECTOR 129 +#define FACILITY_VECTOR_ENH1 135 + +extern uint64_t s390_facilities[3]; + +#define HAVE_FACILITY(X) \ + ((s390_facilities[FACILITY_##X / 64] >> (63 - FACILITY_##X % 64)) & 1) + +/* optional instructions */ +#define TCG_TARGET_HAS_div2_i32 1 +#define TCG_TARGET_HAS_rot_i32 1 +#define TCG_TARGET_HAS_ext8s_i32 1 +#define TCG_TARGET_HAS_ext16s_i32 1 +#define TCG_TARGET_HAS_ext8u_i32 1 +#define TCG_TARGET_HAS_ext16u_i32 1 +#define TCG_TARGET_HAS_bswap16_i32 1 +#define TCG_TARGET_HAS_bswap32_i32 1 +#define TCG_TARGET_HAS_not_i32 HAVE_FACILITY(MISC_INSN_EXT3) +#define TCG_TARGET_HAS_andc_i32 HAVE_FACILITY(MISC_INSN_EXT3) +#define TCG_TARGET_HAS_orc_i32 HAVE_FACILITY(MISC_INSN_EXT3) +#define TCG_TARGET_HAS_eqv_i32 HAVE_FACILITY(MISC_INSN_EXT3) +#define TCG_TARGET_HAS_nand_i32 HAVE_FACILITY(MISC_INSN_EXT3) +#define TCG_TARGET_HAS_nor_i32 HAVE_FACILITY(MISC_INSN_EXT3) +#define TCG_TARGET_HAS_clz_i32 0 +#define TCG_TARGET_HAS_ctz_i32 0 +#define TCG_TARGET_HAS_ctpop_i32 1 +#define TCG_TARGET_HAS_deposit_i32 1 +#define TCG_TARGET_HAS_extract_i32 1 +#define TCG_TARGET_HAS_sextract_i32 0 +#define TCG_TARGET_HAS_extract2_i32 0 +#define TCG_TARGET_HAS_negsetcond_i32 1 +#define TCG_TARGET_HAS_add2_i32 1 +#define TCG_TARGET_HAS_sub2_i32 1 +#define TCG_TARGET_HAS_mulu2_i32 0 +#define TCG_TARGET_HAS_muls2_i32 0 +#define TCG_TARGET_HAS_muluh_i32 0 +#define TCG_TARGET_HAS_mulsh_i32 0 +#define TCG_TARGET_HAS_extr_i64_i32 0 +#define TCG_TARGET_HAS_qemu_st8_i32 0 + +#define TCG_TARGET_HAS_div2_i64 1 +#define TCG_TARGET_HAS_rot_i64 1 +#define TCG_TARGET_HAS_ext8s_i64 1 +#define TCG_TARGET_HAS_ext16s_i64 1 +#define TCG_TARGET_HAS_ext32s_i64 1 +#define TCG_TARGET_HAS_ext8u_i64 1 +#define TCG_TARGET_HAS_ext16u_i64 1 +#define TCG_TARGET_HAS_ext32u_i64 1 +#define TCG_TARGET_HAS_bswap16_i64 1 +#define TCG_TARGET_HAS_bswap32_i64 1 +#define TCG_TARGET_HAS_bswap64_i64 1 +#define TCG_TARGET_HAS_not_i64 HAVE_FACILITY(MISC_INSN_EXT3) +#define TCG_TARGET_HAS_andc_i64 HAVE_FACILITY(MISC_INSN_EXT3) +#define TCG_TARGET_HAS_orc_i64 HAVE_FACILITY(MISC_INSN_EXT3) +#define TCG_TARGET_HAS_eqv_i64 HAVE_FACILITY(MISC_INSN_EXT3) +#define TCG_TARGET_HAS_nand_i64 HAVE_FACILITY(MISC_INSN_EXT3) +#define TCG_TARGET_HAS_nor_i64 HAVE_FACILITY(MISC_INSN_EXT3) +#define TCG_TARGET_HAS_clz_i64 1 +#define TCG_TARGET_HAS_ctz_i64 0 +#define TCG_TARGET_HAS_ctpop_i64 1 +#define TCG_TARGET_HAS_deposit_i64 1 +#define TCG_TARGET_HAS_extract_i64 1 +#define TCG_TARGET_HAS_sextract_i64 0 +#define TCG_TARGET_HAS_extract2_i64 0 +#define TCG_TARGET_HAS_negsetcond_i64 1 +#define TCG_TARGET_HAS_add2_i64 1 +#define TCG_TARGET_HAS_sub2_i64 1 +#define TCG_TARGET_HAS_mulu2_i64 1 +#define TCG_TARGET_HAS_muls2_i64 HAVE_FACILITY(MISC_INSN_EXT2) +#define TCG_TARGET_HAS_muluh_i64 0 +#define TCG_TARGET_HAS_mulsh_i64 0 + +#define TCG_TARGET_HAS_qemu_ldst_i128 1 + +#define TCG_TARGET_HAS_tst 1 + +#define TCG_TARGET_HAS_v64 HAVE_FACILITY(VECTOR) +#define TCG_TARGET_HAS_v128 HAVE_FACILITY(VECTOR) +#define TCG_TARGET_HAS_v256 0 + +#define TCG_TARGET_HAS_andc_vec 1 +#define TCG_TARGET_HAS_orc_vec HAVE_FACILITY(VECTOR_ENH1) +#define TCG_TARGET_HAS_nand_vec HAVE_FACILITY(VECTOR_ENH1) +#define TCG_TARGET_HAS_nor_vec 1 +#define TCG_TARGET_HAS_eqv_vec HAVE_FACILITY(VECTOR_ENH1) +#define TCG_TARGET_HAS_not_vec 1 +#define TCG_TARGET_HAS_neg_vec 1 +#define TCG_TARGET_HAS_abs_vec 1 +#define TCG_TARGET_HAS_roti_vec 1 +#define TCG_TARGET_HAS_rots_vec 1 +#define TCG_TARGET_HAS_rotv_vec 1 +#define TCG_TARGET_HAS_shi_vec 1 +#define TCG_TARGET_HAS_shs_vec 1 +#define TCG_TARGET_HAS_shv_vec 1 +#define TCG_TARGET_HAS_mul_vec 1 +#define TCG_TARGET_HAS_sat_vec 0 +#define TCG_TARGET_HAS_minmax_vec 1 +#define TCG_TARGET_HAS_bitsel_vec 1 +#define TCG_TARGET_HAS_cmpsel_vec 1 +#define TCG_TARGET_HAS_tst_vec 0 + +#endif diff --git a/tcg/s390x/tcg-target.h b/tcg/s390x/tcg-target.h index 223d3f6ca14..220ed68b1f4 100644 --- a/tcg/s390x/tcg-target.h +++ b/tcg/s390x/tcg-target.h @@ -51,119 +51,7 @@ typedef enum TCGReg { #define TCG_TARGET_NB_REGS 64 -/* Facilities required for proper operation; checked at startup. */ - -#define FACILITY_ZARCH_ACTIVE 2 -#define FACILITY_LONG_DISP 18 -#define FACILITY_EXT_IMM 21 -#define FACILITY_GEN_INST_EXT 34 -#define FACILITY_45 45 - -/* Facilities that are checked at runtime. */ - -#define FACILITY_LOAD_ON_COND2 53 -#define FACILITY_MISC_INSN_EXT2 58 -#define FACILITY_MISC_INSN_EXT3 61 -#define FACILITY_VECTOR 129 -#define FACILITY_VECTOR_ENH1 135 - -extern uint64_t s390_facilities[3]; - -#define HAVE_FACILITY(X) \ - ((s390_facilities[FACILITY_##X / 64] >> (63 - FACILITY_##X % 64)) & 1) - -/* optional instructions */ -#define TCG_TARGET_HAS_div2_i32 1 -#define TCG_TARGET_HAS_rot_i32 1 -#define TCG_TARGET_HAS_ext8s_i32 1 -#define TCG_TARGET_HAS_ext16s_i32 1 -#define TCG_TARGET_HAS_ext8u_i32 1 -#define TCG_TARGET_HAS_ext16u_i32 1 -#define TCG_TARGET_HAS_bswap16_i32 1 -#define TCG_TARGET_HAS_bswap32_i32 1 -#define TCG_TARGET_HAS_not_i32 HAVE_FACILITY(MISC_INSN_EXT3) -#define TCG_TARGET_HAS_andc_i32 HAVE_FACILITY(MISC_INSN_EXT3) -#define TCG_TARGET_HAS_orc_i32 HAVE_FACILITY(MISC_INSN_EXT3) -#define TCG_TARGET_HAS_eqv_i32 HAVE_FACILITY(MISC_INSN_EXT3) -#define TCG_TARGET_HAS_nand_i32 HAVE_FACILITY(MISC_INSN_EXT3) -#define TCG_TARGET_HAS_nor_i32 HAVE_FACILITY(MISC_INSN_EXT3) -#define TCG_TARGET_HAS_clz_i32 0 -#define TCG_TARGET_HAS_ctz_i32 0 -#define TCG_TARGET_HAS_ctpop_i32 1 -#define TCG_TARGET_HAS_deposit_i32 1 -#define TCG_TARGET_HAS_extract_i32 1 -#define TCG_TARGET_HAS_sextract_i32 0 -#define TCG_TARGET_HAS_extract2_i32 0 -#define TCG_TARGET_HAS_negsetcond_i32 1 -#define TCG_TARGET_HAS_add2_i32 1 -#define TCG_TARGET_HAS_sub2_i32 1 -#define TCG_TARGET_HAS_mulu2_i32 0 -#define TCG_TARGET_HAS_muls2_i32 0 -#define TCG_TARGET_HAS_muluh_i32 0 -#define TCG_TARGET_HAS_mulsh_i32 0 -#define TCG_TARGET_HAS_extr_i64_i32 0 -#define TCG_TARGET_HAS_qemu_st8_i32 0 - -#define TCG_TARGET_HAS_div2_i64 1 -#define TCG_TARGET_HAS_rot_i64 1 -#define TCG_TARGET_HAS_ext8s_i64 1 -#define TCG_TARGET_HAS_ext16s_i64 1 -#define TCG_TARGET_HAS_ext32s_i64 1 -#define TCG_TARGET_HAS_ext8u_i64 1 -#define TCG_TARGET_HAS_ext16u_i64 1 -#define TCG_TARGET_HAS_ext32u_i64 1 -#define TCG_TARGET_HAS_bswap16_i64 1 -#define TCG_TARGET_HAS_bswap32_i64 1 -#define TCG_TARGET_HAS_bswap64_i64 1 -#define TCG_TARGET_HAS_not_i64 HAVE_FACILITY(MISC_INSN_EXT3) -#define TCG_TARGET_HAS_andc_i64 HAVE_FACILITY(MISC_INSN_EXT3) -#define TCG_TARGET_HAS_orc_i64 HAVE_FACILITY(MISC_INSN_EXT3) -#define TCG_TARGET_HAS_eqv_i64 HAVE_FACILITY(MISC_INSN_EXT3) -#define TCG_TARGET_HAS_nand_i64 HAVE_FACILITY(MISC_INSN_EXT3) -#define TCG_TARGET_HAS_nor_i64 HAVE_FACILITY(MISC_INSN_EXT3) -#define TCG_TARGET_HAS_clz_i64 1 -#define TCG_TARGET_HAS_ctz_i64 0 -#define TCG_TARGET_HAS_ctpop_i64 1 -#define TCG_TARGET_HAS_deposit_i64 1 -#define TCG_TARGET_HAS_extract_i64 1 -#define TCG_TARGET_HAS_sextract_i64 0 -#define TCG_TARGET_HAS_extract2_i64 0 -#define TCG_TARGET_HAS_negsetcond_i64 1 -#define TCG_TARGET_HAS_add2_i64 1 -#define TCG_TARGET_HAS_sub2_i64 1 -#define TCG_TARGET_HAS_mulu2_i64 1 -#define TCG_TARGET_HAS_muls2_i64 HAVE_FACILITY(MISC_INSN_EXT2) -#define TCG_TARGET_HAS_muluh_i64 0 -#define TCG_TARGET_HAS_mulsh_i64 0 - -#define TCG_TARGET_HAS_qemu_ldst_i128 1 - -#define TCG_TARGET_HAS_tst 1 - -#define TCG_TARGET_HAS_v64 HAVE_FACILITY(VECTOR) -#define TCG_TARGET_HAS_v128 HAVE_FACILITY(VECTOR) -#define TCG_TARGET_HAS_v256 0 - -#define TCG_TARGET_HAS_andc_vec 1 -#define TCG_TARGET_HAS_orc_vec HAVE_FACILITY(VECTOR_ENH1) -#define TCG_TARGET_HAS_nand_vec HAVE_FACILITY(VECTOR_ENH1) -#define TCG_TARGET_HAS_nor_vec 1 -#define TCG_TARGET_HAS_eqv_vec HAVE_FACILITY(VECTOR_ENH1) -#define TCG_TARGET_HAS_not_vec 1 -#define TCG_TARGET_HAS_neg_vec 1 -#define TCG_TARGET_HAS_abs_vec 1 -#define TCG_TARGET_HAS_roti_vec 1 -#define TCG_TARGET_HAS_rots_vec 1 -#define TCG_TARGET_HAS_rotv_vec 1 -#define TCG_TARGET_HAS_shi_vec 1 -#define TCG_TARGET_HAS_shs_vec 1 -#define TCG_TARGET_HAS_shv_vec 1 -#define TCG_TARGET_HAS_mul_vec 1 -#define TCG_TARGET_HAS_sat_vec 0 -#define TCG_TARGET_HAS_minmax_vec 1 -#define TCG_TARGET_HAS_bitsel_vec 1 -#define TCG_TARGET_HAS_cmpsel_vec 1 -#define TCG_TARGET_HAS_tst_vec 0 +#include "tcg-target-has.h" #define TCG_TARGET_DEFAULT_MO (TCG_MO_ALL & ~TCG_MO_ST_LD) From patchwork Wed Jan 8 21:51:52 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 855725 Delivered-To: patch@linaro.org Received: by 2002:adf:8b05:0:b0:385:e875:8a9e with SMTP id n5csp942891wra; Wed, 8 Jan 2025 13:53:30 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUifUtIlhb4TkL+LMNzZMGId7M4F5huSt82LvsGQxcjwE4+NcRVV0juXEHG5WExPPIDUo4Egw==@linaro.org X-Google-Smtp-Source: AGHT+IGuTeE0OEIqxT+3nCZhgC53t4/EYLU8TPlknzsH+CyB+wXlWpYQHmOVT4Fet8WfM8jxBHo0 X-Received: by 2002:a05:6214:5192:b0:6d8:8f14:2f5b with SMTP id 6a1803df08f44-6df9b240540mr80392736d6.19.1736373210772; Wed, 08 Jan 2025 13:53:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736373210; cv=none; d=google.com; s=arc-20240605; b=Ton0ivJvOMvxcovR0UV4MxmSV6lWJLLfimvlNwBBSqU5cfYdOGgIlAOYMF6VcNVW+7 OHvzjE4jdJuVBu+u4bGilAqox3hLMOLB5ImkDU1hBbQ+mSFMqoh1WpxUFDxoTz7gEFq1 chQuHtvsAJr3fISMKRnenScTK5/aOcf5GM54WIGuTDaid9sp1eJcwrV8FOj7VYgTi8YR lnfbTI27LHu6TEjVnsAIxWcfOJjR+3Yb0g/JMY2LsmMYSIndQtCRsKbBwR7l36BePSqd vZ/MCCnCeptqALrGukwbr+DmlhAuJ5vNFGxuyNX9s3vdV5rE9QsBC8KWQqLTTdgsrj/p CK2Q== 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=f+z1jZmutXk7OoIDZIAMUy/XHUDd/igyf40XyyQ5ntQ=; fh=I/t+CGVRTvnlN+c1H2rL+bfx7DSzSdCxz00w+BTRVdo=; b=aPdc/2AWQ143nWWr2wAGeGvuAHg/W3GOLl09E0AsLWUbfTqEL3+s4sFA4Zq9yeL+B/ VsQnwBZCdPFgBjbSQW+r32o2xiVGf2ISrxF0MvqNGpjROZrujnnf9vkYxO8gP/drQXkN 2EmWX7LjjS/Z/nojpWosjOdihcHqk0u6VRRo7OO0YLDkUAOVGKMk2FtyftfQthXvK+9G OdL6+bf1mzx9bfy2iAYwMjW/tIDf05srIHaaLy+G9m1RMdvx81G6vvZpA21kAj/bGs+H 7L/MMbbJYFwUEMPtqSaxkoVTLGie+rkM5NqakLuFFJys98Zxts9k96ZqLdxuA0fhCDzk c0bg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lTJGWix3; 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 6a1803df08f44-6dd1810c3afsi480990846d6.104.2025.01.08.13.53.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 Jan 2025 13:53:30 -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=lTJGWix3; 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 1tVdyx-0001dW-VG; Wed, 08 Jan 2025 16:52:56 -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 1tVdyv-0001UC-QK for qemu-devel@nongnu.org; Wed, 08 Jan 2025 16:52:53 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tVdyu-00044i-02 for qemu-devel@nongnu.org; Wed, 08 Jan 2025 16:52:53 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-43626213fffso8827985e9.1 for ; Wed, 08 Jan 2025 13:52:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736373170; x=1736977970; 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=f+z1jZmutXk7OoIDZIAMUy/XHUDd/igyf40XyyQ5ntQ=; b=lTJGWix3naqft3uApD4YsL+RAzgT6oab85DX8OPlW0mz/c/6q29jJgMknwUg2jDgxP um/AiZjvM0oAJdi9UOyPTWA7dd0J1hmZ8Jg2nDDuR5gK4EewIjMqkev8cSyYZNiVIkBi LLiISG8HW3Jf+xN8keuApEfqCY0LYZwn9AjACwvxxO6V/YK4gxdgenSWqRu1xmQ8hGU4 0FfqzaotoGiDO+uN2cIxI1rQ8q/MRT2tcx8gvM4vtxHldsZ9SBEgTh8+AMz25N/DCSHF L0yh7ej9PII38GGGbjZbgzID3/e9Cg1qNyTxSIECwFRZLaXAT28HrTVdbUtkZFaLdeI5 ilRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736373170; x=1736977970; 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=f+z1jZmutXk7OoIDZIAMUy/XHUDd/igyf40XyyQ5ntQ=; b=U6HafCzPHYbxbfeoeNhcyAFZ5Xo4+VGROvvXQjQ1qC4Pe6hmW+1SCQLPlAn2zTBnLx ss8C3uNLPEYQ+m5ZlG51VSwnLj1X9inaugy9C2yUOK0kL3cWPLLxEYzzRJU7teYpXC+X DdiJRfhhXFomrttsyCXrlpkQhXRCPglMZVM2qf2ng1vA047NFPFzVsnIwX/zQZS8aRUZ PND5FNlIV8l/6pQ1riTQ/WuoQbW+gbVRhtI7l85qYRpi/t4/W2y7KEJpdU7WK1TAF/hN V66QYSXOtoq507fuAadhKmuY4cVN2F14IpmNqYXdFNKAyHZqY/h/DOE2AIrEek/10kWy mdwA== X-Gm-Message-State: AOJu0YwB0YFyuCKlmCvrlmEYokZLekBM5ZfjxYAywxVuM3i52DkkhZS/ 6jUqopFlA5CZY9ODE2Cy/AO5fGHz7oN6cuETWmHMmoPbj+KnaFV+mZUJoeIIAlhcxhXO/PtHWAl 8DgQ= X-Gm-Gg: ASbGnctwB88xp7rartJYaw88v5aiBRb6uOhaZ6WZol2XEc++oIiZsZzCtUC8Z1/gupA uU8knopYV3ZHehBLyt+kE1t3vIrnF2EFbRGwb4poRdOntvF4U5hLLv3vUre0IWhWbQkkM90Bznk prEBxngSyo7oI/Vuj2J80dtogrYqbd5pWKM9eYeDY+D0fRoJKA69EaUKDP/TyrRsAVH7/ZJWY13 wBkaD9ede73jrHZaVV8wwRmG6RXKqxcIIx2WD4DVnEHr+r/PoyFJUr+uoj3OpjrwR3xBgPr0j/s Pmw1bNnyPKOu+zRU5V0L2/gcwI5P4o8= X-Received: by 2002:a05:6000:1547:b0:386:34af:9bae with SMTP id ffacd0b85a97d-38a8b0b7fd0mr712034f8f.4.1736373169963; Wed, 08 Jan 2025 13:52:49 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e3834a6sm7614f8f.28.2025.01.08.13.52.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 08 Jan 2025 13:52:49 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: pierrick.bouvier@linaro.org, Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH v3 11/14] tcg/sparc64: Extract TCG_TARGET_HAS_foo defs to 'tcg-target-has.h' Date: Wed, 8 Jan 2025 22:51:52 +0100 Message-ID: <20250108215156.8731-12-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250108215156.8731-1-philmd@linaro.org> References: <20250107080112.1175095-19-richard.henderson@linaro.org> <20250108215156.8731-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.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 From: Richard Henderson Signed-off-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- tcg/sparc64/tcg-target-has.h | 86 ++++++++++++++++++++++++++++++++++++ tcg/sparc64/tcg-target.h | 78 +------------------------------- 2 files changed, 88 insertions(+), 76 deletions(-) create mode 100644 tcg/sparc64/tcg-target-has.h diff --git a/tcg/sparc64/tcg-target-has.h b/tcg/sparc64/tcg-target-has.h new file mode 100644 index 00000000000..d9ca14cc3d4 --- /dev/null +++ b/tcg/sparc64/tcg-target-has.h @@ -0,0 +1,86 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Define target-specific opcode support + * Copyright (c) 2008 Fabrice Bellard + */ + +#ifndef TCG_TARGET_HAS_H +#define TCG_TARGET_HAS_H + +#if defined(__VIS__) && __VIS__ >= 0x300 +#define use_vis3_instructions 1 +#else +extern bool use_vis3_instructions; +#endif + +/* optional instructions */ +#define TCG_TARGET_HAS_div_i32 1 +#define TCG_TARGET_HAS_rem_i32 0 +#define TCG_TARGET_HAS_rot_i32 0 +#define TCG_TARGET_HAS_ext8s_i32 0 +#define TCG_TARGET_HAS_ext16s_i32 0 +#define TCG_TARGET_HAS_ext8u_i32 0 +#define TCG_TARGET_HAS_ext16u_i32 0 +#define TCG_TARGET_HAS_bswap16_i32 0 +#define TCG_TARGET_HAS_bswap32_i32 0 +#define TCG_TARGET_HAS_not_i32 1 +#define TCG_TARGET_HAS_andc_i32 1 +#define TCG_TARGET_HAS_orc_i32 1 +#define TCG_TARGET_HAS_eqv_i32 0 +#define TCG_TARGET_HAS_nand_i32 0 +#define TCG_TARGET_HAS_nor_i32 0 +#define TCG_TARGET_HAS_clz_i32 0 +#define TCG_TARGET_HAS_ctz_i32 0 +#define TCG_TARGET_HAS_ctpop_i32 0 +#define TCG_TARGET_HAS_deposit_i32 0 +#define TCG_TARGET_HAS_extract_i32 0 +#define TCG_TARGET_HAS_sextract_i32 0 +#define TCG_TARGET_HAS_extract2_i32 0 +#define TCG_TARGET_HAS_negsetcond_i32 1 +#define TCG_TARGET_HAS_add2_i32 1 +#define TCG_TARGET_HAS_sub2_i32 1 +#define TCG_TARGET_HAS_mulu2_i32 1 +#define TCG_TARGET_HAS_muls2_i32 1 +#define TCG_TARGET_HAS_muluh_i32 0 +#define TCG_TARGET_HAS_mulsh_i32 0 +#define TCG_TARGET_HAS_qemu_st8_i32 0 + +#define TCG_TARGET_HAS_extr_i64_i32 0 +#define TCG_TARGET_HAS_div_i64 1 +#define TCG_TARGET_HAS_rem_i64 0 +#define TCG_TARGET_HAS_rot_i64 0 +#define TCG_TARGET_HAS_ext8s_i64 0 +#define TCG_TARGET_HAS_ext16s_i64 0 +#define TCG_TARGET_HAS_ext32s_i64 1 +#define TCG_TARGET_HAS_ext8u_i64 0 +#define TCG_TARGET_HAS_ext16u_i64 0 +#define TCG_TARGET_HAS_ext32u_i64 1 +#define TCG_TARGET_HAS_bswap16_i64 0 +#define TCG_TARGET_HAS_bswap32_i64 0 +#define TCG_TARGET_HAS_bswap64_i64 0 +#define TCG_TARGET_HAS_not_i64 1 +#define TCG_TARGET_HAS_andc_i64 1 +#define TCG_TARGET_HAS_orc_i64 1 +#define TCG_TARGET_HAS_eqv_i64 0 +#define TCG_TARGET_HAS_nand_i64 0 +#define TCG_TARGET_HAS_nor_i64 0 +#define TCG_TARGET_HAS_clz_i64 0 +#define TCG_TARGET_HAS_ctz_i64 0 +#define TCG_TARGET_HAS_ctpop_i64 0 +#define TCG_TARGET_HAS_deposit_i64 0 +#define TCG_TARGET_HAS_extract_i64 0 +#define TCG_TARGET_HAS_sextract_i64 0 +#define TCG_TARGET_HAS_extract2_i64 0 +#define TCG_TARGET_HAS_negsetcond_i64 1 +#define TCG_TARGET_HAS_add2_i64 1 +#define TCG_TARGET_HAS_sub2_i64 1 +#define TCG_TARGET_HAS_mulu2_i64 0 +#define TCG_TARGET_HAS_muls2_i64 0 +#define TCG_TARGET_HAS_muluh_i64 use_vis3_instructions +#define TCG_TARGET_HAS_mulsh_i64 0 + +#define TCG_TARGET_HAS_qemu_ldst_i128 0 + +#define TCG_TARGET_HAS_tst 1 + +#endif diff --git a/tcg/sparc64/tcg-target.h b/tcg/sparc64/tcg-target.h index b560d43ed54..14621446312 100644 --- a/tcg/sparc64/tcg-target.h +++ b/tcg/sparc64/tcg-target.h @@ -64,84 +64,10 @@ typedef enum { TCG_REG_I7, } TCGReg; -#if defined(__VIS__) && __VIS__ >= 0x300 -#define use_vis3_instructions 1 -#else -extern bool use_vis3_instructions; -#endif - -/* optional instructions */ -#define TCG_TARGET_HAS_div_i32 1 -#define TCG_TARGET_HAS_rem_i32 0 -#define TCG_TARGET_HAS_rot_i32 0 -#define TCG_TARGET_HAS_ext8s_i32 0 -#define TCG_TARGET_HAS_ext16s_i32 0 -#define TCG_TARGET_HAS_ext8u_i32 0 -#define TCG_TARGET_HAS_ext16u_i32 0 -#define TCG_TARGET_HAS_bswap16_i32 0 -#define TCG_TARGET_HAS_bswap32_i32 0 -#define TCG_TARGET_HAS_not_i32 1 -#define TCG_TARGET_HAS_andc_i32 1 -#define TCG_TARGET_HAS_orc_i32 1 -#define TCG_TARGET_HAS_eqv_i32 0 -#define TCG_TARGET_HAS_nand_i32 0 -#define TCG_TARGET_HAS_nor_i32 0 -#define TCG_TARGET_HAS_clz_i32 0 -#define TCG_TARGET_HAS_ctz_i32 0 -#define TCG_TARGET_HAS_ctpop_i32 0 -#define TCG_TARGET_HAS_deposit_i32 0 -#define TCG_TARGET_HAS_extract_i32 0 -#define TCG_TARGET_HAS_sextract_i32 0 -#define TCG_TARGET_HAS_extract2_i32 0 -#define TCG_TARGET_HAS_negsetcond_i32 1 -#define TCG_TARGET_HAS_add2_i32 1 -#define TCG_TARGET_HAS_sub2_i32 1 -#define TCG_TARGET_HAS_mulu2_i32 1 -#define TCG_TARGET_HAS_muls2_i32 1 -#define TCG_TARGET_HAS_muluh_i32 0 -#define TCG_TARGET_HAS_mulsh_i32 0 -#define TCG_TARGET_HAS_qemu_st8_i32 0 - -#define TCG_TARGET_HAS_extr_i64_i32 0 -#define TCG_TARGET_HAS_div_i64 1 -#define TCG_TARGET_HAS_rem_i64 0 -#define TCG_TARGET_HAS_rot_i64 0 -#define TCG_TARGET_HAS_ext8s_i64 0 -#define TCG_TARGET_HAS_ext16s_i64 0 -#define TCG_TARGET_HAS_ext32s_i64 1 -#define TCG_TARGET_HAS_ext8u_i64 0 -#define TCG_TARGET_HAS_ext16u_i64 0 -#define TCG_TARGET_HAS_ext32u_i64 1 -#define TCG_TARGET_HAS_bswap16_i64 0 -#define TCG_TARGET_HAS_bswap32_i64 0 -#define TCG_TARGET_HAS_bswap64_i64 0 -#define TCG_TARGET_HAS_not_i64 1 -#define TCG_TARGET_HAS_andc_i64 1 -#define TCG_TARGET_HAS_orc_i64 1 -#define TCG_TARGET_HAS_eqv_i64 0 -#define TCG_TARGET_HAS_nand_i64 0 -#define TCG_TARGET_HAS_nor_i64 0 -#define TCG_TARGET_HAS_clz_i64 0 -#define TCG_TARGET_HAS_ctz_i64 0 -#define TCG_TARGET_HAS_ctpop_i64 0 -#define TCG_TARGET_HAS_deposit_i64 0 -#define TCG_TARGET_HAS_extract_i64 0 -#define TCG_TARGET_HAS_sextract_i64 0 -#define TCG_TARGET_HAS_extract2_i64 0 -#define TCG_TARGET_HAS_negsetcond_i64 1 -#define TCG_TARGET_HAS_add2_i64 1 -#define TCG_TARGET_HAS_sub2_i64 1 -#define TCG_TARGET_HAS_mulu2_i64 0 -#define TCG_TARGET_HAS_muls2_i64 0 -#define TCG_TARGET_HAS_muluh_i64 use_vis3_instructions -#define TCG_TARGET_HAS_mulsh_i64 0 - -#define TCG_TARGET_HAS_qemu_ldst_i128 0 - -#define TCG_TARGET_HAS_tst 1 - #define TCG_AREG0 TCG_REG_I0 +#include "tcg-target-has.h" + #define TCG_TARGET_DEFAULT_MO (0) #endif From patchwork Wed Jan 8 21:51:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 855728 Delivered-To: patch@linaro.org Received: by 2002:adf:8b05:0:b0:385:e875:8a9e with SMTP id n5csp942932wra; Wed, 8 Jan 2025 13:53:45 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWplYhqfF90nr5e4zheUkjTjhR1BLxPxyzXs3Mt/31CpbcBb6rgp1psrCbjy2OUONxATwkcKA==@linaro.org X-Google-Smtp-Source: AGHT+IGaqpcP1qLJTTPDg6VXoGPbDlBO5+ElnM41Sxnb4vMLV0uTkwNOOjocEvyyZPPsqgMB5+zY X-Received: by 2002:a05:620a:2548:b0:7b6:dc4f:887c with SMTP id af79cd13be357-7bcd97cc90cmr590420485a.57.1736373225113; Wed, 08 Jan 2025 13:53:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736373225; cv=none; d=google.com; s=arc-20240605; b=Udm17VlQUd8vzYpGnfTTDvV5/l070dQ2pfUcwXaVgSIoT2gk3GlWC6f1dzIb38myIF hUV4P5kEMUj3Dzqw95YPw7/XIkoVOlsbMhfQ4gUt8OUGMRnUYh/twyQIDOyWNrm3JEyo ugw/y6H41m2z0tXQGgywROnp0p1/gm/idNKxULRHbHhD7k12bt1cwfvqfps6RI3lR86S SrpG5LGzmzyRJAgRfMx0gooVJsMu5f/50sKdEpLcEZbcI0YwCogOsfjGo9NSffxP/R42 m5co1qtPZSIAne7pNErucK30QFD6A6xyd2Sd6WpW6kPYIrIwBS2hrDwvwzy4sHrkH19w sAFQ== 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=PglmWIQ6EP3DNsd7PARfUW9vAcAZ+ITLQgm4ilFtvBg=; fh=I/t+CGVRTvnlN+c1H2rL+bfx7DSzSdCxz00w+BTRVdo=; b=Mb8srSiLIPOGRgbO0XQ2uWH3IP8+jeaDUZbUSiAC7wcAZ6m3D+qpjLcZMNWK8yItWL Q2l3wxHG3kTniaw4N+EFMdD+Fmln6cowqKeaPEjFufmpl2y9KMGLXz3o0WhD1MnwKdIi IzV3YsVct9awt0Ef7Z3q4sWmh+hrq/21xnHAJQXTOU+MUE3LoPyBTBefA7vp2FI1kJn7 XEuTp/kl6MoLHTiAjWFSgBAg4GmIClIhv5tTncgql2h8b4yhaiE+6UHXzz0af0s++S7V yt2wQpMku9OUjq9xkX0qGWD8TDF1no9CrMmEAW8/Bi9R2Dve9jRnMasMVWNc6jt4zYA7 K43A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="NGT/xLIR"; 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 af79cd13be357-7bce35096b5si5313985a.513.2025.01.08.13.53.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 Jan 2025 13:53:45 -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="NGT/xLIR"; 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 1tVdz1-0001u8-GZ; Wed, 08 Jan 2025 16:52:59 -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 1tVdz0-0001pA-Tp for qemu-devel@nongnu.org; Wed, 08 Jan 2025 16:52:58 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tVdyz-00046H-13 for qemu-devel@nongnu.org; Wed, 08 Jan 2025 16:52:58 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-436a03197b2so2291345e9.2 for ; Wed, 08 Jan 2025 13:52:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736373175; x=1736977975; 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=PglmWIQ6EP3DNsd7PARfUW9vAcAZ+ITLQgm4ilFtvBg=; b=NGT/xLIR0KEx7Y8el/TAx6pi6HiK+XAmBdAyfi4SSMs8LI4URa3hE2jQa5eVqUh86a UfztghlUJ1xdlUyQIMteC8dYgystZId5v2dOlXl5F3X+keu3IFBpYKsOEVv20l8DEZ97 NnlvofK+hScymoIw9oEeeHBdnftnd8spFSvtfj8RkdXIMmuMhiP1lsNGdDllF2vJgG7b ZlFvgbZ9BOkhP+srHtM02mFjocUXqSRqLtg0qTiCV9N4EF41NDCQeBGm2Y3kgquAjr7d z9mksOcWXPB7Ja4jHDz47iC8Pb8TUUxiod+SGWrSzuV6vK19Wb7P+q6UzSik1HA1uEcw E1CQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736373175; x=1736977975; 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=PglmWIQ6EP3DNsd7PARfUW9vAcAZ+ITLQgm4ilFtvBg=; b=rJ+0SoK/7K9LLI9FWkCiWq2p6JhlDBY4/A60WuxItQVZoSvcM+RCIqv7s2+UcRt6/m d1kF3+M2/8ADJ38LMDNuK+iwJjKICXlF5Tam8G/gghMcmfHWJMsXfp+M9nCW1e4e19wQ u8oHk68MS8ZN4N+9TZHh4LCyBOg+OPyg1k3PwRZ3tZBAjFOTCOQHWVq/LmOdohz/18VC EkovBrlQiMsMS05L3hXrIDMo1B2bnptKVemXSAhlahlzGJizPU3pFH8yrcE8mIK0FDgw AmLjfcEmob7No7WL9LWGuRamgwjllDpfjwxuBLmDu1XRaW9te/Kp2zO5MLbHUsTHRwLg CzPw== X-Gm-Message-State: AOJu0YyeekVqKehqqW55NgUTd3AsPLWCoR6A06M/YuFFQ13wSYpOYDwV L9U4RXnE+OEKFA4iHQsyeJQlTd1Hz0RlygNXfeIEjnyGiPeeHgbcwMma+U2N1zYKdEmQEA08RNZ cOCE= X-Gm-Gg: ASbGncuuqp6wNCnowZZf8kX0M6/3hYkA/9g5a9NA9MPqfDobrOsRsCgHMQCE/OxPj2Z 7LseISuWAeY0ryu9sbGrP4pf1ytZrWXevyzU0VH2WxoSRvE6/wEU51dFf0tg/cVqQmtkCY/YQmR bRAMlBuEbIPATh4V/ZTUDIz4tJITyRUQjmDbuMQeYWB7Us7Et9iZ3QayhaVUIp1bjbns71kapCk fDkmhjUdAfLWi2bUChkp0RGNBj5TV8YqEFXLkTrqbMwTYpZc1H+SuX/schQ31iJGWP0UbzHRAVv X9kmuVNHqEZMLqYzmuMpUaOeN/IKck4= X-Received: by 2002:a5d:64a3:0:b0:388:da2a:e48 with SMTP id ffacd0b85a97d-38a872e1554mr3704419f8f.23.1736373175124; Wed, 08 Jan 2025 13:52:55 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e37d154sm10142f8f.10.2025.01.08.13.52.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 08 Jan 2025 13:52:54 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: pierrick.bouvier@linaro.org, Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH v3 12/14] tcg/tci: Extract TCG_TARGET_HAS_foo defs to 'tcg-target-has.h' Date: Wed, 8 Jan 2025 22:51:53 +0100 Message-ID: <20250108215156.8731-13-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250108215156.8731-1-philmd@linaro.org> References: <20250107080112.1175095-19-richard.henderson@linaro.org> <20250108215156.8731-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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 From: Richard Henderson Signed-off-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- tcg/tci/tcg-target-has.h | 83 ++++++++++++++++++++++++++++++++++++++++ tcg/tci/tcg-target.h | 75 +----------------------------------- 2 files changed, 84 insertions(+), 74 deletions(-) create mode 100644 tcg/tci/tcg-target-has.h diff --git a/tcg/tci/tcg-target-has.h b/tcg/tci/tcg-target-has.h new file mode 100644 index 00000000000..33974039102 --- /dev/null +++ b/tcg/tci/tcg-target-has.h @@ -0,0 +1,83 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Define target-specific opcode support + * Copyright (c) 2009, 2011 Stefan Weil + */ + +#ifndef TCG_TARGET_HAS_H +#define TCG_TARGET_HAS_H + +#define TCG_TARGET_HAS_bswap16_i32 1 +#define TCG_TARGET_HAS_bswap32_i32 1 +#define TCG_TARGET_HAS_div_i32 1 +#define TCG_TARGET_HAS_rem_i32 1 +#define TCG_TARGET_HAS_ext8s_i32 1 +#define TCG_TARGET_HAS_ext16s_i32 1 +#define TCG_TARGET_HAS_ext8u_i32 1 +#define TCG_TARGET_HAS_ext16u_i32 1 +#define TCG_TARGET_HAS_andc_i32 1 +#define TCG_TARGET_HAS_deposit_i32 1 +#define TCG_TARGET_HAS_extract_i32 1 +#define TCG_TARGET_HAS_sextract_i32 1 +#define TCG_TARGET_HAS_extract2_i32 0 +#define TCG_TARGET_HAS_eqv_i32 1 +#define TCG_TARGET_HAS_nand_i32 1 +#define TCG_TARGET_HAS_nor_i32 1 +#define TCG_TARGET_HAS_clz_i32 1 +#define TCG_TARGET_HAS_ctz_i32 1 +#define TCG_TARGET_HAS_ctpop_i32 1 +#define TCG_TARGET_HAS_not_i32 1 +#define TCG_TARGET_HAS_orc_i32 1 +#define TCG_TARGET_HAS_rot_i32 1 +#define TCG_TARGET_HAS_negsetcond_i32 0 +#define TCG_TARGET_HAS_muls2_i32 1 +#define TCG_TARGET_HAS_muluh_i32 0 +#define TCG_TARGET_HAS_mulsh_i32 0 +#define TCG_TARGET_HAS_qemu_st8_i32 0 + +#if TCG_TARGET_REG_BITS == 64 +#define TCG_TARGET_HAS_extr_i64_i32 0 +#define TCG_TARGET_HAS_bswap16_i64 1 +#define TCG_TARGET_HAS_bswap32_i64 1 +#define TCG_TARGET_HAS_bswap64_i64 1 +#define TCG_TARGET_HAS_deposit_i64 1 +#define TCG_TARGET_HAS_extract_i64 1 +#define TCG_TARGET_HAS_sextract_i64 1 +#define TCG_TARGET_HAS_extract2_i64 0 +#define TCG_TARGET_HAS_div_i64 1 +#define TCG_TARGET_HAS_rem_i64 1 +#define TCG_TARGET_HAS_ext8s_i64 1 +#define TCG_TARGET_HAS_ext16s_i64 1 +#define TCG_TARGET_HAS_ext32s_i64 1 +#define TCG_TARGET_HAS_ext8u_i64 1 +#define TCG_TARGET_HAS_ext16u_i64 1 +#define TCG_TARGET_HAS_ext32u_i64 1 +#define TCG_TARGET_HAS_andc_i64 1 +#define TCG_TARGET_HAS_eqv_i64 1 +#define TCG_TARGET_HAS_nand_i64 1 +#define TCG_TARGET_HAS_nor_i64 1 +#define TCG_TARGET_HAS_clz_i64 1 +#define TCG_TARGET_HAS_ctz_i64 1 +#define TCG_TARGET_HAS_ctpop_i64 1 +#define TCG_TARGET_HAS_not_i64 1 +#define TCG_TARGET_HAS_orc_i64 1 +#define TCG_TARGET_HAS_rot_i64 1 +#define TCG_TARGET_HAS_negsetcond_i64 0 +#define TCG_TARGET_HAS_muls2_i64 1 +#define TCG_TARGET_HAS_add2_i32 1 +#define TCG_TARGET_HAS_sub2_i32 1 +#define TCG_TARGET_HAS_mulu2_i32 1 +#define TCG_TARGET_HAS_add2_i64 1 +#define TCG_TARGET_HAS_sub2_i64 1 +#define TCG_TARGET_HAS_mulu2_i64 1 +#define TCG_TARGET_HAS_muluh_i64 0 +#define TCG_TARGET_HAS_mulsh_i64 0 +#else +#define TCG_TARGET_HAS_mulu2_i32 1 +#endif /* TCG_TARGET_REG_BITS == 64 */ + +#define TCG_TARGET_HAS_qemu_ldst_i128 0 + +#define TCG_TARGET_HAS_tst 1 + +#endif diff --git a/tcg/tci/tcg-target.h b/tcg/tci/tcg-target.h index d7650343a3b..899d9861a64 100644 --- a/tcg/tci/tcg-target.h +++ b/tcg/tci/tcg-target.h @@ -44,80 +44,7 @@ #define TCG_TARGET_INSN_UNIT_SIZE 4 #define MAX_CODE_GEN_BUFFER_SIZE ((size_t)-1) -/* Optional instructions. */ - -#define TCG_TARGET_HAS_bswap16_i32 1 -#define TCG_TARGET_HAS_bswap32_i32 1 -#define TCG_TARGET_HAS_div_i32 1 -#define TCG_TARGET_HAS_rem_i32 1 -#define TCG_TARGET_HAS_ext8s_i32 1 -#define TCG_TARGET_HAS_ext16s_i32 1 -#define TCG_TARGET_HAS_ext8u_i32 1 -#define TCG_TARGET_HAS_ext16u_i32 1 -#define TCG_TARGET_HAS_andc_i32 1 -#define TCG_TARGET_HAS_deposit_i32 1 -#define TCG_TARGET_HAS_extract_i32 1 -#define TCG_TARGET_HAS_sextract_i32 1 -#define TCG_TARGET_HAS_extract2_i32 0 -#define TCG_TARGET_HAS_eqv_i32 1 -#define TCG_TARGET_HAS_nand_i32 1 -#define TCG_TARGET_HAS_nor_i32 1 -#define TCG_TARGET_HAS_clz_i32 1 -#define TCG_TARGET_HAS_ctz_i32 1 -#define TCG_TARGET_HAS_ctpop_i32 1 -#define TCG_TARGET_HAS_not_i32 1 -#define TCG_TARGET_HAS_orc_i32 1 -#define TCG_TARGET_HAS_rot_i32 1 -#define TCG_TARGET_HAS_negsetcond_i32 0 -#define TCG_TARGET_HAS_muls2_i32 1 -#define TCG_TARGET_HAS_muluh_i32 0 -#define TCG_TARGET_HAS_mulsh_i32 0 -#define TCG_TARGET_HAS_qemu_st8_i32 0 - -#if TCG_TARGET_REG_BITS == 64 -#define TCG_TARGET_HAS_extr_i64_i32 0 -#define TCG_TARGET_HAS_bswap16_i64 1 -#define TCG_TARGET_HAS_bswap32_i64 1 -#define TCG_TARGET_HAS_bswap64_i64 1 -#define TCG_TARGET_HAS_deposit_i64 1 -#define TCG_TARGET_HAS_extract_i64 1 -#define TCG_TARGET_HAS_sextract_i64 1 -#define TCG_TARGET_HAS_extract2_i64 0 -#define TCG_TARGET_HAS_div_i64 1 -#define TCG_TARGET_HAS_rem_i64 1 -#define TCG_TARGET_HAS_ext8s_i64 1 -#define TCG_TARGET_HAS_ext16s_i64 1 -#define TCG_TARGET_HAS_ext32s_i64 1 -#define TCG_TARGET_HAS_ext8u_i64 1 -#define TCG_TARGET_HAS_ext16u_i64 1 -#define TCG_TARGET_HAS_ext32u_i64 1 -#define TCG_TARGET_HAS_andc_i64 1 -#define TCG_TARGET_HAS_eqv_i64 1 -#define TCG_TARGET_HAS_nand_i64 1 -#define TCG_TARGET_HAS_nor_i64 1 -#define TCG_TARGET_HAS_clz_i64 1 -#define TCG_TARGET_HAS_ctz_i64 1 -#define TCG_TARGET_HAS_ctpop_i64 1 -#define TCG_TARGET_HAS_not_i64 1 -#define TCG_TARGET_HAS_orc_i64 1 -#define TCG_TARGET_HAS_rot_i64 1 -#define TCG_TARGET_HAS_negsetcond_i64 0 -#define TCG_TARGET_HAS_muls2_i64 1 -#define TCG_TARGET_HAS_add2_i32 1 -#define TCG_TARGET_HAS_sub2_i32 1 -#define TCG_TARGET_HAS_mulu2_i32 1 -#define TCG_TARGET_HAS_add2_i64 1 -#define TCG_TARGET_HAS_sub2_i64 1 -#define TCG_TARGET_HAS_mulu2_i64 1 -#define TCG_TARGET_HAS_muluh_i64 0 -#define TCG_TARGET_HAS_mulsh_i64 0 -#else -#define TCG_TARGET_HAS_mulu2_i32 1 -#endif /* TCG_TARGET_REG_BITS == 64 */ - -#define TCG_TARGET_HAS_qemu_ldst_i128 0 - -#define TCG_TARGET_HAS_tst 1 +#include "tcg-target-has.h" /* Number of registers available. */ #define TCG_TARGET_NB_REGS 16 From patchwork Wed Jan 8 21:51:54 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 855730 Delivered-To: patch@linaro.org Received: by 2002:adf:8b05:0:b0:385:e875:8a9e with SMTP id n5csp943016wra; Wed, 8 Jan 2025 13:54:04 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUaolqB99kAIqzwFbyKLr6Uu4xQPHhseH5AIeovW4IEZiTyuZ0DeFakHG9RQ/0aKQBV6Rh/BA==@linaro.org X-Google-Smtp-Source: AGHT+IHKOzXalYIElliWGJ9kERMUwWvQVudpGy14P3FrfukEPpXE78JBINfjFw6/kBmk8TimzT68 X-Received: by 2002:a05:620a:1a8d:b0:7b6:d393:c1fe with SMTP id af79cd13be357-7bcd9712507mr609722085a.26.1736373244023; Wed, 08 Jan 2025 13:54:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736373244; cv=none; d=google.com; s=arc-20240605; b=HqILElHF9i5c+HrSVQWaFmexMvYf+Bdw+OswsVOW7YeNW/zd94/aDevTj1dKMnL3Gj 34lZ63t+7oVTgpInCEAze0JOn73A/U1Av1qxfiA3OmH9aa6zhzLVBKEsnkgBfCVAqmvR OM2WgcJSL5fiuo6GQGIsyKEU+pRiQKvspRXh3oeZAIMFB6KOOHSvQYxCXi1pb81SN6Ta rwDzTSRqjqtZihKS8rek7xcOnSEWvp9PIDooWXVZg8j7kyoxPnHxcRlOmkrLASYPrEor Po/Cr+u2fXLMr+mYJt+rnbHelQd4aB+OHOZ4rqATyso+vFjb6b6g17JioPFerGnhLT1q 56CQ== 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=FsLWtZCOjZPcUD3UGuDmlfBcap3DKIAtzC/UGYLn7Ok=; fh=I/t+CGVRTvnlN+c1H2rL+bfx7DSzSdCxz00w+BTRVdo=; b=SH0reDktX1ZYnlpCi3IVZVqjY/kV23JcIqpYkpxGGOPEzDfxLNLiLrgxirTb7RqJPT fAyk7yVpZp/PPqK2hbV8hXIgirj7ywAQKN+tKvZr+0I1hVnqwdBL+FF89C4pMo1oKoSa 7A2YELgBEdTnCjAc18wVjmfL+qinJkBBxKCmy7zbAC2wTog7gERoDpFpxwsmrR3v81Oq gvf4wfY9nlXYblri261LM7+t9IUr5/iNItT8kqYjMAVo9DIZUT6iqKrFtKHjkWJgG+5C WSN0+koQiQfyyusBEcEiQ7Vqsn8ECubtcRcVj4IsG+h3c7yfiiBgNQv/XBHnU3+E99/R XcEQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AYBUjvBQ; 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 af79cd13be357-7bce3308694si5542285a.292.2025.01.08.13.54.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 Jan 2025 13:54:04 -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=AYBUjvBQ; 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 1tVdz7-0002aV-5A; Wed, 08 Jan 2025 16:53:05 -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 1tVdz5-0002QN-H1 for qemu-devel@nongnu.org; Wed, 08 Jan 2025 16:53:03 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tVdz3-00047D-Jk for qemu-devel@nongnu.org; Wed, 08 Jan 2025 16:53:03 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-436281c8a38so2332645e9.3 for ; Wed, 08 Jan 2025 13:53:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736373180; x=1736977980; 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=FsLWtZCOjZPcUD3UGuDmlfBcap3DKIAtzC/UGYLn7Ok=; b=AYBUjvBQ7vdXhMcyPzWh3z0dlslWstpK87eTeS+44AmG7iDlEVX2KdngdVtZZnQTrM iymqnJPngcaWa4NOBLHuMuG0VWRimPJ6ns/QXhZ2MQjhEbomYteZsyX5/2CGkJsEsKwq GnVpMqSpwV2hS+UYqrxAuoAuka8GuvTZnmT9mKxmVvR+cnPGtO8mEjTKcbWYJ/mz/8sX 6ZGSF+2PrWCPCs/Smw/3QMByEKPe+qrQyD5i1dHluhXDC8Iqa64kEkWSuMY7VPB6qc8K jTZvkmtC24nM/0ObnF/iCr6zaHYxSkWQyHbxwFONJOcHZqeycDA9wQtwwe109FQA+dY9 e4ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736373180; x=1736977980; 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=FsLWtZCOjZPcUD3UGuDmlfBcap3DKIAtzC/UGYLn7Ok=; b=jvDAvInHo+BYNTX5/ENCiCg/XgI0nXdoAAqQJ07MgVTjtAb7qmG6HbS1p8F8XVrHbW 7bu9U3u6fBH/XVfl9u6SeRoyQ0fUtY7hhWJ42+QLuclOhd32Oq1fSXPxP1Cq3nYt17xH 0NLG5iJyUTjgFPPJcuMgavB71iQP1KmnJBABvzNbnxUnmbppMV/q5eJx7yD63eTE9fhm BmQA3e0Re2/OjlnHwCKPAAxLpAiQuE7af+updNlyyZFpXvKGJ8HN4UhRvo8RP1W2GpNr DmdLn+DF/sGsTchN24CrMiha+ER55Hrhc0d6ehtHOQD5ehEZ3f0BDmg9xsJUcMOdpC3S oBGQ== X-Gm-Message-State: AOJu0YziH6sFNhbKdpQ6MBpuG+19rjo2TvqivpkDFnDMRxIGf/Xxp899 oHYq3acDhzJixAc5RVcnGTdAYs9zr7NjedpdW7iv59EmuNbek3yn1NvoR9JQujICgbKrfHkkz+X c7NQ= X-Gm-Gg: ASbGncscvLeYu/XpIkC6PwtCh2vjjxXi1wXlbW2XiyutA2nrDu+fa2I7Ds30fYk34AG uU37GrljC8bcihs9fCJLEzE0cACm5zh4eJ3zNC+Do9tWka/QEfp2XxcsGvuG9tfCR1F5dB1A90j cSJB3scY3OIYckcXSVw5N5WkdcQRlIApYx+RYKYgG1FMDypAIvnbyzg2pOjxp5Oqhbq5pGZ+vAw UUqJrdki2MZgRyE34aq8jNmoCh+H3WLH+xw/Iw5oCRy01xpwYvCUXIufyvtRP5Mi4jmOoLHTinZ hULcAkczDKBWUJV64E/IbnW3RVARLLU= X-Received: by 2002:a05:600c:229a:b0:434:fbd5:2f0a with SMTP id 5b1f17b1804b1-436e269a7a7mr39134595e9.9.1736373179667; Wed, 08 Jan 2025 13:52:59 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436dd14dfcasm50397675e9.1.2025.01.08.13.52.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 08 Jan 2025 13:52:59 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: pierrick.bouvier@linaro.org, Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH v3 13/14] tcg: Include 'tcg-target-has.h' once in 'tcg-has.h' Date: Wed, 8 Jan 2025 22:51:54 +0100 Message-ID: <20250108215156.8731-14-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250108215156.8731-1-philmd@linaro.org> References: <20250107080112.1175095-19-richard.henderson@linaro.org> <20250108215156.8731-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.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 From: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- tcg/aarch64/tcg-target.h | 2 -- tcg/arm/tcg-target.h | 2 -- tcg/i386/tcg-target.h | 2 -- tcg/loongarch64/tcg-target.h | 2 -- tcg/mips/tcg-target.h | 2 -- tcg/ppc/tcg-target.h | 2 -- tcg/riscv/tcg-target.h | 2 -- tcg/s390x/tcg-target.h | 2 -- tcg/sparc64/tcg-target.h | 2 -- tcg/tcg-has.h | 2 ++ tcg/tci/tcg-target.h | 2 -- 11 files changed, 2 insertions(+), 20 deletions(-) diff --git a/tcg/aarch64/tcg-target.h b/tcg/aarch64/tcg-target.h index 9a682e51a47..1ef8b2e300b 100644 --- a/tcg/aarch64/tcg-target.h +++ b/tcg/aarch64/tcg-target.h @@ -47,8 +47,6 @@ typedef enum { #define TCG_TARGET_NB_REGS 64 -#include "tcg-target-has.h" - #define TCG_TARGET_DEFAULT_MO (0) #endif /* AARCH64_TCG_TARGET_H */ diff --git a/tcg/arm/tcg-target.h b/tcg/arm/tcg-target.h index e114f7ddf40..21563e00f99 100644 --- a/tcg/arm/tcg-target.h +++ b/tcg/arm/tcg-target.h @@ -70,8 +70,6 @@ typedef enum { #define TCG_TARGET_NB_REGS 32 -#include "tcg-target-has.h" - #define TCG_TARGET_DEFAULT_MO (0) #endif diff --git a/tcg/i386/tcg-target.h b/tcg/i386/tcg-target.h index a1dfdeb28d4..e6d7fd526e2 100644 --- a/tcg/i386/tcg-target.h +++ b/tcg/i386/tcg-target.h @@ -88,8 +88,6 @@ typedef enum { TCG_REG_CALL_STACK = TCG_REG_ESP } TCGReg; -#include "tcg-target-has.h" - /* This defines the natural memory order supported by this * architecture before guarantees made by various barrier * instructions. diff --git a/tcg/loongarch64/tcg-target.h b/tcg/loongarch64/tcg-target.h index a3a6130720b..0432a4ebbd8 100644 --- a/tcg/loongarch64/tcg-target.h +++ b/tcg/loongarch64/tcg-target.h @@ -85,8 +85,6 @@ typedef enum { TCG_VEC_TMP0 = TCG_REG_V23, } TCGReg; -#include "tcg-target-has.h" - #define TCG_TARGET_DEFAULT_MO (0) #endif /* LOONGARCH_TCG_TARGET_H */ diff --git a/tcg/mips/tcg-target.h b/tcg/mips/tcg-target.h index a34765b3894..210044ca12d 100644 --- a/tcg/mips/tcg-target.h +++ b/tcg/mips/tcg-target.h @@ -70,8 +70,6 @@ typedef enum { TCG_AREG0 = TCG_REG_S8, } TCGReg; -#include "tcg-target-has.h" - #define TCG_TARGET_DEFAULT_MO 0 #endif diff --git a/tcg/ppc/tcg-target.h b/tcg/ppc/tcg-target.h index fa2cc281838..0bc13d7363a 100644 --- a/tcg/ppc/tcg-target.h +++ b/tcg/ppc/tcg-target.h @@ -53,8 +53,6 @@ typedef enum { TCG_AREG0 = TCG_REG_R27 } TCGReg; -#include "tcg-target-has.h" - #define TCG_TARGET_DEFAULT_MO (0) #endif diff --git a/tcg/riscv/tcg-target.h b/tcg/riscv/tcg-target.h index c710321bdb9..4c406624029 100644 --- a/tcg/riscv/tcg-target.h +++ b/tcg/riscv/tcg-target.h @@ -57,8 +57,6 @@ typedef enum { TCG_REG_TMP2 = TCG_REG_T4, } TCGReg; -#include "tcg-target-has.h" - #define TCG_TARGET_DEFAULT_MO (0) #endif diff --git a/tcg/s390x/tcg-target.h b/tcg/s390x/tcg-target.h index 220ed68b1f4..f790b770750 100644 --- a/tcg/s390x/tcg-target.h +++ b/tcg/s390x/tcg-target.h @@ -51,8 +51,6 @@ typedef enum TCGReg { #define TCG_TARGET_NB_REGS 64 -#include "tcg-target-has.h" - #define TCG_TARGET_DEFAULT_MO (TCG_MO_ALL & ~TCG_MO_ST_LD) #endif diff --git a/tcg/sparc64/tcg-target.h b/tcg/sparc64/tcg-target.h index 14621446312..5ecca5586b6 100644 --- a/tcg/sparc64/tcg-target.h +++ b/tcg/sparc64/tcg-target.h @@ -66,8 +66,6 @@ typedef enum { #define TCG_AREG0 TCG_REG_I0 -#include "tcg-target-has.h" - #define TCG_TARGET_DEFAULT_MO (0) #endif diff --git a/tcg/tcg-has.h b/tcg/tcg-has.h index c09ce13389e..65b6a0b0cf4 100644 --- a/tcg/tcg-has.h +++ b/tcg/tcg-has.h @@ -7,6 +7,8 @@ #ifndef TCG_HAS_H #define TCG_HAS_H +#include "tcg-target-has.h" + #if TCG_TARGET_REG_BITS == 32 /* Turn some undef macros into false macros. */ #define TCG_TARGET_HAS_extr_i64_i32 0 diff --git a/tcg/tci/tcg-target.h b/tcg/tci/tcg-target.h index 899d9861a64..fea92f7848a 100644 --- a/tcg/tci/tcg-target.h +++ b/tcg/tci/tcg-target.h @@ -44,8 +44,6 @@ #define TCG_TARGET_INSN_UNIT_SIZE 4 #define MAX_CODE_GEN_BUFFER_SIZE ((size_t)-1) -#include "tcg-target-has.h" - /* Number of registers available. */ #define TCG_TARGET_NB_REGS 16 From patchwork Wed Jan 8 21:51:55 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 855723 Delivered-To: patch@linaro.org Received: by 2002:adf:8b05:0:b0:385:e875:8a9e with SMTP id n5csp942848wra; Wed, 8 Jan 2025 13:53:25 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUIDHpfe3VKejmo8WZeFnoYEKKwyqp8EKAjHgnTELEgDL5PpWvHCQhGZwukEXiaDZAq5g5h6g==@linaro.org X-Google-Smtp-Source: AGHT+IHsrZncVPoat83e+h3RbVGULG+MZY3ZAkvqeV+emTy9QfrOx1q39aKtICXGCW0oPBb71GhD X-Received: by 2002:a05:6214:dcb:b0:6d4:243f:6c9c with SMTP id 6a1803df08f44-6df9b1cf2bbmr94668396d6.9.1736373205619; Wed, 08 Jan 2025 13:53:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736373205; cv=none; d=google.com; s=arc-20240605; b=QZCtrp5pZuTMsjAdQ9KTtcsVBM4rzebVmAg5WL7RR+AhksinNQQXPCI9/KKsGEGFba HARYv/C46asXEbr+J9TaxxajEi+62prleYD6CBfg2t4Sxunsd0vgsaUMtwakDsWM6i6c eVKff9QxCZLNI+OEdmlAOx79JnfdXTLFel2pIY1wdN3FNXMHcc3pU6VHTdHdK3mIkVwP 8rWCkSXaufLSfyQ8DvYWgK20CxLYkuB3cAzbb0XMRFmQHO68iZJ6fZKVPmSGTlVqzdUG TpmdTUJQcTxtG5E7tPPfgplodFWk/B74cA2FTboTNxVWQ8KrNbfMsEmaHyWg5GpUk41X fQTA== 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=I14qnECo8+uzGdRsFMt/ZzhPLYXzTCANqtsyIeVHtfw=; fh=I/t+CGVRTvnlN+c1H2rL+bfx7DSzSdCxz00w+BTRVdo=; b=Yi9va3NiVF3O4nKcXQ2lXkMp944GEclr59jFAjY+KSnOXmUkp4dgCfqODyxwA2RNaZ q4MtMW0Yao3I9z1mc2c4qt9KdEufsBYxBTZ4a1SuNv3NfzqwSUu31Pe1fkJMENRPoUq6 gGhc/IBPJ/CWeqPfT24U+JSbh4w/E4ndLtEHf+42vaNX8ciNDiPQVggsjNTYF8CrA9EE hQmqMOuiHoh5+Brlb/6TfPpQNEUyP3SwozDNDlnCStY3s/+jV9rniEwaOg3vQnlGnnLS /YfSKOLMJBNAC5huErGUjbR+yoo8nZS8l4L0ix6pYDa4XDx0ipXENpwmzVvedYN4KGGw RlPw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="ABvtw/P1"; 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 6a1803df08f44-6dd18236362si501471226d6.268.2025.01.08.13.53.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 Jan 2025 13:53:25 -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="ABvtw/P1"; 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 1tVdzC-0003BA-Ck; Wed, 08 Jan 2025 16:53:10 -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 1tVdz9-0002tx-UF for qemu-devel@nongnu.org; Wed, 08 Jan 2025 16:53:08 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tVdz8-00048U-66 for qemu-devel@nongnu.org; Wed, 08 Jan 2025 16:53:07 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-4361b0ec57aso3253955e9.0 for ; Wed, 08 Jan 2025 13:53:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736373184; x=1736977984; 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=I14qnECo8+uzGdRsFMt/ZzhPLYXzTCANqtsyIeVHtfw=; b=ABvtw/P1nInhsWYbtdRi3dP6WLqS80T+u6y5+tqMYZUZZQj6DJeJm8ZR69ksuoivK/ zm+QfslDsIx/BAqJy7gBiu9t0nNxlsC3+6h9PBuYtd/b+enNY+dVcbedaq7XB9kOYIBz 8bDxZ7SAo8Ujzz5TGnExIjjJ8u2PpJlFPuGXwZ1Red8evIN+HkRFR4rkVhD96t7XhFYX EjLb0fTOM3O6ivAwQ7oLPwFyJDG4uxnBLDcVODNMitwZB4kMVQVmTgq8SMRLdhzGScgu S7/uLxjuBofqfFCs/gijo0XDgbWgpodbhuTSBn9ZhWVyEcc76dh30jj42gXq9pa+lTNo 8D1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736373184; x=1736977984; 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=I14qnECo8+uzGdRsFMt/ZzhPLYXzTCANqtsyIeVHtfw=; b=RvaxjGN/2E1T9sMF9aWPG5kiaWayCypEe2gEu0wURG6FsZL3acxOkgkGVZirX6hbgT YIPg5x2fFi8aa7X+me8jmxU8qtmmnCpx3DSxOFcBF9HiXQNvl/YHY1pe/nUvb7NKVFOg hZRsn5fY/w3YN9cjNz9DFzCtZxkYRAsH9YtoDEaF1sllRPhzGmvoo635Eg5IEQxtU+P3 k9XMPdLSCgTq10fNiOOpDLr4YvPe5YJxBQNEtQ/pm8+/sj5yoJJp2pCqFP/69eB29AHT RpW6LnaTEw2XpEyq/l2s3KH/jINzJo3hPXRR/e0G/wlVCabJKeiweCjYmsGG3R6sm2v8 mj6A== X-Gm-Message-State: AOJu0YxhcpAnrlU3QdtFfQGkz/7HgIWmoMOuEQpBPGfe9JbF5XS8T//D Pq9GCB6o0/IZbItDp746pU4LpCPEML23Lq9zFz5IweOabLnWwUzbbQ0aSaAzz3SjoH//JoYWSnr St3U= X-Gm-Gg: ASbGncuxWLP3LOZ93aWXN9fxBO+nhlU0CC3aUCL70sitd7vsRpeTmTE04pj9DOqjXTf zYwasLyy07Xz0m/EmRRquSiK/bzmDrDWZgO+VPRugpJ4zR3rbNhk9cJACWKsv8uEdEecI6h/8WO pw94WO1qloWKL8LFybdGU6k3+GbfqIri1JO5igYH6ncQklXYR6A2oaYlg6SslTY3X98VMBDAjTM 15WVHDfaJnYdLSkUUYYN581tZlU5XoDQWEl2awrSUa6Wr//BGONQ1AWoEVeDlNavnlY8qSUwC6S nv/y6TyThKqS1iqxZ7ERPfULRUKybwo= X-Received: by 2002:a05:6000:1f81:b0:385:fb56:5596 with SMTP id ffacd0b85a97d-38a872de1e4mr3468651f8f.19.1736373184314; Wed, 08 Jan 2025 13:53:04 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e320329sm32127f8f.0.2025.01.08.13.53.03 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 08 Jan 2025 13:53:03 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: pierrick.bouvier@linaro.org, Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH v3 14/14] tcg: Only include 'tcg-has.h' when necessary Date: Wed, 8 Jan 2025 22:51:55 +0100 Message-ID: <20250108215156.8731-15-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250108215156.8731-1-philmd@linaro.org> References: <20250107080112.1175095-19-richard.henderson@linaro.org> <20250108215156.8731-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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 From: Richard Henderson TCG_TARGET_HAS_* definitions don't need to be exposed by "tcg/tcg.h". Only include 'tcg-has.h' when necessary. Signed-off-by: Philippe Mathieu-Daudé --- include/tcg/tcg.h | 2 -- tcg/optimize.c | 1 + tcg/tcg-common.c | 1 + tcg/tcg-op-gvec.c | 1 + tcg/tcg-op-ldst.c | 2 +- tcg/tcg-op-vec.c | 1 + tcg/tcg-op.c | 2 +- tcg/tcg.c | 1 + tcg/tci.c | 1 + 9 files changed, 8 insertions(+), 4 deletions(-) diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index 3897c2d6b28..4406fc6be01 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -64,8 +64,6 @@ typedef uint64_t TCGRegSet; #error unsupported #endif -#include "tcg/tcg-has.h" - typedef enum TCGOpcode { #define DEF(name, oargs, iargs, cargs, flags) INDEX_op_ ## name, #include "tcg/tcg-opc.h" diff --git a/tcg/optimize.c b/tcg/optimize.c index 6823569ee2b..c363c5c04be 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -28,6 +28,7 @@ #include "qemu/interval-tree.h" #include "tcg/tcg-op-common.h" #include "tcg-internal.h" +#include "tcg-has.h" #define CASE_OP_32_64(x) \ glue(glue(case INDEX_op_, x), _i32): \ diff --git a/tcg/tcg-common.c b/tcg/tcg-common.c index 35e7616ae95..fadc33c3d1b 100644 --- a/tcg/tcg-common.c +++ b/tcg/tcg-common.c @@ -24,6 +24,7 @@ #include "qemu/osdep.h" #include "tcg/tcg.h" +#include "tcg-has.h" TCGOpDef tcg_op_defs[] = { #define DEF(s, oargs, iargs, cargs, flags) \ diff --git a/tcg/tcg-op-gvec.c b/tcg/tcg-op-gvec.c index 97e4df221a4..d32a4f146dc 100644 --- a/tcg/tcg-op-gvec.c +++ b/tcg/tcg-op-gvec.c @@ -23,6 +23,7 @@ #include "tcg/tcg-op-common.h" #include "tcg/tcg-op-gvec-common.h" #include "tcg/tcg-gvec-desc.h" +#include "tcg-has.h" #define MAX_UNROLL 4 diff --git a/tcg/tcg-op-ldst.c b/tcg/tcg-op-ldst.c index 0d8fe3b4f5d..ec3ef4dcb4d 100644 --- a/tcg/tcg-op-ldst.c +++ b/tcg/tcg-op-ldst.c @@ -30,7 +30,7 @@ #include "exec/translation-block.h" #include "exec/plugin-gen.h" #include "tcg-internal.h" - +#include "tcg-has.h" static void check_max_alignment(unsigned a_bits) { diff --git a/tcg/tcg-op-vec.c b/tcg/tcg-op-vec.c index 364cd089df3..893d68e7d80 100644 --- a/tcg/tcg-op-vec.c +++ b/tcg/tcg-op-vec.c @@ -23,6 +23,7 @@ #include "tcg/tcg-op-common.h" #include "tcg/tcg-mo.h" #include "tcg-internal.h" +#include "tcg-has.h" /* * Vector optional opcode tracking. diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index 872fb22ef8d..ab5ccd8dcb6 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -29,7 +29,7 @@ #include "exec/translation-block.h" #include "exec/plugin-gen.h" #include "tcg-internal.h" - +#include "tcg-has.h" /* * Encourage the compiler to tail-call to a function, rather than inlining. diff --git a/tcg/tcg.c b/tcg/tcg.c index 505e43c1289..3576299a1c7 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -56,6 +56,7 @@ #include "tcg/tcg-temp-internal.h" #include "tcg-internal.h" #include "tcg/perf.h" +#include "tcg-has.h" #ifdef CONFIG_USER_ONLY #include "user/guest-base.h" #endif diff --git a/tcg/tci.c b/tcg/tci.c index 3eb95e20b65..39a68db287f 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -22,6 +22,7 @@ #include "tcg/helper-info.h" #include "tcg/tcg-ldst.h" #include "disas/dis-asm.h" +#include "tcg-has.h" #include