Commit 7ad6469e authored by Diego Pettenò's avatar Diego Pettenò

Convert asm keyword into __asm__.

Neither the asm() nor the __asm__() keyword is not part of the C99
standard, but while GCC accepts the former in C89 syntax, it is not
accepted in C99 unless GNU extensions are turned on (with -fasm). The
latter form is accepted in any syntax as an extension (without
requiring further command-line options).

Sun Studio C99 compiler also does not accept asm() while accepting
__asm__(), albeit reporting warnings that it's not valid C99 synta.

Originally committed as revision 27778 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
parent be449fca
This diff is collapsed.
...@@ -120,7 +120,7 @@ static int doTest(uint8_t *ref[3], int refStride[3], int w, int h, int srcFormat ...@@ -120,7 +120,7 @@ static int doTest(uint8_t *ref[3], int refStride[3], int w, int h, int srcFormat
sws_scale(outContext, dst, dstStride, 0, dstH, out, refStride); sws_scale(outContext, dst, dstStride, 0, dstH, out, refStride);
#if defined(ARCH_X86) #if defined(ARCH_X86)
asm volatile ("emms\n\t"); __asm__ volatile ("emms\n\t");
#endif #endif
ssdY= getSSD(ref[0], out[0], refStride[0], refStride[0], w, h); ssdY= getSSD(ref[0], out[0], refStride[0], refStride[0], w, h);
...@@ -215,7 +215,7 @@ int main(int argc, char **argv){ ...@@ -215,7 +215,7 @@ int main(int argc, char **argv){
sws_scale(sws, rgb_src, rgb_stride, 0, H, src, stride); sws_scale(sws, rgb_src, rgb_stride, 0, H, src, stride);
#if defined(ARCH_X86) #if defined(ARCH_X86)
asm volatile ("emms\n\t"); __asm__ volatile ("emms\n\t");
#endif #endif
selfTest(src, stride, W, H); selfTest(src, stride, W, H);
......
...@@ -1061,7 +1061,7 @@ static inline int initFilter(int16_t **outFilter, int16_t **filterPos, int *outF ...@@ -1061,7 +1061,7 @@ static inline int initFilter(int16_t **outFilter, int16_t **filterPos, int *outF
int ret= -1; int ret= -1;
#if defined(ARCH_X86) #if defined(ARCH_X86)
if (flags & SWS_CPU_CAPS_MMX) if (flags & SWS_CPU_CAPS_MMX)
asm volatile("emms\n\t"::: "memory"); //FIXME this should not be required but it IS (even for non-MMX versions) __asm__ volatile("emms\n\t"::: "memory"); //FIXME this should not be required but it IS (even for non-MMX versions)
#endif #endif
// Note the +1 is for the MMXscaler which reads over the end // Note the +1 is for the MMXscaler which reads over the end
...@@ -1450,7 +1450,7 @@ static void initMMX2HScaler(int dstW, int xInc, uint8_t *funnyCode, int16_t *fil ...@@ -1450,7 +1450,7 @@ static void initMMX2HScaler(int dstW, int xInc, uint8_t *funnyCode, int16_t *fil
//code fragment //code fragment
asm volatile( __asm__ volatile(
"jmp 9f \n\t" "jmp 9f \n\t"
// Begin // Begin
"0: \n\t" "0: \n\t"
...@@ -1490,7 +1490,7 @@ static void initMMX2HScaler(int dstW, int xInc, uint8_t *funnyCode, int16_t *fil ...@@ -1490,7 +1490,7 @@ static void initMMX2HScaler(int dstW, int xInc, uint8_t *funnyCode, int16_t *fil
"=r" (fragmentLengthA) "=r" (fragmentLengthA)
); );
asm volatile( __asm__ volatile(
"jmp 9f \n\t" "jmp 9f \n\t"
// Begin // Begin
"0: \n\t" "0: \n\t"
...@@ -2167,7 +2167,7 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d ...@@ -2167,7 +2167,7 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d
SwsFilter dummyFilter= {NULL, NULL, NULL, NULL}; SwsFilter dummyFilter= {NULL, NULL, NULL, NULL};
#if defined(ARCH_X86) #if defined(ARCH_X86)
if (flags & SWS_CPU_CAPS_MMX) if (flags & SWS_CPU_CAPS_MMX)
asm volatile("emms\n\t"::: "memory"); __asm__ volatile("emms\n\t"::: "memory");
#endif #endif
#if !defined(RUNTIME_CPUDETECT) || !defined (CONFIG_GPL) //ensure that the flags match the compiled variant if cpudetect is off #if !defined(RUNTIME_CPUDETECT) || !defined (CONFIG_GPL) //ensure that the flags match the compiled variant if cpudetect is off
......
This diff is collapsed.
...@@ -133,7 +133,7 @@ static inline int RENAME(yuv420_rgb16)(SwsContext *c, uint8_t* src[], int srcStr ...@@ -133,7 +133,7 @@ static inline int RENAME(yuv420_rgb16)(SwsContext *c, uint8_t* src[], int srcStr
h_size= (c->dstW+7)&~7; h_size= (c->dstW+7)&~7;
if(h_size*2 > FFABS(dstStride[0])) h_size-=8; if(h_size*2 > FFABS(dstStride[0])) h_size-=8;
asm volatile ("pxor %mm4, %mm4;" /* zero mm4 */ ); __asm__ volatile ("pxor %mm4, %mm4;" /* zero mm4 */ );
//printf("%X %X %X %X %X %X %X %X %X %X\n", (int)&c->redDither, (int)&c->blueDither, (int)src[0], (int)src[1], (int)src[2], (int)dst[0], //printf("%X %X %X %X %X %X %X %X %X %X\n", (int)&c->redDither, (int)&c->blueDither, (int)src[0], (int)src[1], (int)src[2], (int)dst[0],
//srcStride[0],srcStride[1],srcStride[2],dstStride[0]); //srcStride[0],srcStride[1],srcStride[2],dstStride[0]);
for (y= 0; y<srcSliceH; y++ ) { for (y= 0; y<srcSliceH; y++ ) {
...@@ -148,7 +148,7 @@ static inline int RENAME(yuv420_rgb16)(SwsContext *c, uint8_t* src[], int srcStr ...@@ -148,7 +148,7 @@ static inline int RENAME(yuv420_rgb16)(SwsContext *c, uint8_t* src[], int srcStr
c->redDither= ff_dither8[(y+1)&1]; c->redDither= ff_dither8[(y+1)&1];
/* This MMX assembly code deals with a SINGLE scan line at a time, /* This MMX assembly code deals with a SINGLE scan line at a time,
* it converts 8 pixels in each iteration. */ * it converts 8 pixels in each iteration. */
asm volatile ( __asm__ volatile (
/* load data for start of next scan line */ /* load data for start of next scan line */
"movd (%2, %0), %%mm0;" /* Load 4 Cb 00 00 00 00 u3 u2 u1 u0 */ "movd (%2, %0), %%mm0;" /* Load 4 Cb 00 00 00 00 u3 u2 u1 u0 */
"movd (%3, %0), %%mm1;" /* Load 4 Cr 00 00 00 00 v3 v2 v1 v0 */ "movd (%3, %0), %%mm1;" /* Load 4 Cr 00 00 00 00 v3 v2 v1 v0 */
...@@ -210,7 +210,7 @@ YUV2RGB ...@@ -210,7 +210,7 @@ YUV2RGB
); );
} }
asm volatile (EMMS); __asm__ volatile (EMMS);
return srcSliceH; return srcSliceH;
} }
...@@ -227,7 +227,7 @@ static inline int RENAME(yuv420_rgb15)(SwsContext *c, uint8_t* src[], int srcStr ...@@ -227,7 +227,7 @@ static inline int RENAME(yuv420_rgb15)(SwsContext *c, uint8_t* src[], int srcStr
h_size= (c->dstW+7)&~7; h_size= (c->dstW+7)&~7;
if(h_size*2 > FFABS(dstStride[0])) h_size-=8; if(h_size*2 > FFABS(dstStride[0])) h_size-=8;
asm volatile ("pxor %mm4, %mm4;" /* zero mm4 */ ); __asm__ volatile ("pxor %mm4, %mm4;" /* zero mm4 */ );
//printf("%X %X %X %X %X %X %X %X %X %X\n", (int)&c->redDither, (int)&c->blueDither, (int)src[0], (int)src[1], (int)src[2], (int)dst[0], //printf("%X %X %X %X %X %X %X %X %X %X\n", (int)&c->redDither, (int)&c->blueDither, (int)src[0], (int)src[1], (int)src[2], (int)dst[0],
//srcStride[0],srcStride[1],srcStride[2],dstStride[0]); //srcStride[0],srcStride[1],srcStride[2],dstStride[0]);
for (y= 0; y<srcSliceH; y++ ) { for (y= 0; y<srcSliceH; y++ ) {
...@@ -242,7 +242,7 @@ static inline int RENAME(yuv420_rgb15)(SwsContext *c, uint8_t* src[], int srcStr ...@@ -242,7 +242,7 @@ static inline int RENAME(yuv420_rgb15)(SwsContext *c, uint8_t* src[], int srcStr
c->redDither= ff_dither8[(y+1)&1]; c->redDither= ff_dither8[(y+1)&1];
/* This MMX assembly code deals with a SINGLE scan line at a time, /* This MMX assembly code deals with a SINGLE scan line at a time,
* it converts 8 pixels in each iteration. */ * it converts 8 pixels in each iteration. */
asm volatile ( __asm__ volatile (
/* load data for start of next scan line */ /* load data for start of next scan line */
"movd (%2, %0), %%mm0;" /* Load 4 Cb 00 00 00 00 u3 u2 u1 u0 */ "movd (%2, %0), %%mm0;" /* Load 4 Cb 00 00 00 00 u3 u2 u1 u0 */
"movd (%3, %0), %%mm1;" /* Load 4 Cr 00 00 00 00 v3 v2 v1 v0 */ "movd (%3, %0), %%mm1;" /* Load 4 Cr 00 00 00 00 v3 v2 v1 v0 */
...@@ -299,7 +299,7 @@ YUV2RGB ...@@ -299,7 +299,7 @@ YUV2RGB
); );
} }
asm volatile (EMMS); __asm__ volatile (EMMS);
return srcSliceH; return srcSliceH;
} }
...@@ -315,7 +315,7 @@ static inline int RENAME(yuv420_rgb24)(SwsContext *c, uint8_t* src[], int srcStr ...@@ -315,7 +315,7 @@ static inline int RENAME(yuv420_rgb24)(SwsContext *c, uint8_t* src[], int srcStr
h_size= (c->dstW+7)&~7; h_size= (c->dstW+7)&~7;
if(h_size*3 > FFABS(dstStride[0])) h_size-=8; if(h_size*3 > FFABS(dstStride[0])) h_size-=8;
asm volatile ("pxor %mm4, %mm4;" /* zero mm4 */ ); __asm__ volatile ("pxor %mm4, %mm4;" /* zero mm4 */ );
for (y= 0; y<srcSliceH; y++ ) { for (y= 0; y<srcSliceH; y++ ) {
uint8_t *image = dst[0] + (y+srcSliceY)*dstStride[0]; uint8_t *image = dst[0] + (y+srcSliceY)*dstStride[0];
...@@ -326,7 +326,7 @@ static inline int RENAME(yuv420_rgb24)(SwsContext *c, uint8_t* src[], int srcStr ...@@ -326,7 +326,7 @@ static inline int RENAME(yuv420_rgb24)(SwsContext *c, uint8_t* src[], int srcStr
/* This MMX assembly code deals with a SINGLE scan line at a time, /* This MMX assembly code deals with a SINGLE scan line at a time,
* it converts 8 pixels in each iteration. */ * it converts 8 pixels in each iteration. */
asm volatile ( __asm__ volatile (
/* load data for start of next scan line */ /* load data for start of next scan line */
"movd (%2, %0), %%mm0;" /* Load 4 Cb 00 00 00 00 u3 u2 u1 u0 */ "movd (%2, %0), %%mm0;" /* Load 4 Cb 00 00 00 00 u3 u2 u1 u0 */
"movd (%3, %0), %%mm1;" /* Load 4 Cr 00 00 00 00 v3 v2 v1 v0 */ "movd (%3, %0), %%mm1;" /* Load 4 Cr 00 00 00 00 v3 v2 v1 v0 */
...@@ -445,7 +445,7 @@ YUV2RGB ...@@ -445,7 +445,7 @@ YUV2RGB
); );
} }
asm volatile (EMMS); __asm__ volatile (EMMS);
return srcSliceH; return srcSliceH;
} }
...@@ -461,7 +461,7 @@ static inline int RENAME(yuv420_rgb32)(SwsContext *c, uint8_t* src[], int srcStr ...@@ -461,7 +461,7 @@ static inline int RENAME(yuv420_rgb32)(SwsContext *c, uint8_t* src[], int srcStr
h_size= (c->dstW+7)&~7; h_size= (c->dstW+7)&~7;
if(h_size*4 > FFABS(dstStride[0])) h_size-=8; if(h_size*4 > FFABS(dstStride[0])) h_size-=8;
asm volatile ("pxor %mm4, %mm4;" /* zero mm4 */ ); __asm__ volatile ("pxor %mm4, %mm4;" /* zero mm4 */ );
for (y= 0; y<srcSliceH; y++ ) { for (y= 0; y<srcSliceH; y++ ) {
uint8_t *image = dst[0] + (y+srcSliceY)*dstStride[0]; uint8_t *image = dst[0] + (y+srcSliceY)*dstStride[0];
...@@ -472,7 +472,7 @@ static inline int RENAME(yuv420_rgb32)(SwsContext *c, uint8_t* src[], int srcStr ...@@ -472,7 +472,7 @@ static inline int RENAME(yuv420_rgb32)(SwsContext *c, uint8_t* src[], int srcStr
/* This MMX assembly code deals with a SINGLE scan line at a time, /* This MMX assembly code deals with a SINGLE scan line at a time,
* it converts 8 pixels in each iteration. */ * it converts 8 pixels in each iteration. */
asm volatile ( __asm__ volatile (
/* load data for start of next scan line */ /* load data for start of next scan line */
"movd (%2, %0), %%mm0;" /* Load 4 Cb 00 00 00 00 u3 u2 u1 u0 */ "movd (%2, %0), %%mm0;" /* Load 4 Cb 00 00 00 00 u3 u2 u1 u0 */
"movd (%3, %0), %%mm1;" /* Load 4 Cr 00 00 00 00 v3 v2 v1 v0 */ "movd (%3, %0), %%mm1;" /* Load 4 Cr 00 00 00 00 v3 v2 v1 v0 */
...@@ -531,6 +531,6 @@ YUV2RGB ...@@ -531,6 +531,6 @@ YUV2RGB
); );
} }
asm volatile (EMMS); __asm__ volatile (EMMS);
return srcSliceH; return srcSliceH;
} }
...@@ -85,7 +85,7 @@ static int vis_420P_ARGB32(SwsContext *c, uint8_t* src[], int srcStride[], int s ...@@ -85,7 +85,7 @@ static int vis_420P_ARGB32(SwsContext *c, uint8_t* src[], int srcStride[], int s
int y, out1, out2, out3, out4, out5, out6; int y, out1, out2, out3, out4, out5, out6;
for(y=0;y < srcSliceH;++y) { for(y=0;y < srcSliceH;++y) {
asm volatile ( __asm__ volatile (
YUV2RGB_INIT YUV2RGB_INIT
"wr %%g0, 0xd2, %%asi \n\t" /* ASI_FL16_P */ "wr %%g0, 0xd2, %%asi \n\t" /* ASI_FL16_P */
"1: \n\t" "1: \n\t"
...@@ -136,7 +136,7 @@ static int vis_422P_ARGB32(SwsContext *c, uint8_t* src[], int srcStride[], int s ...@@ -136,7 +136,7 @@ static int vis_422P_ARGB32(SwsContext *c, uint8_t* src[], int srcStride[], int s
int y, out1, out2, out3, out4, out5, out6; int y, out1, out2, out3, out4, out5, out6;
for(y=0;y < srcSliceH;++y) { for(y=0;y < srcSliceH;++y) {
asm volatile ( __asm__ volatile (
YUV2RGB_INIT YUV2RGB_INIT
"wr %%g0, 0xd2, %%asi \n\t" /* ASI_FL16_P */ "wr %%g0, 0xd2, %%asi \n\t" /* ASI_FL16_P */
"1: \n\t" "1: \n\t"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment