1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 12:28:22 +01:00

- fixed gcc-4 compilation issues (Vladimir Nadvornik <nadvornik@suse.cz>)

- fixed amd64 compilation issues (Vladimir Nadvornik <nadvornik@suse.cz>)
This commit is contained in:
dan
2005-08-22 19:07:57 +00:00
parent d26f18505a
commit 91f5abc955
3 changed files with 44 additions and 25 deletions

View File

@@ -5,6 +5,8 @@ Changes since version 0.92.0:
argument is an absolute path argument is an absolute path
- updated german translations (Torsten Marek <shlomme@gmx.net>) - updated german translations (Torsten Marek <shlomme@gmx.net>)
- fixed WPrefs.app to find its icons when not installed under GNUstep paths - fixed WPrefs.app to find its icons when not installed under GNUstep paths
- fixed gcc-4 compilation issues (Vladimir Nadvornik <nadvornik@suse.cz>)
- fixed amd64 compilation issues (Vladimir Nadvornik <nadvornik@suse.cz>)
Changes since version 0.91.0: Changes since version 0.91.0:

View File

@@ -197,7 +197,7 @@ if test "$ac_cv_prog_gcc" = yes; then
AC_CACHE_CHECK(whether gcc supports x86 inline asm, AC_CACHE_CHECK(whether gcc supports x86 inline asm,
ac_cv_c_inline_asm, ac_cv_c_inline_asm,
[AC_TRY_LINK(,[{int x; asm volatile("movl %%eax, %%ebx\n":: [AC_TRY_LINK(,[{int x; asm volatile("movl %%eax, %%ebx\n\t pushal\n\t popal"::
"m" (x),"m" (x),"m" (x),"m" (x),"m" (x),"m" (x), "m" (x),"m" (x),"m" (x),"m" (x),"m" (x),"m" (x),
"m" (x),"m" (x),"m" (x),"m" (x),"m" (x),"m" (x));}], "m" (x),"m" (x),"m" (x),"m" (x),"m" (x),"m" (x));}],
ac_cv_c_inline_asm=yes, ac_cv_c_inline_asm=yes,

View File

@@ -98,15 +98,23 @@ x86_mmx_TrueColor_32_to_16(unsigned char *image,
int height, int height,
int line_offset) int line_offset)
{ {
union {
long long rrggbbaa; long long rrggbbaa;
struct {short int rr, gg, bb, aa;} words;
} rrggbbaa;
union {
long long pixel; long long pixel;
struct {short int rr, gg, bb, aa;} words;
} pixel;
short *tmp_err; short *tmp_err;
short *tmp_nerr; short *tmp_nerr;
int x; int x;
asm volatile asm volatile
( (
"pushal \n\t" "pushl %%ebx \n\t"
// pack dr, dg and db into mm6 // pack dr, dg and db into mm6
"movl %7, %%eax \n\t" "movl %7, %%eax \n\t"
@@ -290,7 +298,7 @@ x86_mmx_TrueColor_32_to_16(unsigned char *image,
".Enda: \n\t" // THE END ".Enda: \n\t" // THE END
"emms \n\t" "emms \n\t"
"popal \n\t" "popl %%ebx \n\t"
: :
: :
"m" (image), // %0 "m" (image), // %0
@@ -309,17 +317,18 @@ x86_mmx_TrueColor_32_to_16(unsigned char *image,
"m" (width), // %13 "m" (width), // %13
"m" (height), // %14 "m" (height), // %14
"m" (line_offset), // %15 "m" (line_offset), // %15
"m" (rrggbbaa), // %16 (access to rr) "m" (rrggbbaa.rrggbbaa), // %16 (access to rr)
"m" ((*((short*)(&rrggbbaa)+1))), // %17 (access to gg) "m" (rrggbbaa.words.gg), // %17 (access to gg)
"m" ((*((short*)(&rrggbbaa)+2))), // %18 (access to bb) "m" (rrggbbaa.words.bb), // %18 (access to bb)
"m" ((*((short*)(&rrggbbaa)+3))), // %19 (access to aa) "m" (rrggbbaa.words.aa), // %19 (access to aa)
"m" (pixel), // %20 (access to pixel.r) "m" (pixel.pixel), // %20 (access to pixel.r)
"m" ((*((short*)(&pixel)+1))), // %21 (access to pixel.g) "m" (pixel.words.gg), // %21 (access to pixel.g)
"m" ((*((short*)(&pixel)+2))), // %22 (access to pixel.b) "m" (pixel.words.bb), // %22 (access to pixel.b)
"m" ((*((short*)(&pixel)+3))), // %23 (access to pixel.a) "m" (pixel.words.aa), // %23 (access to pixel.a)
"m" (tmp_err), // %24 "m" (tmp_err), // %24
"m" (tmp_nerr), // %25 "m" (tmp_nerr), // %25
"m" (x) // %26 "m" (x) // %26
: "eax", "ecx", "edx", "esi", "edi"
); );
} }
@@ -342,8 +351,15 @@ x86_mmx_TrueColor_24_to_16(unsigned char *image,
int height, int height,
int line_offset) int line_offset)
{ {
union {
long long rrggbbaa; long long rrggbbaa;
struct {short int rr, gg, bb, aa;} words;
} rrggbbaa;
union {
long long pixel; long long pixel;
struct {short int rr, gg, bb, aa;} words;
} pixel;
short *tmp_err; short *tmp_err;
short *tmp_nerr; short *tmp_nerr;
@@ -354,7 +370,7 @@ x86_mmx_TrueColor_24_to_16(unsigned char *image,
asm volatile asm volatile
( (
"pushal \n\t" "pushl %%ebx \n\t"
"movl %13, %%eax \n\t" // eax = width "movl %13, %%eax \n\t" // eax = width
"movl %%eax, %%ebx \n\t" "movl %%eax, %%ebx \n\t"
@@ -424,7 +440,7 @@ x86_mmx_TrueColor_24_to_16(unsigned char *image,
".Endc: \n\t" // THE END ".Endc: \n\t" // THE END
"emms \n\t" "emms \n\t"
"popal \n\t" "popl %%ebx \n\t"
: :
: :
"m" (image), // %0 "m" (image), // %0
@@ -443,19 +459,20 @@ x86_mmx_TrueColor_24_to_16(unsigned char *image,
"m" (width), // %13 "m" (width), // %13
"m" (height), // %14 "m" (height), // %14
"m" (line_offset), // %15 "m" (line_offset), // %15
"m" (rrggbbaa), // %16 (access to rr) "m" (rrggbbaa.rrggbbaa), // %16 (access to rr)
"m" ((*((short*)(&rrggbbaa)+1))), // %17 (access to gg) "m" (rrggbbaa.words.gg), // %17 (access to gg)
"m" ((*((short*)(&rrggbbaa)+2))), // %18 (access to bb) "m" (rrggbbaa.words.bb), // %18 (access to bb)
"m" ((*((short*)(&rrggbbaa)+3))), // %19 (access to aa) "m" (rrggbbaa.words.aa), // %19 (access to aa)
"m" (pixel), // %20 (access to pixel.r) "m" (pixel.pixel), // %20 (access to pixel.r)
"m" ((*((short*)(&pixel)+1))), // %21 (access to pixel.g) "m" (pixel.words.gg), // %21 (access to pixel.g)
"m" ((*((short*)(&pixel)+2))), // %22 (access to pixel.b) "m" (pixel.words.bb), // %22 (access to pixel.b)
"m" ((*((short*)(&pixel)+3))), // %23 (access to pixel.a) "m" (pixel.words.aa), // %23 (access to pixel.a)
"m" (tmp_err), // %24 "m" (tmp_err), // %24
"m" (tmp_nerr), // %25 "m" (tmp_nerr), // %25
"m" (x), // %26 "m" (x), // %26
"m" (w1), // %27 "m" (w1), // %27
"m" (w2) // %28 "m" (w2) // %28
: "eax", "ecx", "edx", "esi", "edi"
); );
} }