17 #ifndef __UT_CommonMMXFuncs_h__
18 #define __UT_CommonMMXFuncs_h__
24 #if defined(LINUX) && !defined(AMD64) && !defined(ARM64)
25 #define UT_USE_ASM_ACCEL
52 const unsigned char *
source,
57 const unsigned char*
source,
78 const unsigned short*
source,
83 const unsigned short *
source,
94 #ifdef UT_USE_ASM_ACCEL
100 "movss (%%edi), %%xmm0 \n"
101 "movss (%%ebx), %%xmm1 \n"
103 "mulss %%xmm1, %%xmm0 \n"
105 "cvtss2si %%xmm0, %%eax \n"
106 "cmp %%eax, %%ecx \n"
107 "cmovl %%ecx, %%eax \n"
108 "cmp %%eax, %%ebx \n"
109 "cmovg %%ebx, %%eax \n"
112 "b" (f255) :
"%ecx");
114 val = (
unsigned char) ival;
123 val = (
unsigned char) t;
132 #ifdef UT_USE_ASM_ACCEL
133 const fpreal32 f65535[1] = { 65535.0f };
138 "movss (%%edi), %%xmm0 \n"
139 "movss (%%ebx), %%xmm1 \n"
140 "mov $65535, %%ecx \n"
141 "mulss %%xmm1, %%xmm0 \n"
143 "cvtss2si %%xmm0, %%eax \n"
144 "cmp %%eax, %%ecx \n"
145 "cmovl %%ecx, %%eax \n"
146 "cmp %%eax, %%ebx \n"
147 "cmovg %%ebx, %%eax \n"
150 "b" (f65535) :
"%ecx");
152 val = (
unsigned short) ival;
160 val = (
unsigned short) t;
typedef int(APIENTRYP RE_PFNGLXSWAPINTERVALSGIPROC)(int)
UT_API void UTconvertFPto8(unsigned char *dest, const fpreal32 *source, int length, int useprocext=0)
GLuint GLsizei GLsizei * length
UT_API void UTconvert8BWtoFP(fpreal32 *dest, const unsigned char *source, int length, unsigned int black, unsigned int white, bool usesse=true)
UT_API void UTconvert8toFP(fpreal32 *dest, const unsigned char *source, int length, bool usesse=true)
GLsizei GLsizei GLchar * source
UT_API void UTconvertFPto16(unsigned short *dest, const fpreal32 *source, int length, int procext=0)
UT_API void UTconvertFPto16BW(unsigned short *dest, const fpreal32 *source, int length, unsigned int black, unsigned int white, bool usesse=true)
UT_API void UTconvert16toFP(fpreal32 *dest, const unsigned short *source, int length, bool usesse=true)
fpreal32 SYSfloorIL(fpreal32 val)
UT_API void UTconvert16BWtoFP(fpreal32 *dest, const unsigned short *source, int length, unsigned int black, unsigned int white, bool usesse=true)
UT_API void UTconvertFPto8BW(unsigned char *dest, const fpreal32 *source, int length, unsigned int black, unsigned int white, int useprocext=0)