Commit graph

13 commits

Author SHA1 Message Date
Hendiadyoin1 832b5ff603 AK: Add simd_cast<T> and replace to_TxN with it 2024-08-08 22:43:53 -04:00
Nico Weber 34a4d16776 AK: Add AK::SIMD::to_i8x4() 2024-08-06 23:00:32 -04:00
Diego Frias 3fe206d44f AK/SIMDExtras: Fix masking logic in shuffle_or_0
(cherry picked from commit a168bec7efcb26ef7e27cd5294fdefa1ff9e4ca9)
2024-07-29 14:34:01 +02:00
Diego Frias 519d3674fa LibWasm: Fix SIMD shuffle and swizzle
`swizzle` had the wrong operands, and the vector masking boolean logic
was incorrect in the internal `shuffle_or_0` implementation. `shuffle`
was previously implemented as a dynamic swizzle, when it uses an
immediate operand for lane indices in the spec.

(cherry picked from commit 9cc3e7d32d150dd30d683c1a8cf0bd59676f14ab)
2024-07-29 14:34:01 +02:00
Dan Klishch 2b65b62c6e AK: Use bit_cast in SIMDExtras.h/AK::Detail::byte_reverse_impl
This necessitates marking bit_cast as ALWAYS_INLINE since emitting it as
a function call there will create an unnecessary potential SSE
registers -> plain registers/memory round-trip.
2024-07-12 18:30:07 -04:00
Dan Klishch 56b7f9e404 Meta: Globally disable -Wpsabi
This warning is triggered when one accepts or returns vectors from a
function (that is not marked with [[gnu::target(...)]]) which would have
been otherwise passed in register if the current translation unit had
been compiled with more permissive flags wrt instruction selection (i.
e. if one adds -mavx2 to cmdline). This will never be a problem for us
since we (a) never use different instruction selection options across
ABI boundaries; (b) most of the affected functions are actually
TU-local.

Moreover, even if we somehow properly annotated all of the SIMD helpers,
calling them across ABI (or target) boundaries would still be very
dangerous because of inconsistent and bogus handling of
[[gnu::target(...)]] across compilers. See
https://github.com/llvm/llvm-project/issues/64706 and
https://www.reddit.com/r/cpp/comments/17qowl2/comment/k8j2odi .
2024-07-12 18:30:07 -04:00
Hendiadyoin1 1b8fd5c35a AK: Add generic SIMD shuffle/reverse functions 2024-07-05 00:52:30 +02:00
Hendiadyoin1 27c386797d AK: Add generic SIMD vector load/store functions 2024-07-05 00:52:30 +02:00
Ali Mohammad Pur 3c176bafee LibWasm: Implement a few SIMD instructions 2023-08-21 13:39:32 +03:30
Karol Kosek b5420b8a9a LibGfx: Implement PNG filtering on write
Is it another great upgrade to our PNG encoder like in 9aafaec259?
Well, not really - it's not a 2x or 55x improvement like you saw there,
but still it saves something:

- a screenshot of a blank Serenity desktop dropped from about 45 KiB
  to 40 KiB.
- re-encoding NASA photo of the Earth to PNG again saves about 25%
  (16.5 MiB -> 12.3 MiB), compared to not using filters.

[1]: https://commons.wikimedia.org/wiki/File:The_Blue_Marble_(remastered).jpg
2022-07-10 15:01:07 +02:00
Jelle Raaijmakers 11c807ebd1 LibGL+LibSoftGPU: Implement the stencil buffer
This implements an 8-bit front stencil buffer. Stencil operations are
SIMD optimized. LibGL changes include:

* New `glStencilMask` and `glStencilMaskSeparate` functions
* New context parameter `GL_STENCIL_CLEAR_VALUE`
2022-01-17 12:49:00 +01:00
Stephan Unverwerth f9c5c120f6 AK/SIMD: Suppress psabi warnings and add explanatory comment 2022-01-09 21:03:08 +01:00
Stephan Unverwerth 7adcdecc7b AK: Add SIMDExtras.h with SIMD related functions
Adds a header to AK with helper functions for writing vectorized code.

Co-authored-by: Hendiadyoin <leon2002.la@gmail.com>
2022-01-09 16:21:13 +03:30