Skip to content

Commit

Permalink
Fix xvshuf on 3A6000
Browse files Browse the repository at this point in the history
  • Loading branch information
jiegec committed Dec 14, 2023
1 parent de77119 commit 16089ab
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 16 deletions.
4 changes: 1 addition & 3 deletions code/xvshuf_b.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
for (int i = 0; i < 32; i++) {
if (c.byte[i] >= 64) {
dst.byte[i] = 0;
} else if ((c.byte[i] % 32) < 16) {
if ((c.byte[i] % 32) < 16) {
dst.byte[i] = b.byte[(c.byte[i] % 32) + ((i >= 16) ? 16 : 0)];
} else {
dst.byte[i] = a.byte[(c.byte[i] % 32) + ((i >= 16) ? 0 : -16)];
Expand Down
8 changes: 4 additions & 4 deletions code/xvshuf_d.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
for (int i = 0; i < 4; i++) {
if ((a.dword[i] % 8) < 4) {
dst.dword[i] = c.dword[a.dword[i] % 4];
if ((a.dword[i] % 4) < 2) {
dst.dword[i] = c.dword[(a.dword[i] % 4) + ((i >= 2) ? 2 : 0)];
} else {
dst.dword[i] = b.dword[a.dword[i] % 4];
dst.dword[i] = b.dword[(a.dword[i] % 4) + ((i >= 2) ? 0 : -2)];
}
}
}
8 changes: 3 additions & 5 deletions code/xvshuf_h.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
for (int i = 0; i < 16; i++) {
if ((c.half[i] % 256) >= 64) {
dst.half[i] = 0;
} else if ((c.half[i] % 16) < 8) {
dst.half[i] = b.half[(c.half[i] % 16) + ((i >= 8) ? 8 : 0)];
if ((a.half[i] % 16) < 8) {
dst.half[i] = c.half[(a.half[i] % 16) + ((i >= 8) ? 8 : 0)];
} else {
dst.half[i] = a.half[(c.half[i] % 16) + ((i >= 8) ? 0 : -8)];
dst.half[i] = b.half[(a.half[i] % 16) + ((i >= 8) ? 0 : -8)];
}
}
8 changes: 4 additions & 4 deletions code/xvshuf_w.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
for (int i = 0; i < 8; i++) {
if ((a.word[i] % 16) < 8) {
dst.word[i] = c.word[a.word[i] % 8];
if ((a.word[i] % 8) < 4) {
dst.word[i] = c.word[(a.word[i] % 8) + ((i >= 4) ? 4 : 0)];
} else {
dst.word[i] = b.word[a.word[i] % 8];
dst.word[i] = b.word[(a.word[i] % 8) + ((i >= 4) ? 0 : -4)];
}
}
}

0 comments on commit 16089ab

Please sign in to comment.