| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 _mm_pause(); | 179 _mm_pause(); |
| 180 #else | 180 #else |
| 181 #define x86_pause_hint()\ | 181 #define x86_pause_hint()\ |
| 182 __asm pause | 182 __asm pause |
| 183 #endif | 183 #endif |
| 184 #endif | 184 #endif |
| 185 | 185 |
| 186 #if defined(__GNUC__) && __GNUC__ | 186 #if defined(__GNUC__) && __GNUC__ |
| 187 static void | 187 static void |
| 188 x87_set_control_word(unsigned short mode) { | 188 x87_set_control_word(unsigned short mode) { |
| 189 __asm__ __volatile__("fldcw %0" : : "m"( *&mode)); | 189 __asm__ __volatile__("fldcw %0" : : "m"(*&mode)); |
| 190 } | 190 } |
| 191 static unsigned short | 191 static unsigned short |
| 192 x87_get_control_word(void) { | 192 x87_get_control_word(void) { |
| 193 unsigned short mode; | 193 unsigned short mode; |
| 194 __asm__ __volatile__("fstcw %0\n\t":"=m"( *&mode):); | 194 __asm__ __volatile__("fstcw %0\n\t":"=m"(*&mode):); |
| 195 return mode; | 195 return mode; |
| 196 } | 196 } |
| 197 #elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) | 197 #elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) |
| 198 static void | 198 static void |
| 199 x87_set_control_word(unsigned short mode) | |
| 200 { | |
| 201 asm volatile("fldcw %0" : : "m"(*&mode)); | |
| 202 } | |
| 203 static unsigned short | |
| 204 x87_get_control_word(void) | |
| 205 { | |
| 206 unsigned short mode; | |
| 207 asm volatile("fstcw %0\n\t":"=m"(*&mode):); | |
| 208 return mode; | |
| 209 } | |
| 210 #elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) | |
| 211 static void | |
| 212 x87_set_control_word(unsigned short mode) { | 199 x87_set_control_word(unsigned short mode) { |
| 213 asm volatile("fldcw %0" : : "m"( *&mode)); | 200 asm volatile("fldcw %0" : : "m"(*&mode)); |
| 214 } | 201 } |
| 215 static unsigned short | 202 static unsigned short |
| 216 x87_get_control_word(void) { | 203 x87_get_control_word(void) { |
| 217 unsigned short mode; | 204 unsigned short mode; |
| 218 asm volatile("fstcw %0\n\t":"=m"( *&mode):); | 205 asm volatile("fstcw %0\n\t":"=m"(*&mode):); |
| 219 return mode; | 206 return mode; |
| 220 } | 207 } |
| 221 #elif ARCH_X86_64 | 208 #elif ARCH_X86_64 |
| 222 /* No fldcw intrinsics on Windows x64, punt to external asm */ | 209 /* No fldcw intrinsics on Windows x64, punt to external asm */ |
| 223 extern void vpx_winx64_fldcw(unsigned short mode); | 210 extern void vpx_winx64_fldcw(unsigned short mode); |
| 224 extern unsigned short vpx_winx64_fstcw(void); | 211 extern unsigned short vpx_winx64_fstcw(void); |
| 225 #define x87_set_control_word vpx_winx64_fldcw | 212 #define x87_set_control_word vpx_winx64_fldcw |
| 226 #define x87_get_control_word vpx_winx64_fstcw | 213 #define x87_get_control_word vpx_winx64_fstcw |
| 227 #else | 214 #else |
| 228 static void | 215 static void |
| (...skipping 12 matching lines...) Expand all Loading... |
| 241 x87_set_double_precision(void) { | 228 x87_set_double_precision(void) { |
| 242 unsigned short mode = x87_get_control_word(); | 229 unsigned short mode = x87_get_control_word(); |
| 243 x87_set_control_word((mode&~0x300) | 0x200); | 230 x87_set_control_word((mode&~0x300) | 0x200); |
| 244 return mode; | 231 return mode; |
| 245 } | 232 } |
| 246 | 233 |
| 247 | 234 |
| 248 extern void vpx_reset_mmx_state(void); | 235 extern void vpx_reset_mmx_state(void); |
| 249 #endif | 236 #endif |
| 250 | 237 |
| OLD | NEW |