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.

93 lines
3.4 KiB

  1. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  2. #
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. # Please add additional copyright information _after_ the line containing
  5. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  6. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  7. #
  8. # ROCK Linux: rock-src/package/blindcoder/libsdl/noreg-opt-fix.patch
  9. # ROCK Linux is Copyright (C) 1998 - 2004 Clifford Wolf
  10. #
  11. # This patch file is dual-licensed. It is available under the license the
  12. # patched project is licensed under, as long as it is an OpenSource license
  13. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  14. # of the GNU General Public License as published by the Free Software
  15. # Foundation; either version 2 of the License, or (at your option) any later
  16. # version.
  17. #
  18. # --- ROCK-COPYRIGHT-NOTE-END ---
  19. gcc 3.3 is a bit too smart here, It optimizes these variables away. However
  20. movd to a mmx register only works from reg or mem.
  21. -jsaw
  22. --- SDL-1.2.6/src/video/SDL_RLEaccel.c 2003-08-30 21:13:06.000000000 +0200
  23. +++ SDL-1.2.6-rock/src/video/SDL_RLEaccel.c 2004-02-23 18:11:50.000000000 +0100
  24. @@ -143,7 +143,7 @@
  25. do { \
  26. Uint32 *srcp = (Uint32 *)(from); \
  27. Uint32 *dstp = (Uint32 *)(to); \
  28. - int i = 0x00FF00FF; \
  29. + volatile int i = 0x00FF00FF; \
  30. movd_m2r(*(&i), mm3); \
  31. punpckldq_r2r(mm3, mm3); \
  32. i = 0xFF000000; \
  33. @@ -213,10 +213,11 @@
  34. #define ALPHA_BLIT16_565MMX(to, from, length, bpp, alpha) \
  35. do { \
  36. - int i, n = 0; \
  37. + volatile int i; \
  38. + int n = 0; \
  39. Uint16 *srcp = (Uint16 *)(from); \
  40. Uint16 *dstp = (Uint16 *)(to); \
  41. - Uint32 ALPHA = 0xF800; \
  42. + volatile Uint32 ALPHA = 0xF800; \
  43. movd_m2r(*(&ALPHA), mm1); \
  44. punpcklwd_r2r(mm1, mm1); \
  45. punpcklwd_r2r(mm1, mm1); \
  46. @@ -229,7 +230,7 @@
  47. punpcklwd_r2r(mm7, mm7); \
  48. punpcklwd_r2r(mm7, mm7); \
  49. alpha &= ~(1+2+4); \
  50. - i = (Uint32)alpha | (Uint32)alpha << 16; \
  51. + *(&i) = (Uint32)alpha | (Uint32)alpha << 16; \
  52. movd_m2r(*(&i), mm0); \
  53. punpckldq_r2r(mm0, mm0); \
  54. ALPHA = alpha >> 3; \
  55. @@ -303,10 +304,11 @@
  56. #define ALPHA_BLIT16_555MMX(to, from, length, bpp, alpha) \
  57. do { \
  58. - int i, n = 0; \
  59. + volatile int i; \
  60. + int n = 0; \
  61. Uint16 *srcp = (Uint16 *)(from); \
  62. Uint16 *dstp = (Uint16 *)(to); \
  63. - Uint32 ALPHA = 0x7C00; \
  64. + volatile Uint32 ALPHA = 0x7C00; \
  65. movd_m2r(*(&ALPHA), mm1); \
  66. punpcklwd_r2r(mm1, mm1); \
  67. punpcklwd_r2r(mm1, mm1); \
  68. @@ -319,10 +321,10 @@
  69. punpcklwd_r2r(mm7, mm7); \
  70. punpcklwd_r2r(mm7, mm7); \
  71. alpha &= ~(1+2+4); \
  72. - i = (Uint32)alpha | (Uint32)alpha << 16; \
  73. + *(&i) = (Uint32)alpha | (Uint32)alpha << 16; \
  74. movd_m2r(*(&i), mm0); \
  75. punpckldq_r2r(mm0, mm0); \
  76. - i = ((int)(length) & 3); \
  77. + i = ((int)(length) & 3); \
  78. ALPHA = alpha >> 3; \
  79. for(; i > 0; --i) { \
  80. Uint32 s = *srcp++; \
  81. @@ -524,7 +526,7 @@
  82. do { \
  83. Uint32 *srcp = (Uint32 *)(from); \
  84. Uint32 *dstp = (Uint32 *)(to); \
  85. - int i = 0x00fefefe; \
  86. + volatile int i = 0x00fefefe; \
  87. movd_m2r(*(&i), mm4); \
  88. punpckldq_r2r(mm4, mm4); \
  89. i = 0x00010101; \