mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-16 00:12:51 +00:00
(svn r26256) -Codechange: do not load some data when it is not (often) used later on (MJP)
This commit is contained in:
parent
5849290640
commit
2f3c3d2ba6
@ -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,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 */ \
|
||||
|
Loading…
Reference in New Issue
Block a user