| 563 | * @brief Logical shift left. |
| 564 | */ |
| 565 | template <int s> ASTCENC_SIMD_INLINE vint4 lsl(vint4 a) |
| 566 | { |
| 567 | // Cast to unsigned to avoid shift in/out of sign bit undefined behavior |
| 568 | unsigned int as0 = static_cast<unsigned int>(a.m[0]) << s; |
| 569 | unsigned int as1 = static_cast<unsigned int>(a.m[1]) << s; |
| 570 | unsigned int as2 = static_cast<unsigned int>(a.m[2]) << s; |
| 571 | unsigned int as3 = static_cast<unsigned int>(a.m[3]) << s; |
| 572 | |
| 573 | return vint4(static_cast<int>(as0), |
| 574 | static_cast<int>(as1), |
| 575 | static_cast<int>(as2), |
| 576 | static_cast<int>(as3)); |
| 577 | } |
| 578 | |
| 579 | /** |
| 580 | * @brief Logical shift right. |