Merge pull request #505 from cxd4/jjjjjjjjjjjk
[PJGlide64] imul16: no need for inline asm here
This commit is contained in:
commit
e268c58a23
|
@ -41,26 +41,6 @@ typedef signed __int64 int64_t;
|
|||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
#ifdef _M_IX86
|
||||
// (x * y) >> 16
|
||||
extern "C" int __declspec(naked) imul16(int x, int y)
|
||||
{
|
||||
_asm {
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
mov eax, [x]
|
||||
mov edx, [y]
|
||||
imul edx
|
||||
shrd eax,edx,16
|
||||
leave
|
||||
ret
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
DebugBreak();
|
||||
#endif
|
||||
|
||||
int imul14(int x, int y)
|
||||
{
|
||||
int64_t result;
|
||||
|
@ -71,6 +51,16 @@ int imul14(int x, int y)
|
|||
return (int)(result);
|
||||
}
|
||||
|
||||
int imul16(int x, int y)
|
||||
{
|
||||
int64_t result;
|
||||
const int64_t m = (int64_t)(x);
|
||||
const int64_t n = (int64_t)(y);
|
||||
|
||||
result = (m * n) >> 16;
|
||||
return (int)(result);
|
||||
}
|
||||
|
||||
int idiv16(int x, int y)
|
||||
{
|
||||
int64_t result;
|
||||
|
|
Loading…
Reference in New Issue