pkgsrc/devel/allegro/patches/patch-ae

61 lines
1.8 KiB
Text

$NetBSD: patch-ae,v 1.4 2006/07/04 06:27:40 wiz Exp $
--- include/allegro/platform/al386gcc.h.orig 2005-03-09 13:49:46.000000000 -0800
+++ include/allegro/platform/al386gcc.h 2006-07-01 05:39:49.000000000 -0700
@@ -208,29 +208,29 @@
*/
AL_INLINE(fixed, fixmul, (fixed x, fixed y),
{
- fixed edx __attribute__ ((__unused__));
+ long edx;
fixed result;
__PRECALCULATE_CONSTANTS(x / 65536.0 * y)
{
__asm__ (
- " movl %2, %%eax ; "
- " imull %3 ; " /* do the multiply */
- " shrdl $16, %%edx, %%eax ; "
+ " movl %1, %%eax ; "
+ " imull %2 ; " /* do the multiply */
+ " shrdl $16, %5, %%eax ; "
- " sarl $15, %%edx ; " /* check for overflow */
+ " sarl $15, %5 ; " /* check for overflow */
" jz 0f ; "
- " cmpl $-1, %%edx ; "
+ " cmpl $-1, %5 ; "
" je 0f ; "
- " movl %5, %%eax ; " /* on overflow, set errno */
- " movl %4, (%%eax) ; "
+ " movl %4, %%eax ; " /* on overflow, set errno */
+ " movl %3, (%%eax) ; "
" movl $0x7FFFFFFF, %%eax ; " /* and return MAXINT */
- " cmpl $0, %2 ; "
+ " cmpl $0, %1 ; "
" jge 1f ; "
" negl %%eax ; "
" 1: "
- " cmpl $0, %3 ; "
+ " cmpl $0, %2 ; "
" jge 0f ; "
" negl %%eax ; "
@@ -238,13 +238,13 @@
" 0: " /* finished */
- : "=&a" (result), /* the result has to go in eax */
- "=&d" (edx) /* reliably reserve edx */
+ : "=&a" (result) /* the result has to go in eax */
: "mr" (x), /* x and y can be regs or mem */
"mr" (y),
"i" (ERANGE),
- "m" (allegro_errno)
+ "m" (allegro_errno),
+ "d" (edx)
: "%cc", "memory" /* clobbers flags and errno */
);