faster
This commit is contained in:
parent
06cc48267c
commit
bf15e44b4f
1 changed files with 3 additions and 4 deletions
|
@ -386,10 +386,9 @@ proc minifyBy2Sse2*(image: Image, power = 1): Image {.simd.} =
|
||||||
# index 0 and 2 so mask the others out and shift 0 and 2 into
|
# index 0 and 2 so mask the others out and shift 0 and 2 into
|
||||||
# position and store
|
# position and store
|
||||||
masked = mm_and_si128(merged, mergedMask)
|
masked = mm_and_si128(merged, mergedMask)
|
||||||
mm_storeu_si128(
|
shuffled = mm_shuffle_epi32(masked, MM_SHUFFLE(3, 3, 2, 0))
|
||||||
result.data[result.dataIndex(x, y)].addr,
|
lower = mm_cvtsi128_si64(shuffled)
|
||||||
mm_shuffle_epi32(masked, MM_SHUFFLE(3, 3, 2, 0))
|
copyMem(result.data[result.dataIndex(x, y)].addr, lower.unsafeAddr, 8)
|
||||||
)
|
|
||||||
x += 2
|
x += 2
|
||||||
|
|
||||||
for x in x ..< resultEvenWidth:
|
for x in x ..< resultEvenWidth:
|
||||||
|
|
Loading…
Reference in a new issue