[SCM] libav/experimental: Use cltd instead of cdq asm mnemonic, ICC and gcc support both, but SunStudio 12 only supports the former.

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:15:58 UTC 2013


The following commit has been merged in the experimental branch:
commit 7e14b8082d16816151bdecce8ad1c2bbbd003d55
Author: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
Date:   Thu Feb 28 17:01:35 2008 +0000

    Use cltd instead of cdq asm mnemonic, ICC and gcc support both, but
    SunStudio 12 only supports the former.
    
    Originally committed as revision 12275 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavcodec/cabac.h b/libavcodec/cabac.h
index 65e3a02..6d5a6f1 100644
--- a/libavcodec/cabac.h
+++ b/libavcodec/cabac.h
@@ -327,7 +327,7 @@ static inline void renorm_cabac_decoder_once(CABACContext *c){
     //P3:665    athlon:517
     asm(
         "lea -0x100(%0), %%eax      \n\t"
-        "cdq                        \n\t"
+        "cltd                       \n\t"
         "mov %0, %%eax              \n\t"
         "and %%edx, %0              \n\t"
         "and %1, %%edx              \n\t"
@@ -599,7 +599,7 @@ static int get_cabac_bypass(CABACContext *c){
         "shl $17, %%ebx                         \n\t"
         "add %%eax, %%eax                       \n\t"
         "sub %%ebx, %%eax                       \n\t"
-        "cdq                                    \n\t"
+        "cltd                                   \n\t"
         "and %%edx, %%ebx                       \n\t"
         "add %%ebx, %%eax                       \n\t"
         "test %%ax, %%ax                        \n\t"
@@ -646,7 +646,7 @@ static av_always_inline int get_cabac_bypass_sign(CABACContext *c, int val){
         "shl $17, %%ebx                         \n\t"
         "add %%eax, %%eax                       \n\t"
         "sub %%ebx, %%eax                       \n\t"
-        "cdq                                    \n\t"
+        "cltd                                   \n\t"
         "and %%edx, %%ebx                       \n\t"
         "add %%ebx, %%eax                       \n\t"
         "xor %%edx, %%ecx                       \n\t"
diff --git a/libavutil/internal.h b/libavutil/internal.h
index c4c151d..749a85c 100644
--- a/libavutil/internal.h
+++ b/libavutil/internal.h
@@ -205,7 +205,7 @@ static inline unsigned int ff_sqrt(unsigned int a)
 #if defined(ARCH_X86)
 #define MASK_ABS(mask, level)\
             asm volatile(\
-                "cdq                    \n\t"\
+                "cltd                   \n\t"\
                 "xorl %1, %0            \n\t"\
                 "subl %1, %0            \n\t"\
                 : "+a" (level), "=&d" (mask)\

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list