mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
LibWasm: Fix sign issues in SIMD cmp ops
This commit is contained in:
parent
0a0651f34e
commit
4c7ef01b44
Notes:
sideshowbarker
2024-07-17 06:51:10 +09:00
Author: https://github.com/dzfrias Commit: https://github.com/LadybirdBrowser/ladybird/commit/4c7ef01b44 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/594 Reviewed-by: https://github.com/alimpfard
1 changed files with 5 additions and 2 deletions
|
@ -289,8 +289,11 @@ struct VectorCmpOp {
|
|||
auto result = bit_cast<Native128ByteVectorOf<ElementType, SetSign>>(c1);
|
||||
auto other = bit_cast<Native128ByteVectorOf<ElementType, SetSign>>(c2);
|
||||
Op op;
|
||||
for (size_t i = 0; i < VectorSize; ++i)
|
||||
result[i] = op(result[i], other[i]) ? static_cast<MakeUnsigned<ElementType>>(-1) : 0;
|
||||
for (size_t i = 0; i < VectorSize; ++i) {
|
||||
SetSign<ElementType> lhs = result[i];
|
||||
SetSign<ElementType> rhs = other[i];
|
||||
result[i] = op(lhs, rhs) ? static_cast<MakeUnsigned<ElementType>>(-1) : 0;
|
||||
}
|
||||
return bit_cast<u128>(result);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue