From patchwork Mon May 27 21:18:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 799259 Delivered-To: patch@linaro.org Received: by 2002:a5d:6a08:0:b0:354:fb4b:99cd with SMTP id m8csp26371wru; Mon, 27 May 2024 14:21:59 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXZFPTY0oHmRWnkRDFDaA6JUDm/ioRTLK0v6Af+NlLhqbEZwZqVaa08jiexhC6iayCJW+nKRghSYID1mhi3a3di X-Google-Smtp-Source: AGHT+IH0Ws0kVHdVH0hzTR/VwPdOykaSg9secYkeVzyyUsuUmOwXgYOXPfutmMJRTD42AvraO0AH X-Received: by 2002:ae9:e31a:0:b0:792:a5a7:b00 with SMTP id af79cd13be357-794ab0817cbmr865800785a.19.1716844918897; Mon, 27 May 2024 14:21:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716844918; cv=none; d=google.com; s=arc-20160816; b=Jx04gMeKibaZYv75bzkHnH5Bbv3NjgNg7w5AjdmlxQUxlC/bwiyRBJwZ49X/xQrx42 VMetUe4umuaXv7Lr4R47pJ063qDIUG9Mtz7Bd1Pe8YvhYxZXQ6Dg56DB8g03rUrbBddz ++FnNy7AoQQRoNjCI7RiCZu7gCwpmtMAJXORL7WDkNcpd3VIdvkSOQJhpe0bGo6BFpEu 51cP5ESmoDQqIrM1ntBNusps04bxJtvquIOpl7SoL5XOuupP8ZB8kPhMWOIYNEbIuQVw EOz7U8faDA4m8vYNZDXQ7rPF2d9dA/DqGABHHjKQ6oafwOLP3qkyZZzpHicITgGvDJCz 0o4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=IdSVTA5LkaFXZvFnPRCfopV2vzBYraHKbEAZY4LzgSs=; fh=hzNNYKTacOnX/pFrTgMTyElWGK9kyvH1o007fnxf7fU=; b=sRN8N2qTBF/VKAWFzs289d3peEjJjI4yvCuwMpCNOkmpJ54n0dD39VQxakqX/FUsq8 fwyKxa7mz/qXScoEopW5RYF2yL6ho5Q9wukV6YTr00vX1SXND0ChZAwUX/4PzDJLG8mD Q/8h8k1Y07HC2oF/FdyysIsa05hvA223P2S/zpWcqVZndO+FCOUgQYWtjdi3nT8JBkfx nyXsapXoL3/MKD5qgF1VacwXx/zIN0NvjVzB5DzRZiqFi1deyYFN3QOA+ifOgRH+6KqS FEoj4gkvk/Suh430Ao0yU+TSD9aLetZE1S043WTh3IXDpP5cGlu1Jf5QVBbJmIDH8Pik nCpA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eeqSYqxz; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-794abd3adebsi870348385a.407.2024.05.27.14.21.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 May 2024 14:21:58 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eeqSYqxz; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sBhkZ-0007AY-6k; Mon, 27 May 2024 17:19:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sBhkX-00079K-Hj for qemu-devel@nongnu.org; Mon, 27 May 2024 17:19:21 -0400 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sBhkV-0003cy-Tg for qemu-devel@nongnu.org; Mon, 27 May 2024 17:19:21 -0400 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-6f69422c090so106607b3a.2 for ; Mon, 27 May 2024 14:19:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716844759; x=1717449559; 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=IdSVTA5LkaFXZvFnPRCfopV2vzBYraHKbEAZY4LzgSs=; b=eeqSYqxzxeAkWyp7zNxiGwHrjWwKb3LkAZNz4be4ooObyrAH7mR1QT9fDEpVmJOkJw jkLZFziGFiiSZOqQo4rrwCjLRmvE4L0Mw0Cr42tJD+f5TOn/gdOOrrtD1517uvwisMH3 EL2LaHzyvuEEnWtrOM1WNMWsU0ZFsO1vtNBF77T6CBNsUvqFY/ujA2/gcysqIFNN2vR8 dCdgT7hs/Yv1kmdCsAhVBRqn/qHeFLqUGEHS85vlGoUi/vMO7jNJ9S68BembKnssbla0 nvgptQHqaHu+dZ84jSucjhzxhAlj9vAcWnVAS9/db+Q8lwGfzbDvF8KT/P6K596tDH8H YqUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716844759; x=1717449559; 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=IdSVTA5LkaFXZvFnPRCfopV2vzBYraHKbEAZY4LzgSs=; b=gtmg7oVqIgikJN0/eMyAhMd5swCrE2n0Q4non5Y1pKMOM+mh8Gy0KiuP3F23x7ZxVf 9idWXi7lvEaowZXY1BzO/0EhseLhVDqhO5YH91TrSnRkNzqjU1YUDC1XqKc/VslXiUlA BnM7KuOpTUy3RSurHT8jV6WsUudjXSf4Gbo4gzx3lMxVjLOfU9rejPiKnkhVSJreCesr eqwuzsfsElC8lePFNflC6UqFmCUKdZlaZpxvxhe+56g90lJLFSRr6NmQbDZzSmRAvt5f bai+EZQYo7bdxzR9psg9M6dtHOllTSd5+JTLD/JJb3BQ7RLdmrIgFHeY9byhVDWbqu/K m42A== X-Gm-Message-State: AOJu0YyePkON6jZQ7UEYJ3q27wU8lllYhpVMIUIVlRf1wbT2hI/dk/DV Zt+q9va/OYBmRkFEo9wmgVUUYewpwetjH1kLydfLf1pMszyMxgwH/c1zedeR7kbe8e5BAzbALcQ B X-Received: by 2002:a05:6a00:90a8:b0:6f0:bb90:26b9 with SMTP id d2e1a72fcca58-6f8f2c576cdmr12702798b3a.5.1716844758703; Mon, 27 May 2024 14:19:18 -0700 (PDT) Received: from stoup.. (174-21-72-5.tukw.qwest.net. [174.21.72.5]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-6f8fd1d4d5fsm5265876b3a.165.2024.05.27.14.19.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 14:19:18 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: git@xen0n.name, gaosong@loongson.cn Subject: [PATCH 05/18] util/loongarch64: Detect LASX vector support Date: Mon, 27 May 2024 14:18:59 -0700 Message-Id: <20240527211912.14060-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240527211912.14060-1-richard.henderson@linaro.org> References: <20240527211912.14060-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42c; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42c.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Song Gao --- host/include/loongarch64/host/cpuinfo.h | 1 + util/cpuinfo-loongarch.c | 1 + 2 files changed, 2 insertions(+) diff --git a/host/include/loongarch64/host/cpuinfo.h b/host/include/loongarch64/host/cpuinfo.h index fab664a10b..d7bf27501d 100644 --- a/host/include/loongarch64/host/cpuinfo.h +++ b/host/include/loongarch64/host/cpuinfo.h @@ -8,6 +8,7 @@ #define CPUINFO_ALWAYS (1u << 0) /* so cpuinfo is nonzero */ #define CPUINFO_LSX (1u << 1) +#define CPUINFO_LASX (1u << 2) /* Initialized with a constructor. */ extern unsigned cpuinfo; diff --git a/util/cpuinfo-loongarch.c b/util/cpuinfo-loongarch.c index 08b6d7460c..bb1f7f698b 100644 --- a/util/cpuinfo-loongarch.c +++ b/util/cpuinfo-loongarch.c @@ -29,6 +29,7 @@ unsigned __attribute__((constructor)) cpuinfo_init(void) info = CPUINFO_ALWAYS; info |= (hwcap & HWCAP_LOONGARCH_LSX ? CPUINFO_LSX : 0); + info |= (hwcap & HWCAP_LOONGARCH_LASX ? CPUINFO_LASX : 0); cpuinfo = info; return info;