diff options
author | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
---|---|---|
committer | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
commit | 554fd8c5195424bdbcabf5de30fdc183aba391bd (patch) | |
tree | 976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/gcc.target/alpha/pr19518.c | |
download | cbb-gcc-4.6.4-upstream.tar.bz2 cbb-gcc-4.6.4-upstream.tar.xz |
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig;
imported gcc-4.6.4 source tree from verified upstream tarball.
downloading a git-generated archive based on the 'upstream' tag
should provide you with a source tree that is binary identical
to the one extracted from the above tarball.
if you have obtained the source via the command 'git clone',
however, do note that line-endings of files in your working
directory might differ from line-endings of the respective
files in the upstream repository.
Diffstat (limited to 'gcc/testsuite/gcc.target/alpha/pr19518.c')
-rw-r--r-- | gcc/testsuite/gcc.target/alpha/pr19518.c | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/alpha/pr19518.c b/gcc/testsuite/gcc.target/alpha/pr19518.c new file mode 100644 index 000000000..42c58b5a5 --- /dev/null +++ b/gcc/testsuite/gcc.target/alpha/pr19518.c @@ -0,0 +1,60 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mcpu=ev67" } */ + +typedef short INT16; +typedef unsigned int CARD32; +typedef unsigned short CARD16; +typedef unsigned char CARD8; +typedef struct _Picture *PicturePtr; +typedef int FbStride; +typedef unsigned long __m64; +extern __m64 load8888 (__m64); +static __inline __m64 _mm_adds_pu8(__m64 __m1, __m64 __m2) +{ + return __m1 + __builtin_alpha_minsb8(__m2, ~__m1); +} +static __inline __m64 _mm_packs_pu16(__m64 __m1, __m64 __m2) +{ + __m1 = __builtin_alpha_minuw4(__m1, 0x00ff00ff00ff00ff); + __m2 = __builtin_alpha_minuw4(__m2, 0x00ff00ff00ff00ff); + return __m1 | (__m2 << 32); +} +typedef unsigned long long ullong; +static __inline__ __m64 pix_multiply(__m64 a) +{ + if (a) + return a; +} +static __inline__ __m64 over(__m64 src, __m64 srca, __m64 dest) +{ + return _mm_adds_pu8(src, pix_multiply(dest)); +} + +void fbCompositeSolid_nx8888mmx(CARD8 op, PicturePtr pSrc, PicturePtr pMask, + INT16 yDst, CARD16 width, CARD16 height) +{ + CARD32 src; + CARD32 *dstLine, *dst; + CARD16 w; + FbStride dstStride; + __m64 vsrc, vsrca; + vsrc = load8888(src); + while (height--) { + dst = dstLine; + dstLine += dstStride; + while (w && (unsigned long) dst & 7) { + *dst = _mm_packs_pu16(_mm_adds_pu8(vsrc, load8888(*dst)), + _mm_setzero_si64()); + dst++; + } + while (w >= 2) { + __m64 dest0, dest1; + *(__m64 *) dst = _mm_packs_pu16(dest0, dest1); + w -= 2; + } + while (w) { + *dst = _mm_packs_pu16(_mm_adds_pu8(vsrc, pix_multiply(0)), 0); + w--; + } + } +} |