OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.target/] [alpha/] [pr19518.c] - Blame information for rev 315

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 312 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-O2 -mcpu=ev67" } */
3
 
4
typedef short INT16;
5
typedef unsigned int CARD32;
6
typedef unsigned short CARD16;
7
typedef unsigned char CARD8;
8
typedef struct _Picture *PicturePtr;
9
typedef int FbStride;
10
typedef unsigned long __m64;
11
extern __m64 load8888 (__m64);
12
static __inline __m64 _mm_adds_pu8(__m64 __m1, __m64 __m2)
13
{
14
    return __m1 + __builtin_alpha_minsb8(__m2, ~__m1);
15
}
16
static __inline __m64 _mm_packs_pu16(__m64 __m1, __m64 __m2)
17
{
18
    __m1 = __builtin_alpha_minuw4(__m1, 0x00ff00ff00ff00ff);
19
    __m2 = __builtin_alpha_minuw4(__m2, 0x00ff00ff00ff00ff);
20
    return __m1 | (__m2 << 32);
21
}
22
typedef unsigned long long ullong;
23
static __inline__ __m64 pix_multiply(__m64 a)
24
{
25
    if (a)
26
        return a;
27
}
28
static __inline__ __m64 over(__m64 src, __m64 srca, __m64 dest)
29
{
30
    return _mm_adds_pu8(src, pix_multiply(dest));
31
}
32
 
33
void fbCompositeSolid_nx8888mmx(CARD8 op, PicturePtr pSrc, PicturePtr pMask,
34
                                INT16 yDst, CARD16 width, CARD16 height)
35
{
36
    CARD32 src;
37
    CARD32 *dstLine, *dst;
38
    CARD16 w;
39
    FbStride dstStride;
40
    __m64 vsrc, vsrca;
41
    vsrc = load8888(src);
42
    while (height--) {
43
        dst = dstLine;
44
        dstLine += dstStride;
45
        while (w && (unsigned long) dst & 7) {
46
            *dst = _mm_packs_pu16(_mm_adds_pu8(vsrc, load8888(*dst)),
47
                                  _mm_setzero_si64());
48
            dst++;
49
        }
50
        while (w >= 2) {
51
            __m64 dest0, dest1;
52
            *(__m64 *) dst = _mm_packs_pu16(dest0, dest1);
53
            w -= 2;
54
        }
55
        while (w) {
56
            *dst = _mm_packs_pu16(_mm_adds_pu8(vsrc, pix_multiply(0)), 0);
57
            w--;
58
        }
59
    }
60
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.