Commit 826461bb4068bab1c8fef6eb11117a260aa3e2c0
1 parent
02536f8b
big endian SSE fix
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1201 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
33 additions
and
8 deletions
target-i386/cpu.h
| @@ -339,15 +339,40 @@ typedef struct SegmentCache { | @@ -339,15 +339,40 @@ typedef struct SegmentCache { | ||
| 339 | uint32_t flags; | 339 | uint32_t flags; |
| 340 | } SegmentCache; | 340 | } SegmentCache; |
| 341 | 341 | ||
| 342 | -typedef struct { | ||
| 343 | - union { | ||
| 344 | - uint8_t b[16]; | ||
| 345 | - uint16_t w[8]; | ||
| 346 | - uint32_t l[4]; | ||
| 347 | - uint64_t q[2]; | ||
| 348 | - } u; | 342 | +typedef union { |
| 343 | + uint8_t _b[16]; | ||
| 344 | + uint16_t _w[8]; | ||
| 345 | + uint32_t _l[4]; | ||
| 346 | + uint64_t _q[2]; | ||
| 349 | } XMMReg; | 347 | } XMMReg; |
| 350 | 348 | ||
| 349 | +typedef union { | ||
| 350 | + uint8_t _b[8]; | ||
| 351 | + uint16_t _w[2]; | ||
| 352 | + uint32_t _l[1]; | ||
| 353 | + uint64_t q; | ||
| 354 | +} MMXReg; | ||
| 355 | + | ||
| 356 | +#ifdef WORDS_BIGENDIAN | ||
| 357 | +#define XMM_B(n) _b[15 - (n)] | ||
| 358 | +#define XMM_W(n) _w[7 - (n)] | ||
| 359 | +#define XMM_L(n) _l[3 - (n)] | ||
| 360 | +#define XMM_Q(n) _q[1 - (n)] | ||
| 361 | + | ||
| 362 | +#define MMX_B(n) _b[7 - (n)] | ||
| 363 | +#define MMX_W(n) _w[3 - (n)] | ||
| 364 | +#define MMX_L(n) _l[1 - (n)] | ||
| 365 | +#else | ||
| 366 | +#define XMM_B(n) _b[n] | ||
| 367 | +#define XMM_W(n) _w[n] | ||
| 368 | +#define XMM_L(n) _l[n] | ||
| 369 | +#define XMM_Q(n) _q[n] | ||
| 370 | + | ||
| 371 | +#define MMX_B(n) _b[n] | ||
| 372 | +#define MMX_W(n) _w[n] | ||
| 373 | +#define MMX_L(n) _l[n] | ||
| 374 | +#endif | ||
| 375 | + | ||
| 351 | #ifdef TARGET_X86_64 | 376 | #ifdef TARGET_X86_64 |
| 352 | #define CPU_NB_REGS 16 | 377 | #define CPU_NB_REGS 16 |
| 353 | #else | 378 | #else |
| @@ -425,7 +450,7 @@ typedef struct CPUX86State { | @@ -425,7 +450,7 @@ typedef struct CPUX86State { | ||
| 425 | int exception_index; | 450 | int exception_index; |
| 426 | int error_code; | 451 | int error_code; |
| 427 | int exception_is_int; | 452 | int exception_is_int; |
| 428 | - int exception_next_eip; | 453 | + target_ulong exception_next_eip; |
| 429 | struct TranslationBlock *current_tb; /* currently executing TB */ | 454 | struct TranslationBlock *current_tb; /* currently executing TB */ |
| 430 | target_ulong cr[5]; /* NOTE: cr1 is unused */ | 455 | target_ulong cr[5]; /* NOTE: cr1 is unused */ |
| 431 | target_ulong dr[8]; /* debug registers */ | 456 | target_ulong dr[8]; /* debug registers */ |