Skip to content

Commit 5a38db1

Browse files
author
Guillaume Piolat
committed
Remark
1 parent 9548d0c commit 5a38db1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

graphics/dplug/graphics/color.d

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,11 @@ RGBA blendColor(RGBA fg, RGBA bg, ubyte alpha) pure nothrow @nogc
467467
// * sign multiply by 32897
468468
// * right-shift logically by 23
469469
// Thanks https://godbolt.org/
470-
product *= _mm_set1_epi32(32897); // PERF: this leads to inefficient code with several pmul
470+
product *= _mm_set1_epi32(32897);
471+
472+
// PERF: this leads to inefficient code with several pmul
473+
// However 32897 = 1 + 128 + 32768...
474+
471475
product = _mm_srli_epi32(product, 23);
472476
__m128i c = _mm_packs_epi32(product, zero);
473477
c = _mm_packus_epi16(c, zero);

0 commit comments

Comments
 (0)