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

Saturation remove set 0 #585

Merged
merged 3 commits into from
Oct 10, 2024
Merged

Conversation

rez5427
Copy link
Contributor

@rez5427 rez5427 commented Oct 9, 2024

I ran the test for VNClip and noticed that the saturation function includes logic that sets vxsat to zero. This caused the test to fail. After reviewing the Spike implementation, I found that it does not set vxsat to zero. The spec only mentions setting it to one, without specifying any case where it should be reset to zero.

then saturates the result to fit into SEW bits. If the result causes saturation, the vxsat bit is set.

In vector instructions, if a situation causes saturation midway, vxsat is set to one but is later reset to zero. As a result, the information that vxsat was once set to one is discarded, as shown in the case in the picture.

image

Here is the spike.
image

@rez5427
Copy link
Contributor Author

rez5427 commented Oct 9, 2024

elem: 0x7fff triggers set vxsat to one btw.

@allenjbaum
Copy link
Collaborator

allenjbaum commented Oct 9, 2024 via email

Copy link

github-actions bot commented Oct 9, 2024

Test Results

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

Results for commit 7ed3714. ± Comparison against base commit 87f8bb3.

@Timmmm
Copy link
Collaborator

Timmmm commented Oct 10, 2024

I confirmed we have the same fix in our fork (sorry... I'll try to make a list of fixes at some point at least).

@Timmmm Timmmm merged commit f7192a6 into riscv:master Oct 10, 2024
2 checks passed
@rez5427 rez5427 deleted the saturation_remove_set_0 branch October 10, 2024 16:48
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.

4 participants