trunk/3rdparty/lzma/C/CpuArch.c
| r242849 | r242850 | |
| 72 | 72 | |
| 73 | 73 | #else |
| 74 | 74 | |
| 75 | | __asm__ __volatile__ ( |
| 76 | | "cpuid" |
| 77 | | : "=a" (*a) , |
| 78 | | "=b" (*b) , |
| 79 | | "=c" (*c) , |
| 80 | | "=d" (*d) |
| 81 | | : "0" (function)) ; |
| 75 | #ifdef __PIC__ |
| 76 | __asm__ __volatile__ ( |
| 77 | "mov %%ebx, %%edi;" |
| 78 | "cpuid;" |
| 79 | "xchgl %%ebx, %%edi;" |
| 80 | : "=a" (*a) , |
| 81 | "=D" (*b) , /* edi */ |
| 82 | "=c" (*c) , |
| 83 | "=d" (*d) |
| 84 | : "0" (function)) ; |
| 85 | #else // __PIC__ |
| 86 | __asm__ __volatile__ ( |
| 87 | "cpuid" |
| 88 | : "=a" (*a) , |
| 89 | "=b" (*b) , |
| 90 | "=c" (*c) , |
| 91 | "=d" (*d) |
| 92 | : "0" (function)) ; |
| 93 | #endif // __PIC__ |
| 94 | |
| 95 | #endif |
| 82 | 96 | |
| 83 | | #endif |
| 84 | | |
| 85 | 97 | #else |
| 86 | 98 | |
| 87 | 99 | int CPUInfo[4]; |
| r242849 | r242850 | |
| 123 | 135 | return -1; |
| 124 | 136 | } |
| 125 | 137 | |
| 126 | | Bool CPU_Is_InOrder() |
| 138 | Bool CPU_Is_InOrder(void) |
| 127 | 139 | { |
| 128 | 140 | Cx86cpuid p; |
| 129 | 141 | int firm; |
| r242849 | r242850 | |
| 142 | 154 | return True; |
| 143 | 155 | } |
| 144 | 156 | |
| 145 | | #if !defined(MY_CPU_AMD64) && defined(_WIN32) |
| 146 | | static Bool CPU_Sys_Is_SSE_Supported() |
| 157 | #if !defined(MY_CPU_AMD64) && defined(_WIN32_7Z) |
| 158 | static Bool CPU_Sys_Is_SSE_Supported(void) |
| 147 | 159 | { |
| 148 | 160 | OSVERSIONINFO vi; |
| 149 | 161 | vi.dwOSVersionInfoSize = sizeof(vi); |
| r242849 | r242850 | |
| 156 | 168 | #define CHECK_SYS_SSE_SUPPORT |
| 157 | 169 | #endif |
| 158 | 170 | |
| 159 | | Bool CPU_Is_Aes_Supported() |
| 171 | Bool CPU_Is_Aes_Supported(void) |
| 160 | 172 | { |
| 161 | 173 | Cx86cpuid p; |
| 162 | 174 | CHECK_SYS_SSE_SUPPORT |
trunk/3rdparty/lzma/C/CpuArch.h
| r242849 | r242850 | |
| 20 | 20 | #define MY_CPU_AMD64 |
| 21 | 21 | #endif |
| 22 | 22 | |
| 23 | | #if defined(MY_CPU_AMD64) || defined(_M_IA64) |
| 23 | #ifdef PTR64 |
| 24 | 24 | #define MY_CPU_64BIT |
| 25 | 25 | #endif |
| 26 | 26 | |
| r242849 | r242850 | |
| 36 | 36 | #define MY_CPU_32BIT |
| 37 | 37 | #endif |
| 38 | 38 | |
| 39 | | #if defined(_WIN32) && defined(_M_ARM) |
| 39 | #if defined(_WIN32_7Z) && defined(_M_ARM) |
| 40 | 40 | #define MY_CPU_ARM_LE |
| 41 | 41 | #endif |
| 42 | 42 | |
| 43 | | #if defined(_WIN32) && defined(_M_IA64) |
| 43 | #if defined(_WIN32_7Z) && defined(_M_IA64) |
| 44 | 44 | #define MY_CPU_IA64_LE |
| 45 | 45 | #endif |
| 46 | 46 | |
| r242849 | r242850 | |
| 52 | 52 | #define MY_CPU_LE |
| 53 | 53 | #endif |
| 54 | 54 | |
| 55 | | #if defined(__BIG_ENDIAN__) || defined(__m68k__) || defined(__ARMEB__) || defined(__MIPSEB__) |
| 55 | #ifdef BIGENDIAN |
| 56 | 56 | #define MY_CPU_BE |
| 57 | 57 | #endif |
| 58 | 58 | |
| r242849 | r242850 | |
| 97 | 97 | |
| 98 | 98 | #endif |
| 99 | 99 | |
| 100 | | #if defined(MY_CPU_LE_UNALIGN) && defined(_WIN64) && (_MSC_VER >= 1300) |
| 100 | #if defined(MY_CPU_LE_UNALIGN) && defined(_WIN64) && (defined(_MSC_VER) && (_MSC_VER >= 1300)) |
| 101 | #include <stdlib.h> |
| 101 | 102 | |
| 102 | 103 | #pragma intrinsic(_byteswap_ulong) |
| 103 | 104 | #pragma intrinsic(_byteswap_uint64) |
| r242849 | r242850 | |
| 145 | 146 | #define x86cpuid_GetModel(p) (((p)->ver >> 4) & 0xF00F) |
| 146 | 147 | #define x86cpuid_GetStepping(p) ((p)->ver & 0xF) |
| 147 | 148 | |
| 148 | | Bool CPU_Is_InOrder(); |
| 149 | | Bool CPU_Is_Aes_Supported(); |
| 149 | Bool CPU_Is_InOrder(void); |
| 150 | Bool CPU_Is_Aes_Supported(void); |
| 150 | 151 | |
| 151 | 152 | #endif |
| 152 | 153 | |
trunk/3rdparty/lzma/C/LzmaDec.c
| r242849 | r242850 | |
| 967 | 967 | return SZ_OK; |
| 968 | 968 | } |
| 969 | 969 | |
| 970 | // why isn't there an interface to pass in the properties directly???? |
| 971 | SRes LzmaDec_Allocate_MAME(CLzmaDec *p, const CLzmaProps *propNew, ISzAlloc *alloc) |
| 972 | { |
| 973 | SizeT dicBufSize; |
| 974 | RINOK(LzmaDec_AllocateProbs2(p, propNew, alloc)); |
| 975 | dicBufSize = propNew->dicSize; |
| 976 | if (p->dic == 0 || dicBufSize != p->dicBufSize) |
| 977 | { |
| 978 | LzmaDec_FreeDict(p, alloc); |
| 979 | p->dic = (Byte *)alloc->Alloc(alloc, dicBufSize); |
| 980 | if (p->dic == 0) |
| 981 | { |
| 982 | LzmaDec_FreeProbs(p, alloc); |
| 983 | return SZ_ERROR_MEM; |
| 984 | } |
| 985 | } |
| 986 | p->dicBufSize = dicBufSize; |
| 987 | p->prop = *propNew; |
| 988 | return SZ_OK; |
| 989 | } |
| 990 | |
| 970 | 991 | SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, |
| 971 | 992 | const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode, |
| 972 | 993 | ELzmaStatus *status, ISzAlloc *alloc) |
trunk/3rdparty/lzma/C/LzmaEnc.c
| r242849 | r242850 | |
| 1905 | 1905 | static SRes LzmaEnc_Alloc(CLzmaEnc *p, UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig) |
| 1906 | 1906 | { |
| 1907 | 1907 | UInt32 beforeSize = kNumOpts; |
| 1908 | #ifndef _7ZIP_ST |
| 1908 | 1909 | Bool btMode; |
| 1910 | #endif |
| 1909 | 1911 | if (!RangeEnc_Alloc(&p->rc, alloc)) |
| 1910 | | return SZ_ERROR_MEM; |
| 1912 | return SZ_ERROR_MEM; |
| 1913 | #ifndef _7ZIP_ST |
| 1911 | 1914 | btMode = (p->matchFinderBase.btMode != 0); |
| 1912 | | #ifndef _7ZIP_ST |
| 1913 | 1915 | p->mtMode = (p->multiThread && !p->fastMode && btMode); |
| 1914 | 1916 | #endif |
| 1915 | 1917 | |
| r242849 | r242850 | |
| 2085 | 2087 | CLzmaEnc *p = (CLzmaEnc *)pp; |
| 2086 | 2088 | if (p->mtMode) |
| 2087 | 2089 | MatchFinderMt_ReleaseStream(&p->matchFinderMt); |
| 2088 | | #else |
| 2089 | | pp = pp; |
| 2090 | 2090 | #endif |
| 2091 | 2091 | } |
| 2092 | 2092 | |