00001
00002
00003
00004
00005
00006
00007
00008
00009
00012 #ifndef BLITTER_32BPP_SSE_TYPE_HPP
00013 #define BLITTER_32BPP_SSE_TYPE_HPP
00014
00015 #ifdef WITH_SSE
00016
00017 #include "32bpp_simple.hpp"
00018 #if (SSE_VERSION == 2)
00019 #include <emmintrin.h>
00020 #elif (SSE_VERSION == 3)
00021 #include <tmmintrin.h>
00022 #elif (SSE_VERSION == 4)
00023 #include <smmintrin.h>
00024 #endif
00025
00026 #define META_LENGTH 2 ///< Number of uint32 inserted before each line of pixels in a sprite.
00027 #define MARGIN_NORMAL_THRESHOLD (zoom == ZOOM_LVL_OUT_32X ? 8 : 4) ///< Minimum width to use margins with BM_NORMAL.
00028 #define MARGIN_REMAP_THRESHOLD 4 ///< Minimum width to use margins with BM_COLOUR_REMAP.
00029
00030 #ifdef _MSC_VER
00031 #define ALIGN(n) __declspec(align(n))
00032 #else
00033 #define ALIGN(n) __attribute__ ((aligned (n)))
00034 #endif
00035
00036 typedef union ALIGN(16) um128i {
00037 __m128i m128i;
00038 uint8 m128i_u8[16];
00039 uint16 m128i_u16[8];
00040 uint32 m128i_u32[4];
00041 uint64 m128i_u64[2];
00042 } um128i;
00043
00044 #define CLEAR_HIGH_BYTE_MASK _mm_setr_epi8(-1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0)
00045 #define ALPHA_CONTROL_MASK _mm_setr_epi8( 6, 7, 6, 7, 6, 7, -1, -1, 14, 15, 14, 15, 14, 15, -1, -1)
00046 #define PACK_LOW_CONTROL_MASK _mm_setr_epi8( 0, 2, 4, -1, 8, 10, 12, -1, -1, -1, -1, -1, -1, -1, -1, -1)
00047 #define PACK_HIGH_CONTROL_MASK _mm_setr_epi8(-1, -1, -1, -1, -1, -1, -1, -1, 0, 2, 4, -1, 8, 10, 12, -1)
00048 #define BRIGHTNESS_LOW_CONTROL_MASK _mm_setr_epi8( 1, 2, 1, 2, 1, 2, 0, 2, 3, 2, 3, 2, 3, 2, 0, 2)
00049 #define BRIGHTNESS_DIV_CLEANER _mm_setr_epi8(-1, 1, -1, 1, -1, 1, -1, 0, -1, 1, -1, 1, -1, 1, -1, 0)
00050 #define OVERBRIGHT_PRESENCE_MASK _mm_setr_epi8( 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0)
00051 #define OVERBRIGHT_VALUE_MASK _mm_setr_epi8(-1, 0, -1, 0, -1, 0, 0, 0, -1, 0, -1, 0, -1, 0, 0, 0)
00052 #define OVERBRIGHT_CONTROL_MASK _mm_setr_epi8( 0, 1, 0, 1, 0, 1, 7, 7, 2, 3, 2, 3, 2, 3, 7, 7)
00053 #define TRANSPARENT_NOM_BASE _mm_setr_epi16(256, 256, 256, 256, 256, 256, 256, 256)
00054
00055 #endif
00056 #endif