Skip to content

[hardware] Shuffle suppress fix - #483

Open
antellopeTweet wants to merge 2 commits into
pulp-platform:mainfrom
antellopeTweet:shuffle_suppress_fix
Open

[hardware] Shuffle suppress fix#483
antellopeTweet wants to merge 2 commits into
pulp-platform:mainfrom
antellopeTweet:shuffle_suppress_fix

Conversation

@antellopeTweet

Copy link
Copy Markdown

fix: Shuffle suppressed when required for whole reg read-write

Shuffle suppression previously occured when: (full vd overwrite) and (vd is a source register) and (vd needs a re-shuffle)

Previous implementation identified that source was also vd so suppressed source reshuffle, relying on destination reshuffle, but if vd was fully overwritten it also suppressed destination reshuffle, resulting in no shuffle

For example in the following assembly sequence:

vsetvli zero, zero, e64, m8, ta, ma
vl8re64.v v8, (lhs) // whole register loads always use ew8
vl8re64.v v16, (rhs)
vfsub.vv v8, v8, v16 // v8 is used as source, totally overwritten destination, and needs a shuffle
vs8r.v v8, (dst)

Changelog

Fixed

  • Fix shuffle suppression to not suppress reshuffle if destination is 1) totally overwritten 2) used as a source 3) needs to be reshuffled

Checklist

  • Automated tests pass
  • Changelog updated
  • Code style guideline is observed

Shuffle suppression previously occured when: (full vd overwrite) and (vd is a source register) and (vd needs a re-shuffle)

Previous implementation identified that source was also vd so suppressed source reshuffle, relying on destination reshuffle, but if vd was fully overwritten it also suppressed destination reshuffle, resulting in no shuffle

For example in the following assembly sequence:

```asm
vsetvli zero, zero, e64, m8, ta, ma
vl8re64.v v8, (lhs) // whole register loads always use ew8
vl8re64.v v16, (rhs)
vfsub.vv v8, v8, v16 // v8 is used as source, totally overwritten destination, and needs a shuffle
vs8r.v v8, (dst)
```
@antellopeTweet antellopeTweet changed the title Shuffle suppress fix [hardware] Shuffle suppress fix Aug 11, 2026
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.

1 participant