[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libcvd-members] libcvd/cvd_src/SSE2 two_thirds_sample.cc
From: |
Gerhard Reitmayr |
Subject: |
[libcvd-members] libcvd/cvd_src/SSE2 two_thirds_sample.cc |
Date: |
Thu, 12 May 2011 09:53:02 +0000 |
CVSROOT: /cvsroot/libcvd
Module name: libcvd
Changes by: Gerhard Reitmayr <gerhard> 11/05/12 09:53:02
Modified files:
cvd_src/SSE2 : two_thirds_sample.cc
Log message:
fixes for Win32 using explicit casting functions
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd_src/SSE2/two_thirds_sample.cc?cvsroot=libcvd&r1=1.3&r2=1.4
Patches:
Index: two_thirds_sample.cc
===================================================================
RCS file: /cvsroot/libcvd/libcvd/cvd_src/SSE2/two_thirds_sample.cc,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- two_thirds_sample.cc 12 Nov 2010 14:07:32 -0000 1.3
+++ two_thirds_sample.cc 12 May 2011 09:53:01 -0000 1.4
@@ -6,7 +6,7 @@
#define _mm_shuffle_32(X, Y, Z)\
- (__m128i)_mm_shuffle_ps((__m128)(X),
(__m128)(Y), Z)
+
_mm_castps_si128(_mm_shuffle_ps(_mm_castsi128_ps(X), _mm_castsi128_ps(Y), Z))
void shift_3(__m128i& w_01_08, __m128i& w_09_16, __m128i&
w_17_24)
{
@@ -17,7 +17,7 @@
//The shift direction moves upwards in memory, so since
the three registers
//represent a row of pixels, the shift moves pixels to
the right.
__m128i w_extra =
_mm_shuffle_32(_mm_srli_si128(w_09_16, 2), w_01_08, _MM_SHUFFLE(3, 3, 3, 3));
- w_17_24 = _mm_or_si128(_mm_slli_si128(w_17_24, 2),
_mm_and_si128(w_extra, _mm_set_epi16(0, 0, 0, 0, 0, 0, 0, 0xffff)));
+ w_17_24 = _mm_or_si128(_mm_slli_si128(w_17_24, 2),
_mm_and_si128(w_extra, _mm_set_epi16(0, 0, 0, 0, 0, 0, 0, short(0xffff))));
w_09_16 = _mm_or_si128(_mm_slli_si128(w_09_16, 2),
_mm_srli_si128(w_extra, 14));
w_01_08 = _mm_slli_si128(w_01_08, 2);
}
@@ -28,8 +28,8 @@
//[ chunk1 chunk2 ] = [ [ B C E F H I K L ] [ N O Q R T
W W X ] ]
__m128i w_23tmp = _mm_srli_si128(w_01_08, 2);
- w_01_08 = _mm_and_si128(w_01_08, _mm_set_epi16(0, 0,
0xffff, 0xffff, 0, 0, 0, 0));
- w_23tmp = _mm_and_si128(w_23tmp, _mm_set_epi16(0xffff,
0xffff, 0, 0, 0, 0, 0xffff, 0xffff));
+ w_01_08 = _mm_and_si128(w_01_08, _mm_set_epi16(0, 0,
short(0xffff), short(0xffff), 0, 0, 0, 0));
+ w_23tmp = _mm_and_si128(w_23tmp,
_mm_set_epi16(short(0xffff), short(0xffff), 0, 0, 0, 0, short(0xffff),
short(0xffff)));
w_chnk1 = _mm_or_si128(w_01_08, w_23tmp);
//This gives us:
@@ -41,8 +41,8 @@
//w_chnk1 = [ B C E F H 0 0 0 ]
//w_09_16 = [ I J K L M N O P]
- __m128i w_4bitt = _mm_and_si128(_mm_slli_si128(w_09_16,
2), _mm_set_epi16(0xffff, 0xffff, 0, 0, 0, 0, 0xffff, 0));
- __m128i w_5_tmp = _mm_and_si128(w_09_16,
_mm_set_epi16(0, 0, 0, 0, 0xffff, 0xffff, 0, 0));
+ __m128i w_4bitt = _mm_and_si128(_mm_slli_si128(w_09_16,
2), _mm_set_epi16(short(0xffff), short(0xffff), 0, 0, 0, 0, short(0xffff), 0));
+ __m128i w_5_tmp = _mm_and_si128(w_09_16,
_mm_set_epi16(0, 0, 0, 0, short(0xffff), short(0xffff), 0, 0));
//w_4bitt = [0 I 0 0 0 0 N O]
//w_5_tmp = [0 0 K L 0 0 0 0]
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [libcvd-members] libcvd/cvd_src/SSE2 two_thirds_sample.cc,
Gerhard Reitmayr <=