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

# --- ROCK-COPYRIGHT-NOTE-BEGIN ---
#
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
# Please add additional copyright information _after_ the line containing
# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
# the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
#
# ROCK Linux: rock-src/package/blindcoder/libsdl/noreg-opt-fix.patch
# ROCK Linux is Copyright (C) 1998 - 2004 Clifford Wolf
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# --- ROCK-COPYRIGHT-NOTE-END ---
gcc 3.3 is a bit too smart here, It optimizes these variables away. However
movd to a mmx register only works from reg or mem.
-jsaw
--- SDL-1.2.6/src/video/SDL_RLEaccel.c 2003-08-30 21:13:06.000000000 +0200
+++ SDL-1.2.6-rock/src/video/SDL_RLEaccel.c 2004-02-23 18:11:50.000000000 +0100
@@ -143,7 +143,7 @@
do { \
Uint32 *srcp = (Uint32 *)(from); \
Uint32 *dstp = (Uint32 *)(to); \
- int i = 0x00FF00FF; \
+ volatile int i = 0x00FF00FF; \
movd_m2r(*(&i), mm3); \
punpckldq_r2r(mm3, mm3); \
i = 0xFF000000; \
@@ -213,10 +213,11 @@
#define ALPHA_BLIT16_565MMX(to, from, length, bpp, alpha) \
do { \
- int i, n = 0; \
+ volatile int i; \
+ int n = 0; \
Uint16 *srcp = (Uint16 *)(from); \
Uint16 *dstp = (Uint16 *)(to); \
- Uint32 ALPHA = 0xF800; \
+ volatile Uint32 ALPHA = 0xF800; \
movd_m2r(*(&ALPHA), mm1); \
punpcklwd_r2r(mm1, mm1); \
punpcklwd_r2r(mm1, mm1); \
@@ -229,7 +230,7 @@
punpcklwd_r2r(mm7, mm7); \
punpcklwd_r2r(mm7, mm7); \
alpha &= ~(1+2+4); \
- i = (Uint32)alpha | (Uint32)alpha << 16; \
+ *(&i) = (Uint32)alpha | (Uint32)alpha << 16; \
movd_m2r(*(&i), mm0); \
punpckldq_r2r(mm0, mm0); \
ALPHA = alpha >> 3; \
@@ -303,10 +304,11 @@
#define ALPHA_BLIT16_555MMX(to, from, length, bpp, alpha) \
do { \
- int i, n = 0; \
+ volatile int i; \
+ int n = 0; \
Uint16 *srcp = (Uint16 *)(from); \
Uint16 *dstp = (Uint16 *)(to); \
- Uint32 ALPHA = 0x7C00; \
+ volatile Uint32 ALPHA = 0x7C00; \
movd_m2r(*(&ALPHA), mm1); \
punpcklwd_r2r(mm1, mm1); \
punpcklwd_r2r(mm1, mm1); \
@@ -319,10 +321,10 @@
punpcklwd_r2r(mm7, mm7); \
punpcklwd_r2r(mm7, mm7); \
alpha &= ~(1+2+4); \
- i = (Uint32)alpha | (Uint32)alpha << 16; \
+ *(&i) = (Uint32)alpha | (Uint32)alpha << 16; \
movd_m2r(*(&i), mm0); \
punpckldq_r2r(mm0, mm0); \
- i = ((int)(length) & 3); \
+ i = ((int)(length) & 3); \
ALPHA = alpha >> 3; \
for(; i > 0; --i) { \
Uint32 s = *srcp++; \
@@ -524,7 +526,7 @@
do { \
Uint32 *srcp = (Uint32 *)(from); \
Uint32 *dstp = (Uint32 *)(to); \
- int i = 0x00fefefe; \
+ volatile int i = 0x00fefefe; \
movd_m2r(*(&i), mm4); \
punpckldq_r2r(mm4, mm4); \
i = 0x00010101; \