(svn r26256) -Codechange: do not load some data when it is not (often) used later on (MJP)

replace/41b28d7194a279bdc17475d4fbe2ea6ec885a466
rubidium 11 years ago
parent 70901e04c5
commit 3a44e22b1a

@ -50,11 +50,6 @@ inline void Blitter_32bppSSE4_Anim::Draw(const Blitter::BlitterParams *bp, ZoomL
/* Load these variables into register before loop. */
const __m128i a_cm = ALPHA_CONTROL_MASK;
const __m128i pack_low_cm = PACK_LOW_CONTROL_MASK;
const __m128i briAB_cm = BRIGHTNESS_LOW_CONTROL_MASK;
const __m128i div_cleaner = BRIGHTNESS_DIV_CLEANER;
const __m128i ob_check = OVERBRIGHT_PRESENCE_MASK;
const __m128i ob_mask = OVERBRIGHT_VALUE_MASK;
const __m128i ob_cm = OVERBRIGHT_CONTROL_MASK;
const __m128i tr_nom_base = TRANSPARENT_NOM_BASE;
for (int y = bp->height; y != 0; y--) {

@ -49,11 +49,6 @@ inline void Blitter_32bppSSE4::Draw(const Blitter::BlitterParams *bp, ZoomLevel
/* Load these variables into register before loop. */
const __m128i a_cm = ALPHA_CONTROL_MASK;
const __m128i pack_low_cm = PACK_LOW_CONTROL_MASK;
const __m128i briAB_cm = BRIGHTNESS_LOW_CONTROL_MASK;
const __m128i div_cleaner = BRIGHTNESS_DIV_CLEANER;
const __m128i ob_check = OVERBRIGHT_PRESENCE_MASK;
const __m128i ob_mask = OVERBRIGHT_VALUE_MASK;
const __m128i ob_cm = OVERBRIGHT_CONTROL_MASK;
const __m128i tr_nom_base = TRANSPARENT_NOM_BASE;
for (int y = bp->height; y != 0; y--) {

@ -49,11 +49,6 @@ inline void Blitter_32bppSSSE3::Draw(const Blitter::BlitterParams *bp, ZoomLevel
/* Load these variables into register before loop. */
const __m128i a_cm = ALPHA_CONTROL_MASK;
const __m128i pack_low_cm = PACK_LOW_CONTROL_MASK;
const __m128i briAB_cm = BRIGHTNESS_LOW_CONTROL_MASK;
const __m128i div_cleaner = BRIGHTNESS_DIV_CLEANER;
const __m128i ob_check = OVERBRIGHT_PRESENCE_MASK;
const __m128i ob_mask = OVERBRIGHT_VALUE_MASK;
const __m128i ob_cm = OVERBRIGHT_CONTROL_MASK;
const __m128i tr_nom_base = TRANSPARENT_NOM_BASE;
for (int y = bp->height; y != 0; y--) {

@ -37,7 +37,7 @@
__m128i colAB = _mm_unpacklo_epi8(m_colourX2, zero); \
\
__m128i briAB = _mm_cvtsi32_si128(m_brightnessX2); \
briAB = _mm_shuffle_epi8(briAB, briAB_cm); /* DEFAULT_BRIGHTNESS in 0, 0x00 in 2. */ \
briAB = _mm_shuffle_epi8(briAB, BRIGHTNESS_LOW_CONTROL_MASK); /* DEFAULT_BRIGHTNESS in 0, 0x00 in 2. */ \
colAB = _mm_mullo_epi16(colAB, briAB); \
__m128i colAB_ob = _mm_srli_epi16(colAB, 8+7); \
colAB = _mm_srli_epi16(colAB, 7); \
@ -46,19 +46,19 @@
* Maximum for each rgb is 508 => 9 bits. The highest bit tells if there is overbright.
* -255 is changed in -256 so we just have to take the 8 lower bits into account.
*/ \
colAB = _mm_and_si128(colAB, div_cleaner); \
colAB_ob = _mm_and_si128(colAB_ob, ob_check); \
colAB_ob = _mm_mullo_epi16(colAB_ob, ob_mask); \
colAB = _mm_and_si128(colAB, BRIGHTNESS_DIV_CLEANER); \
colAB_ob = _mm_and_si128(colAB_ob, OVERBRIGHT_PRESENCE_MASK); \
colAB_ob = _mm_mullo_epi16(colAB_ob, OVERBRIGHT_VALUE_MASK); \
colAB_ob = _mm_and_si128(colAB_ob, colAB); \
__m128i obAB = _mm_hadd_epi16(_mm_hadd_epi16(colAB_ob, zero), zero); \
\
obAB = _mm_srli_epi16(obAB, 1); /* Reduce overbright strength. */ \
obAB = _mm_shuffle_epi8(obAB, ob_cm); \
__m128i retAB = ob_mask; /* ob_mask is equal to white. */ \
retAB = _mm_subs_epu16(retAB, colAB); /* (255 - rgb) */ \
retAB = _mm_mullo_epi16(retAB, obAB); /* ob*(255 - rgb) */ \
retAB = _mm_srli_epi16(retAB, 8); /* ob*(255 - rgb)/256 */ \
retAB = _mm_add_epi16(retAB, colAB); /* ob*(255 - rgb)/256 + rgb */ \
obAB = _mm_srli_epi16(obAB, 1); /* Reduce overbright strength. */ \
obAB = _mm_shuffle_epi8(obAB, OVERBRIGHT_CONTROL_MASK); \
__m128i retAB = OVERBRIGHT_VALUE_MASK; /* ob_mask is equal to white. */ \
retAB = _mm_subs_epu16(retAB, colAB); /* (255 - rgb) */ \
retAB = _mm_mullo_epi16(retAB, obAB); /* ob*(255 - rgb) */ \
retAB = _mm_srli_epi16(retAB, 8); /* ob*(255 - rgb)/256 */ \
retAB = _mm_add_epi16(retAB, colAB); /* ob*(255 - rgb)/256 + rgb */ \
\
m_colourX2 = _mm_packus_epi16(retAB, retAB);

Loading…
Cancel
Save