~dannf/ubuntu/saucy/djvulibre/lp1224195

« back to all changes in this revision

Viewing changes to libdjvu/MMX.cpp

  • Committer: Package Import Robot
  • Author(s): Barak A. Pearlmutter
  • Date: 2011-06-09 23:06:30 UTC
  • mfrom: (1.1.8) (12.2.19 sid)
  • Revision ID: package-import@ubuntu.com-20110609230630-iixyb3dzba1lio13
Tags: 3.5.24-7
upstream fix to page extraction bug (closes: #629941)

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF
53
53
//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
54
54
//C- +------------------------------------------------------------------
55
 
// 
56
 
// $Id: MMX.cpp,v 1.12 2007/03/25 20:48:33 leonb Exp $
57
 
// $Name: debian_version_3_5_23-3 $
58
55
 
59
56
#ifdef HAVE_CONFIG_H
60
57
# include "config.h"
65
62
 
66
63
#include "MMX.h"
67
64
#include <stdio.h>
 
65
#include <stddef.h>
68
66
#include <stdlib.h>
69
67
 
70
68
 
169
167
                    : "=m" (cpuflags) :
170
168
                    : "eax","ecx","edx");
171
169
#endif
 
170
#if defined(MMX) && defined(__GNUC__) && defined(__x86_64__)
 
171
  // Detection of MMX for GCC
 
172
  __asm__ volatile (// Check that CR0:EM is clear
 
173
                    "xorl %%edx,%%edx\n\t"
 
174
                    "smsw %%ax\n\t"
 
175
                    "andl $4,%%eax\n\t"
 
176
                    "jnz 1f\n\t"
 
177
                    // Execute CPUID
 
178
                    "movl $1,%%eax\n\t"
 
179
                    "cpuid\n"
 
180
                    // Finish
 
181
                    "1:\tmovl %%edx, %0"
 
182
                    : "=m" (cpuflags) :
 
183
                    : "eax","ebx","ecx","edx");
 
184
#endif
172
185
#if defined(MMX) && defined(_MSC_VER) && defined(_M_IX86)
173
 
  // Detection of MMX for MSVC
 
186
  // Detection of MMX for MSVC 32 bits
174
187
  __asm {  pushfd
175
188
           pop     ecx
176
189
           xor     edx,edx