]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
RISC-V: Drop __riscv_vendor_feature_bits
authorYangyu Chen <cyy@cyyself.name>
Wed, 12 Feb 2025 01:40:41 +0000 (18:40 -0700)
committerJeff Law <jlaw@ventanamicro.com>
Wed, 12 Feb 2025 01:40:41 +0000 (18:40 -0700)
As discussed from RISC-V C-API PR #101 [1], As discussed in #96, current
interface is insufficient to support some cases, like a vendor buying a
CPU IP from the upstream vendor but using their own mvendorid and custom
features from the upstream vendor. In this case, we might need to add
these extensions for each downstream vendor many times. Thus, making
__riscv_vendor_feature_bits guarded by mvendorid is not a good idea. So,
drop __riscv_vendor_feature_bits for now, and we should have time to
discuss a better solution.

[1] https://github.com/riscv-non-isa/riscv-c-api-doc/pull/101

Signed-off-by: Yangyu Chen <cyy@cyyself.name>
gcc/ChangeLog:

* config/riscv/riscv-feature-bits.h (RISCV_VENDOR_FEATURE_BITS_LENGTH): Drop.
(struct riscv_vendor_feature_bits): Drop.

libgcc/ChangeLog:

* config/riscv/feature_bits.c (RISCV_VENDOR_FEATURE_BITS_LENGTH): Drop.
(__init_riscv_features_bits_linux): Drop.

gcc/config/riscv/riscv-feature-bits.h
libgcc/config/riscv/feature_bits.c

index b571c44285fe3121f50663c6e5e4e3362f3e870e..7ef7a2aecb71cc705b27b273fa6adff5215aea6e 100644 (file)
@@ -28,13 +28,6 @@ struct riscv_feature_bits {
   unsigned long long features[RISCV_FEATURE_BITS_LENGTH];
 };
 
-#define RISCV_VENDOR_FEATURE_BITS_LENGTH 1
-
-struct riscv_vendor_feature_bits {
-  unsigned length;
-  unsigned long long features[RISCV_VENDOR_FEATURE_BITS_LENGTH];
-};
-
 struct riscv_cpu_model {
   unsigned mvendorid;
   unsigned long long marchid;
index b34d4eea1d15bd91f372a94581617313007702a1..157bcdcad69a939037f6faca3a90c2598dd61f89 100644 (file)
@@ -30,13 +30,6 @@ struct {
   unsigned long long features[RISCV_FEATURE_BITS_LENGTH];
 } __riscv_feature_bits __attribute__ ((visibility ("hidden"), nocommon));
 
-#define RISCV_VENDOR_FEATURE_BITS_LENGTH 1
-
-struct {
-  unsigned length;
-  unsigned long long features[RISCV_VENDOR_FEATURE_BITS_LENGTH];
-} __riscv_vendor_feature_bits __attribute__ ((visibility ("hidden"), nocommon));
-
 struct {
   unsigned mvendorid;
   unsigned long long marchid;
@@ -382,8 +375,6 @@ static void __init_riscv_features_bits_linux ()
     __riscv_feature_bits.features[i] = features[i];
 
   __riscv_feature_bits.length = RISCV_FEATURE_BITS_LENGTH;
-
-  __riscv_vendor_feature_bits.length = 0;
 }
 #endif
 
@@ -402,7 +393,6 @@ __init_riscv_feature_bits ()
 #else
   /* Unsupported, just initialize that into all zeros.  */
   __riscv_feature_bits.length = 0;
-  __riscv_vendor_feature_bits.length = 0;
   __riscv_cpu_model.mvendorid = 0;
   __riscv_cpu_model.marchid = 0;
   __riscv_cpu_model.mimpid = 0;