mirror of
https://github.com/ioquake/jedi-academy.git
synced 2024-11-22 04:11:57 +00:00
provide a gcc style alternative to the inline asm in FxPrimitives
This commit is contained in:
parent
ac358477fd
commit
1625e229c9
1 changed files with 16 additions and 0 deletions
|
@ -424,6 +424,7 @@ inline int VectorToInt(vec3_t vec)
|
|||
{
|
||||
int tmp, retval;
|
||||
|
||||
#ifdef _MSVC_VER
|
||||
_asm
|
||||
{
|
||||
push edx
|
||||
|
@ -447,6 +448,21 @@ inline int VectorToInt(vec3_t vec)
|
|||
mov [retval], eax
|
||||
pop edx
|
||||
}
|
||||
#else
|
||||
asm("flds %1;\n\t"
|
||||
"flds %2;\n\t"
|
||||
"flds %3;\n\t"
|
||||
"fistp %4;\n\t"
|
||||
"movb %4, %%al;\n\t"
|
||||
"shl $16, %0;\n\t"
|
||||
"fistp %4;\n\t"
|
||||
"movb %4, %%ah;\n\t"
|
||||
"fistp %4;\n\t"
|
||||
"movb %4, %%al;\n\t"
|
||||
: "=a"(retval)
|
||||
: "m"(vec[0]), "m"(vec[1]), "m"(vec[2]), "m"(tmp), "a"(0xff00)
|
||||
);
|
||||
#endif
|
||||
return(retval);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue