From patchwork Thu Oct 26 00:13:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 738206 Delivered-To: patch@linaro.org Received: by 2002:adf:f842:0:b0:32d:baff:b0ca with SMTP id d2csp553788wrq; Wed, 25 Oct 2023 17:22:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHHA+foREOrnP/N9S1KjQegJc+YNOCd1h2O5vDCaNJ3Q1QRm3XRdLmtER9ji4bjAzcmwObl X-Received: by 2002:adf:f711:0:b0:32d:b051:9a2b with SMTP id r17-20020adff711000000b0032db0519a2bmr12789719wrp.2.1698279734262; Wed, 25 Oct 2023 17:22:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698279734; cv=none; d=google.com; s=arc-20160816; b=NntUieyQsF/+kZODm+yHYe7yeepj+fGh3O+8NzVyj3Mkl2UxTMqQHB0RBAou7SzF33 0IwFKZG6NuwS9VmBEwKhY6kvSfgSzxEnD91RiBYyxVhLyJDHkF5A8qOKAS45DteiU0Ac MaWnmmiPWIBg0c8xFCiXOowt8Ha0UFHLO1f85PB912bIhwAQUCmgFDKJB9TZMJ+POFQu iSw929q/v/K8WkEro0j6AfcQeHkFhjmZN2SRxvVqJmxso8XhvwQb9aPeQe+VWhJ9YIFk 7SruJPQkVB1rxr+y/ILx2l1iSOz2o+6WnC6OLEtrP4okO0tHAJtGL3n2LYQNLORuvNBd KpHw== 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=Jiy4wOodRVlFspzzZethCiArH1v1AZS8FVXwpd5smRE=; fh=rYI8DiHAAFX3O5g969KmOAQ7d45Sb8OxQX1+DywGDk4=; b=rFyJHLS6hlsNrZSg2gcMIa+4t5e7Lr9o39f1PxNCiplo5NBacjBPgXFbtby4spkRv9 c8QTpLxYefsjkLuXie/zaCrshXAvJV1MxDosr32BFtbj65AtyevK0LHQikhCDRX3pP5z LGoXG6wheMcWzY84k9Xt68t+e5Tav5lLd+hNHty9lCyb1ktSdP26cL30kJ/8ULmmALyc U1fED20YRZ7Nc21htGZStRR2Slm7jAphJ6fBtP5nNVAxwAfDtKCuHwMTowEX6eRfO4Yl R2fhD/A7YGUOvI6atcKdY+F6x/ZYDc8ktywG6PrC9//Nx6R+WW1xGcB0s3x7SpyT5A8x MbTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LoKDTtOb; 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 dj18-20020a0560000b1200b0032da3fe1224si8178329wrb.699.2023.10.25.17.22.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 25 Oct 2023 17:22:14 -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=LoKDTtOb; 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 1qvo2v-0007FC-E0; Wed, 25 Oct 2023 20:16:21 -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 1qvo2o-00073c-Mq for qemu-devel@nongnu.org; Wed, 25 Oct 2023 20:16:14 -0400 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qvo2h-0004qW-ND for qemu-devel@nongnu.org; Wed, 25 Oct 2023 20:16:14 -0400 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1c9c5a1b87bso2036525ad.3 for ; Wed, 25 Oct 2023 17:15:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698279353; x=1698884153; 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=Jiy4wOodRVlFspzzZethCiArH1v1AZS8FVXwpd5smRE=; b=LoKDTtOb7oiBE1o2QxLJuDXqJm8fB9ywcjqWaVOObOnpOyAOoUunP6fEI35P8vp4fh AgDnjhCH8r1I2Hk9cIiM+R2oq/sHCQcPP7rLF05EnEDok8+YziuFvcrrLvMyy/5grmAW n+pUt/Xv9NR4tkSuiEOHyBLnRSyQ4dMRcjIBteaIlV+IhQKObsqRDQt60Vuu/8Ovahg0 TmVJD+9l+vkbzLEIPb+AK0zSRzyWnHS/lmUZoy3KjGJXH3ssnsPY5Xw19GoVxLGWYlw6 +IytOFZSXAffbo3+TcYJ0DdOytLM6Ydcz74GVpk7KXYHfvuHgWQGPJKYmwynx7a3DfIL FAOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698279353; x=1698884153; 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=Jiy4wOodRVlFspzzZethCiArH1v1AZS8FVXwpd5smRE=; b=Vkk4y6tguY2Qhu5ABfoqL9mpkEBjmC6DbR1lMnxFSIYo1FwYZpRSNDslddQthPcSUH RukLJMjMUdqw9V2JlV5rJBFG3lSWzsVVNKyyk8itTntNr6oZzp2f8DDsrhZEGPBa8cMg bexqFuMBbjKLAl/9iIOR9XssoJXhBuxdKLssrrOINMkRk8sENr23bfBN+iXRaVitZN/h T3Hsz/sWxu2xvgazvRSOPXRHPRdmjINJuuvKn/Xy1onknsXnYMaAyzeQMXAqqFgAZ2Tc u5D16FgU2aaaHSwWoGRBvu9h5XbxcYZgw7p8f8LWKqmbYMJzPkpNpBxyHd9Y601qTrh9 3JMw== X-Gm-Message-State: AOJu0YzSwYaf4J4Sw1WyE5mkv3gbbB08dl2JDnTjoBFIMoPA/kJ2Y0jt /fd6MCM9ByNlafSOU+6LGW+bTh48g2MWDONtAH0= X-Received: by 2002:a17:903:404d:b0:1ca:7af1:8a85 with SMTP id n13-20020a170903404d00b001ca7af18a85mr12583429pla.57.1698279353326; Wed, 25 Oct 2023 17:15:53 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id ij23-20020a170902ab5700b001c582de968dsm10038433plb.72.2023.10.25.17.15.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 17:15:52 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland Subject: [PULL 06/94] target/sparc: Define features via cpu-feature.h.inc Date: Wed, 25 Oct 2023 17:13:50 -0700 Message-Id: <20231026001542.1141412-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231026001542.1141412-1-richard.henderson@linaro.org> References: <20231026001542.1141412-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62c.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 Manage feature bits automatically. Tested-by: Mark Cave-Ayland Acked-by: Mark Cave-Ayland Signed-off-by: Richard Henderson --- target/sparc/cpu.h | 32 +++++++++++++------------------- target/sparc/cpu-feature.h.inc | 19 +++++++++++++++++++ 2 files changed, 32 insertions(+), 19 deletions(-) create mode 100644 target/sparc/cpu-feature.h.inc diff --git a/target/sparc/cpu.h b/target/sparc/cpu.h index 9fc5c401d2..aaecbf0876 100644 --- a/target/sparc/cpu.h +++ b/target/sparc/cpu.h @@ -291,25 +291,19 @@ struct sparc_def_t { uint32_t maxtl; }; -#define CPU_FEATURE_FLOAT (1 << 0) -#define CPU_FEATURE_FLOAT128 (1 << 1) -#define CPU_FEATURE_SWAP (1 << 2) -#define CPU_FEATURE_MUL (1 << 3) -#define CPU_FEATURE_DIV (1 << 4) -#define CPU_FEATURE_FLUSH (1 << 5) -#define CPU_FEATURE_FSQRT (1 << 6) -#define CPU_FEATURE_FMUL (1 << 7) -#define CPU_FEATURE_VIS1 (1 << 8) -#define CPU_FEATURE_VIS2 (1 << 9) -#define CPU_FEATURE_FSMULD (1 << 10) -#define CPU_FEATURE_HYPV (1 << 11) -#define CPU_FEATURE_CMT (1 << 12) -#define CPU_FEATURE_GL (1 << 13) -#define CPU_FEATURE_TA0_SHUTDOWN (1 << 14) /* Shutdown on "ta 0x0" */ -#define CPU_FEATURE_ASR17 (1 << 15) -#define CPU_FEATURE_CACHE_CTRL (1 << 16) -#define CPU_FEATURE_POWERDOWN (1 << 17) -#define CPU_FEATURE_CASA (1 << 18) +#define FEATURE(X) CPU_FEATURE_BIT_##X, +enum { +#include "cpu-feature.h.inc" +}; + +#undef FEATURE +#define FEATURE(X) CPU_FEATURE_##X = 1u << CPU_FEATURE_BIT_##X, + +enum { +#include "cpu-feature.h.inc" +}; + +#undef FEATURE #ifndef TARGET_SPARC64 #define CPU_DEFAULT_FEATURES (CPU_FEATURE_FLOAT | CPU_FEATURE_SWAP | \ diff --git a/target/sparc/cpu-feature.h.inc b/target/sparc/cpu-feature.h.inc new file mode 100644 index 0000000000..d35fe90c92 --- /dev/null +++ b/target/sparc/cpu-feature.h.inc @@ -0,0 +1,19 @@ +FEATURE(FLOAT) +FEATURE(FLOAT128) +FEATURE(SWAP) +FEATURE(MUL) +FEATURE(DIV) +FEATURE(FLUSH) +FEATURE(FSQRT) +FEATURE(FMUL) +FEATURE(VIS1) +FEATURE(VIS2) +FEATURE(FSMULD) +FEATURE(HYPV) +FEATURE(CMT) +FEATURE(GL) +FEATURE(TA0_SHUTDOWN) /* Shutdown on "ta 0x0" */ +FEATURE(ASR17) +FEATURE(CACHE_CTRL) +FEATURE(POWERDOWN) +FEATURE(CASA)