mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
2.5 KiB

  1. gcc 3.3 is a bit too smart here, It optimizes these variables away. However
  2. movd to a mmx register only works from reg or mem.
  3. -jsaw
  4. --- SDL-1.2.6/src/video/SDL_RLEaccel.c 2003-08-30 21:13:06.000000000 +0200
  5. +++ SDL-1.2.6-rock/src/video/SDL_RLEaccel.c 2004-02-23 18:11:50.000000000 +0100
  6. @@ -143,7 +143,7 @@
  7. do { \
  8. Uint32 *srcp = (Uint32 *)(from); \
  9. Uint32 *dstp = (Uint32 *)(to); \
  10. - int i = 0x00FF00FF; \
  11. + volatile int i = 0x00FF00FF; \
  12. movd_m2r(*(&i), mm3); \
  13. punpckldq_r2r(mm3, mm3); \
  14. i = 0xFF000000; \
  15. @@ -213,10 +213,11 @@
  16. #define ALPHA_BLIT16_565MMX(to, from, length, bpp, alpha) \
  17. do { \
  18. - int i, n = 0; \
  19. + volatile int i; \
  20. + int n = 0; \
  21. Uint16 *srcp = (Uint16 *)(from); \
  22. Uint16 *dstp = (Uint16 *)(to); \
  23. - Uint32 ALPHA = 0xF800; \
  24. + volatile Uint32 ALPHA = 0xF800; \
  25. movd_m2r(*(&ALPHA), mm1); \
  26. punpcklwd_r2r(mm1, mm1); \
  27. punpcklwd_r2r(mm1, mm1); \
  28. @@ -229,7 +230,7 @@
  29. punpcklwd_r2r(mm7, mm7); \
  30. punpcklwd_r2r(mm7, mm7); \
  31. alpha &= ~(1+2+4); \
  32. - i = (Uint32)alpha | (Uint32)alpha << 16; \
  33. + *(&i) = (Uint32)alpha | (Uint32)alpha << 16; \
  34. movd_m2r(*(&i), mm0); \
  35. punpckldq_r2r(mm0, mm0); \
  36. ALPHA = alpha >> 3; \
  37. @@ -303,10 +304,11 @@
  38. #define ALPHA_BLIT16_555MMX(to, from, length, bpp, alpha) \
  39. do { \
  40. - int i, n = 0; \
  41. + volatile int i; \
  42. + int n = 0; \
  43. Uint16 *srcp = (Uint16 *)(from); \
  44. Uint16 *dstp = (Uint16 *)(to); \
  45. - Uint32 ALPHA = 0x7C00; \
  46. + volatile Uint32 ALPHA = 0x7C00; \
  47. movd_m2r(*(&ALPHA), mm1); \
  48. punpcklwd_r2r(mm1, mm1); \
  49. punpcklwd_r2r(mm1, mm1); \
  50. @@ -319,10 +321,10 @@
  51. punpcklwd_r2r(mm7, mm7); \
  52. punpcklwd_r2r(mm7, mm7); \
  53. alpha &= ~(1+2+4); \
  54. - i = (Uint32)alpha | (Uint32)alpha << 16; \
  55. + *(&i) = (Uint32)alpha | (Uint32)alpha << 16; \
  56. movd_m2r(*(&i), mm0); \
  57. punpckldq_r2r(mm0, mm0); \
  58. - i = ((int)(length) & 3); \
  59. + i = ((int)(length) & 3); \
  60. ALPHA = alpha >> 3; \
  61. for(; i > 0; --i) { \
  62. Uint32 s = *srcp++; \
  63. @@ -524,7 +526,7 @@
  64. do { \
  65. Uint32 *srcp = (Uint32 *)(from); \
  66. Uint32 *dstp = (Uint32 *)(to); \
  67. - int i = 0x00fefefe; \
  68. + volatile int i = 0x00fefefe; \
  69. movd_m2r(*(&i), mm4); \
  70. punpckldq_r2r(mm4, mm4); \
  71. i = 0x00010101; \