Skip to content

Commit

Permalink
[arch][riscv][feature] add a few more feature bits
Browse files Browse the repository at this point in the history
These may be useful in the future.
  • Loading branch information
travisg committed Jun 2, 2024
1 parent c4effae commit 14bd772
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions arch/riscv/feature.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ static void match_feature(const char *str, size_t start, size_t end) {
{ "zbb", RISCV_FEAT_ZBB },
{ "zbc", RISCV_FEAT_ZBC },
{ "zbs", RISCV_FEAT_ZBS },
{ "zicbom", RISCV_FEAT_ZICBOM },
{ "zicbop", RISCV_FEAT_ZICBOP },
{ "zicboz", RISCV_FEAT_ZICBOZ },
{ "sstc", RISCV_FEAT_SSTC },
{ "svadu", RISCV_FEAT_SVADU },
{ "zicsr", RISCV_FEAT_ZICSR },
{ "zifencei", RISCV_FEAT_ZIFENCEI },
};
Expand Down Expand Up @@ -191,9 +195,13 @@ const char *riscv_feature_to_string(enum riscv_feature feature) {
case RISCV_FEAT_ZBB: return "zbb";
case RISCV_FEAT_ZBC: return "zbc";
case RISCV_FEAT_ZBS: return "zbs";
case RISCV_FEAT_ZICBOM: return "zicbom";
case RISCV_FEAT_ZICBOP: return "zicbop";
case RISCV_FEAT_ZICBOZ: return "zicboz";
case RISCV_FEAT_ZICSR: return "zicsr";
case RISCV_FEAT_ZIFENCEI: return "zifencei";
case RISCV_FEAT_SSTC: return "sstc";
case RISCV_FEAT_SVADU: return "svadu";

// keep this in so the compiler warns if something is missing
case RISCV_FEAT_COUNT: return "";
Expand Down
4 changes: 4 additions & 0 deletions arch/riscv/include/arch/riscv/feature.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ enum riscv_feature {
RISCV_FEAT_ZBS,
RISCV_FEAT_ZICSR,
RISCV_FEAT_ZIFENCEI,
RISCV_FEAT_ZICBOM,
RISCV_FEAT_ZICBOP,
RISCV_FEAT_ZICBOZ,
RISCV_FEAT_SSTC,
RISCV_FEAT_SVADU,

RISCV_FEAT_COUNT
};
Expand Down

0 comments on commit 14bd772

Please sign in to comment.