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

Remove vector of bools in vext #622

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rez5427
Copy link
Contributor

@rez5427 rez5427 commented Nov 24, 2024

fix #554
emmm...
I will test the code with riscv-vector-tests later...
And to make sure assert('n > 0); is right

Copy link

Test Results

396 tests  ±0   396 ✅ ±0   0s ⏱️ ±0s
  4 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 1ae3558. ± Comparison against base commit 07fa23e.

@rez5427
Copy link
Contributor Author

rez5427 commented Nov 27, 2024

The 'n produced in here, and I believe it can't be 0.
/* num_elem means max(VLMAX,VLEN/SEW)) according to Section 5.4 of RVV spec /
val get_num_elem : (int, int) -> nat
function get_num_elem(LMUL_pow, SEW) = {
let LMUL_pow_reg = if LMUL_pow < 0 then 0 else LMUL_pow;
/
Ignore lmul < 1 so that the entire vreg is read, allowing all masking to

  • be handled in init_masked_result */
    let num_elem = 2 ^ (LMUL_pow_reg) * VLEN / SEW;
    assert(num_elem > 0);
    num_elem
    }

And the result of this commit run with riscv-vector-tests is in here

@@ -118,6 +118,17 @@ function bits_to_bool(x : bits(1)) -> bool = bool_bits(x)
val to_bits : forall 'l, 'l >= 0.(int('l), int) -> bits('l)
function to_bits (l, n) = get_slice_int(l, n, 0)

val flip_bits : forall 'n, 'n >= 0. (int('n), bits('n)) -> bits('n)
function flip_bits (num : int('n), x : bits('n)) -> bits('n) = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

It seems like you are always flipping all bits? Can't you just xor with ones()?

If this function is needed with a partial flip, you can simplify that to an xor with ones(n) @ zeros()

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.

Use bit vectors for read_vmask and read_vmask_carry
3 participants