diff cabac.h @ 8031:eebc7209c47f libavcodec

Convert asm keyword into __asm__. Neither the asm() nor the __asm__() keyword is 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 syntax.
author flameeyes
date Thu, 16 Oct 2008 13:34:09 +0000
parents dc8d9cc3369e
children 7a463923ecd1
line wrap: on
line diff
--- a/cabac.h	Wed Oct 15 08:01:54 2008 +0000
+++ b/cabac.h	Thu Oct 16 13:34:09 2008 +0000
@@ -304,7 +304,7 @@
     int temp;
 #if 0
     //P3:683    athlon:475
-    asm(
+    __asm__(
         "lea -0x100(%0), %2         \n\t"
         "shr $31, %2                \n\t"  //FIXME 31->63 for x86-64
         "shl %%cl, %0               \n\t"
@@ -313,7 +313,7 @@
     );
 #elif 0
     //P3:680    athlon:474
-    asm(
+    __asm__(
         "cmp $0x100, %0             \n\t"
         "setb %%cl                  \n\t"  //FIXME 31->63 for x86-64
         "shl %%cl, %0               \n\t"
@@ -323,7 +323,7 @@
 #elif 1
     int temp2;
     //P3:665    athlon:517
-    asm(
+    __asm__(
         "lea -0x100(%0), %%eax      \n\t"
         "cltd                       \n\t"
         "mov %0, %%eax              \n\t"
@@ -336,7 +336,7 @@
 #elif 0
     int temp2;
     //P3:673    athlon:509
-    asm(
+    __asm__(
         "cmp $0x100, %0             \n\t"
         "sbb %%edx, %%edx           \n\t"
         "mov %0, %%eax              \n\t"
@@ -349,7 +349,7 @@
 #else
     int temp2;
     //P3:677    athlon:511
-    asm(
+    __asm__(
         "cmp $0x100, %0             \n\t"
         "lea (%0, %0), %%eax        \n\t"
         "lea (%1, %1), %%edx        \n\t"
@@ -385,7 +385,7 @@
     int bit;
 
 #ifndef BRANCHLESS_CABAC_DECODER
-    asm volatile(
+    __asm__ volatile(
         "movzbl (%1), %0                        \n\t"
         "movl "RANGE    "(%2), %%ebx            \n\t"
         "movl "RANGE    "(%2), %%edx            \n\t"
@@ -524,7 +524,7 @@
         "add    "tmp"       , "low"                                     \n\t"\
         "1:                                                             \n\t"
 
-    asm volatile(
+    __asm__ volatile(
         "movl "RANGE    "(%2), %%esi            \n\t"
         "movl "LOW      "(%2), %%ebx            \n\t"
         BRANCHLESS_GET_CABAC("%0", "%2", "(%1)", "%%ebx", "%%bx", "%%esi", "%%edx", "%%dl")
@@ -591,7 +591,7 @@
 static int av_unused get_cabac_bypass(CABACContext *c){
 #if 0 //not faster
     int bit;
-    asm volatile(
+    __asm__ volatile(
         "movl "RANGE    "(%1), %%ebx            \n\t"
         "movl "LOW      "(%1), %%eax            \n\t"
         "shl $17, %%ebx                         \n\t"
@@ -638,7 +638,7 @@
 
 static av_always_inline int get_cabac_bypass_sign(CABACContext *c, int val){
 #if defined(ARCH_X86) && !(defined(PIC) && defined(__GNUC__))
-    asm volatile(
+    __asm__ volatile(
         "movl "RANGE    "(%1), %%ebx            \n\t"
         "movl "LOW      "(%1), %%eax            \n\t"
         "shl $17, %%ebx                         \n\t"