From 4e3eeee3266ea959ce70ebb87037882067fa8ba4 Mon Sep 17 00:00:00 2001 From: zicodxx Date: Sat, 22 Jan 2011 21:43:21 +0100 Subject: [PATCH] Removed fvi_a.h and added the asm code from it as comment to fvi.c in case we need it again some day --- CHANGELOG.txt | 1 + main/fvi.c | 25 ++++++++++++++++++++++++- main/fvi_a.h | 30 ------------------------------ 3 files changed, 25 insertions(+), 31 deletions(-) delete mode 100644 main/fvi_a.h diff --git a/CHANGELOG.txt b/CHANGELOG.txt index c595755eb..dfad57aba 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -6,6 +6,7 @@ main/console.c, main/game.c, main/gamerend.c, main/gauges.c: Added timer_update( main/multi.c: Fixed small issue parsing killreactor command in Multiplayer include/byteswap.h: Added swapping for 64Bit sized integers in case we want to store/read them some day (i.e. new Savegame version storing object instead of object_rw) main/gamerend.c: in show_framerate do not use gr_get_string_size at all but rather use hardcoded coordinates - less CPU-intense +main/fvi.c: Removed fvi_a.h and added the asm code from it as comment to fvi.c in case we need it again some day 20110121 -------- diff --git a/main/fvi.c b/main/fvi.c index 512807f67..b23569655 100644 --- a/main/fvi.c +++ b/main/fvi.c @@ -39,7 +39,30 @@ extern int Physics_cheat_flag; #define face_type_num(nfaces,face_num,tri_edge) ((nfaces==1)?0:(tri_edge*2 + face_num)) -#include "fvi_a.h" +// keep the original ASM code here in case we need it again one day... +// static inline int oflow_check(fix a,fix b) { +// register int __ret; +// int dummy; +// __asm__ ( +// " cdq;" +// " xorl %%edx,%%eax;" +// " subl %%edx,%%eax;" +// " xchgl %%ebx,%%eax;" +// " cdq;" +// " xorl %%edx,%%eax;" +// " subl %%edx,%%eax;" +// " imull %%ebx;" +// " sarl $15,%%edx;" +// " orw %%dx,%%dx;" +// " setnz %%al;" +// " movzbl %%al,%%eax" +// : "=a" (__ret), "=b" (dummy) : "a" (a), "1" (b) : "%edx"); +// return __ret; +// } + +static int oflow_check(fix a,fix b) { + return 0; /* hoping the floating point fix-math is used */ +} //find the point on the specified plane where the line intersects //returns true if point found, false if line parallel to plane diff --git a/main/fvi_a.h b/main/fvi_a.h deleted file mode 100644 index 05593d2f3..000000000 --- a/main/fvi_a.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef _FVI_A_H -#define _FVI_A_H - -#ifdef __GNUC__ -static inline int oflow_check(fix a,fix b) { - register int __ret; - int dummy; - __asm__ ( - " cdq;" - " xorl %%edx,%%eax;" - " subl %%edx,%%eax;" - " xchgl %%ebx,%%eax;" - " cdq;" - " xorl %%edx,%%eax;" - " subl %%edx,%%eax;" - " imull %%ebx;" - " sarl $15,%%edx;" - " orw %%dx,%%dx;" - " setnz %%al;" - " movzbl %%al,%%eax" - : "=a" (__ret), "=b" (dummy) : "a" (a), "1" (b) : "%edx"); - return __ret; -} -#else -static int oflow_check(fix a,fix b) { - return 0; /* hoping the floating point fix-math is used */ -} -/*#error unknown compiler*/ -#endif -#endif