void TimgFilterShowMV::drawNum(const unsigned char *src,const unsigned char *mask,unsigned char *dst,stride_t stride) { const __m64 *src8=(const __m64*)src; #if 0 for (int i=0; i<8; i++,dst+=stride,src8++) { *(__m64*)dst=_mm_add_pi8(*(__m64*)dst,*src8); } #else *(__m64*)dst=_mm_add_pi8(*(__m64*)dst,src8[0]); dst+=stride; *(__m64*)dst=_mm_add_pi8(*(__m64*)dst,src8[1]); dst+=stride; *(__m64*)dst=_mm_add_pi8(*(__m64*)dst,src8[2]); dst+=stride; *(__m64*)dst=_mm_add_pi8(*(__m64*)dst,src8[3]); dst+=stride; *(__m64*)dst=_mm_add_pi8(*(__m64*)dst,src8[4]); dst+=stride; *(__m64*)dst=_mm_add_pi8(*(__m64*)dst,src8[5]); dst+=stride; *(__m64*)dst=_mm_add_pi8(*(__m64*)dst,src8[6]); dst+=stride; *(__m64*)dst=_mm_add_pi8(*(__m64*)dst,src8[7]); dst+=stride; #endif }
void pix_offset :: processRGBAMMX(imageStruct &image) { char R = m_offset[chRed]; char G = m_offset[chGreen]; char B = m_offset[chBlue]; char A = m_offset[chAlpha]; register int pixsize = (image.ysize * image.xsize)>>1; register __m64 offset_64 = _mm_setr_pi8(R, G, B, A, R, G, B, A); register __m64*data_p= (__m64*)image.data; _mm_empty(); if(m_saturate) { while(pixsize--) { data_p[0]=_mm_adds_pu8(data_p[0], offset_64); data_p++; } } else { while(pixsize--) { data_p[0]=_mm_add_pi8(data_p[0], offset_64); data_p++; } } _mm_empty(); }
__v8qi test () { __v8qi mm0 = {1,2,3,4,5,6,7,8}; __v8qi mm1 = {11,22,33,44,55,66,77,88}; volatile __m64 x; x = _mm_add_pi8 (mm0, mm1); return x; }
void pix_offset :: processYUVMMX(imageStruct &image) { register int pixsize = (image.ysize * image.xsize)>>2; register __m64 offset_64 = _mm_setr_pi8(U, Y, V, Y, U, Y, V, Y); register __m64*data_p= (__m64*)image.data; _mm_empty(); while(pixsize--) { data_p[0]=_mm_add_pi8(data_p[0], offset_64); data_p++; } _mm_empty(); }
void pix_offset :: processGrayMMX(imageStruct &image) { unsigned char m_grey=m_offset[chRed]; register int pixsize = (image.ysize * image.xsize)>>3; register __m64 offset_64 = _mm_set1_pi8(m_grey); register __m64*data_p= reinterpret_cast<__m64*>(image.data); _mm_empty(); if(m_saturate) { while(pixsize--) { data_p[0]=_mm_adds_pu8(data_p[0], offset_64); data_p++; } } else { while(pixsize--) { data_p[0]=_mm_add_pi8(data_p[0], offset_64); data_p++; } } _mm_empty(); }
__m64 test33(__m64 a, __m64 b) { // CHECK: paddb return _mm_add_pi8(a, b); }
__m64 test_mm_add_pi8(__m64 a, __m64 b) { // CHECK-LABEL: test_mm_add_pi8 // CHECK: call x86_mmx @llvm.x86.mmx.padd.b return _mm_add_pi8(a, b); }