mirror of
https://github.com/ioquake/jedi-outcast.git
synced 2024-11-09 23:01:48 +00:00
provide a gcc style alternative to the inline asm in tr_shade
This commit is contained in:
parent
c294d5e494
commit
8202db3fe1
1 changed files with 16 additions and 0 deletions
|
@ -398,6 +398,7 @@ inline int VectorToInt(vec3_t vec)
|
|||
{
|
||||
int tmp, retval;
|
||||
|
||||
#ifdef _MSVC_VER
|
||||
_asm
|
||||
{
|
||||
push edx
|
||||
|
@ -421,6 +422,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