Merge pull request #501 from cxd4/ffffffffffffffffffff
[PJGlide64] imul14: no need for inline asm here
This commit is contained in:
commit
b64557af4e
|
@ -57,24 +57,20 @@ extern "C" int __declspec(naked) imul16(int x, int y)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//(x * y) >> 14
|
|
||||||
extern "C" int __declspec(naked) imul14(int x, int y)
|
|
||||||
{
|
|
||||||
_asm {
|
|
||||||
push ebp
|
|
||||||
mov ebp,esp
|
|
||||||
mov eax, [x]
|
|
||||||
mov edx, [y]
|
|
||||||
imul edx
|
|
||||||
shrd eax,edx,14
|
|
||||||
leave
|
|
||||||
ret
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
DebugBreak();
|
DebugBreak();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
int imul14(int x, int y)
|
||||||
|
{
|
||||||
|
int64_t result;
|
||||||
|
const int64_t m = (int64_t)(x);
|
||||||
|
const int64_t n = (int64_t)(y);
|
||||||
|
|
||||||
|
result = (m * n) >> 14;
|
||||||
|
return (int)(result);
|
||||||
|
}
|
||||||
|
|
||||||
int idiv16(int x, int y)
|
int idiv16(int x, int y)
|
||||||
{
|
{
|
||||||
int64_t result;
|
int64_t result;
|
||||||
|
|
Loading…
Reference in New Issue