less instructions
This commit is contained in:
parent
97d69b1473
commit
53e5185360
1 changed files with 4 additions and 7 deletions
|
@ -186,14 +186,11 @@ proc isOpaque*(data: var seq[ColorRGBX], start, len: int): bool =
|
||||||
return false
|
return false
|
||||||
|
|
||||||
when defined(amd64) and allowSimd:
|
when defined(amd64) and allowSimd:
|
||||||
proc packAlphaValues*(v: M128i): M128i {.inline, raises: [].} =
|
proc packAlphaValues(v: M128i): M128i {.inline, raises: [].} =
|
||||||
## Shuffle the alpha values for these 4 colors to the first 4 bytes
|
## Shuffle the alpha values for these 4 colors to the first 4 bytes
|
||||||
let mask = mm_set1_epi32(cast[int32](0xff000000))
|
result = mm_srli_epi32(v, 24)
|
||||||
result = mm_and_si128(v, mask)
|
result = mm_packus_epi16(result, mm_setzero_si128())
|
||||||
result = mm_srli_epi32(result, 24)
|
result = mm_packus_epi16(result, mm_setzero_si128())
|
||||||
result = mm_packus_epi16(result, result)
|
|
||||||
result = mm_packus_epi16(result, result)
|
|
||||||
result = mm_srli_si128(result, 12)
|
|
||||||
|
|
||||||
proc pack4xAlphaValues*(i, j, k, l: M128i): M128i {.inline, raises: [].} =
|
proc pack4xAlphaValues*(i, j, k, l: M128i): M128i {.inline, raises: [].} =
|
||||||
let
|
let
|
||||||
|
|
Loading…
Reference in a new issue