Removed fvi_a.h and added the asm code from it as comment to fvi.c in case we need it again some day

This commit is contained in:
zicodxx 2011-01-22 21:43:20 +01:00
parent e133e6e764
commit b35fd6e3d7
3 changed files with 25 additions and 31 deletions

View file

@ -7,6 +7,7 @@ main/cntrlcen.c, main/cntrlcen.h, main/fuelcen.c, main/multi.c, main/state.c: Ha
main/polyobj.h: _POLYOBJ_H definition was not terminated at end of file causing compiling to fail with WORDS_NEED_ALIGNMENT define
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
--------

View file

@ -32,12 +32,35 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#include "piggy.h"
#include "player.h"
#include "fix.h"
#include "fvi_a.h"
extern int Physics_cheat_flag;
#define face_type_num(nfaces,face_num,tri_edge) ((nfaces==1)?0:(tri_edge*2 + face_num))
// 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

View file

@ -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