Skip to content

Add some RISC-V options#447

Open
michael-roe wants to merge 1 commit intogoogle:mainfrom
michael-roe:bitmanip
Open

Add some RISC-V options#447
michael-roe wants to merge 1 commit intogoogle:mainfrom
michael-roe:bitmanip

Conversation

@michael-roe
Copy link
Copy Markdown
Contributor

This adds the bit manipulation and half-precision floating point extensions

@Mizux Mizux self-assigned this Apr 30, 2026
Comment thread include/internal/hwcaps.h
#define RISCV_HWCAP_D (UINT64_C(1) << ('D' - 'A'))
#define RISCV_HWCAP_Q (UINT64_C(1) << ('Q' - 'A'))
#define RISCV_HWCAP_C (UINT64_C(1) << ('C' - 'A'))
#define RISCV_HWCAP_B (UINT64_C(1) << ('B' - 'A'))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also your PR do not contains any RISCV_B in the RiscvFeaturesEnum so it seems inconsistent imho

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I had had the same thought that maybe HWCAP_B should not be part of the PR. I’ll take it out and resubmit.

Comment thread src/impl_riscv_linux.c
LINE(RISCV_Zicsr, Zicsr, "_zicsr", 0, 0) \
LINE(RISCV_Zifencei, Zifencei, "_zifencei", 0, 0)
LINE(RISCV_Zifencei, Zifencei, "_zifencei", 0, 0) \
LINE(RISCV_Zfa, Zfa, "_zfa", 0, 0) \
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was influenced by which features are currently implemented by RISC-V chip vendors, but yes, Zfbfmin is optional in the RVA23 profile, so I ought to include it.

Comment thread src/impl_riscv_linux.c
LINE(RISCV_Zfhmin, Zfhmin, "_zfhmin", 0, 0) \
LINE(RISCV_Zca, Zca, "_zca", 0, 0) \
LINE(RISCV_Zcb, Zcb, "_zcb", 0, 0) \
LINE(RISCV_Zcd, Zcd, "_zcd", 0, 0) \
Copy link
Copy Markdown
Collaborator

@Mizux Mizux Apr 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants