Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cv.bset and cv.bclr builtin returns different length to rd #198

Open
MaryBennett opened this issue Feb 6, 2023 · 1 comment
Open

cv.bset and cv.bclr builtin returns different length to rd #198

MaryBennett opened this issue Feb 6, 2023 · 1 comment

Comments

@MaryBennett
Copy link
Contributor

For intructions cv.bset and cv.bclr, the destination register is a uint16_t but the builtin function returns a uint32_t. Is this correct?

@jeremybennett
Copy link
Collaborator

This is definitely wrong. The specification should be as follows:

uint32_t __builtin_riscv_cv_bitmanip_cv.bclr (uint32_t i, uint16_t range)

Case a) range is a constant

  • result: rD
  • i: rs1
  • range[4:0]: Is2 (5-bit unsigned value)
  • range[9:5]: Is3 (5-bit unsigned value)

or case b)

  • result: rD
  • i: rs1
  • range: rs2

Generated assembler:

Case a)

        cv.bclr  rD,rs1,Is2,Is3

or case b)

        cv.bclrr  rD,rs1,rs2

uint32_t __builtin_riscv_cv_bitmanip_cv.bset (uint32_t i, uint16_t range)

Case a) range is a constant

  • result: rD
  • i: rs1
  • range[4:0]: Is2 (5-bit unsigned value)
  • range[9:5]: Is3 (5-bit unsigned value)

or case b)

  • result: rD
  • i: rs1
  • range: rs2

Generated assembler:

Case a)

        cv.bset  rD,rs1,Is2,Is3

or case b)

        cv.bsetr  rD,rs1,rs2

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

No branches or pull requests

2 participants