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

This commit is contained in:
rubidium 2014-01-13 18:06:53 +00:00
parent 5849290640
commit 2f3c3d2ba6
4 changed files with 11 additions and 26 deletions

View File

@ -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--) {

View File

@ -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--) {

View File

@ -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--) {

View File

@ -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,15 +46,15 @@
* 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. */ \
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 */ \