|
@@ -28,6 +28,7 @@
|
|
|
[email protected]
|
|
[email protected]
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
|
|
+// Modified by Lasse Öörni for Urho3D
|
|
|
|
|
|
|
|
//
|
|
//
|
|
|
// as_callfunc_x86.cpp
|
|
// as_callfunc_x86.cpp
|
|
@@ -371,7 +372,8 @@ void NOINLINE CallCDeclFunction(const asDWORD *args, int paramSize, size_t func)
|
|
|
push ecx
|
|
push ecx
|
|
|
|
|
|
|
|
// Clear the FPU stack, in case the called function doesn't do it by itself
|
|
// Clear the FPU stack, in case the called function doesn't do it by itself
|
|
|
- fninit
|
|
|
|
|
|
|
+ // Urho3D: modified to use EMMS instead to not modify the floating point control word
|
|
|
|
|
+ emms
|
|
|
|
|
|
|
|
// Copy arguments from script
|
|
// Copy arguments from script
|
|
|
// stack to application stack
|
|
// stack to application stack
|
|
@@ -405,8 +407,9 @@ endcopy:
|
|
|
UNUSED_VAR(paramSize);
|
|
UNUSED_VAR(paramSize);
|
|
|
UNUSED_VAR(func);
|
|
UNUSED_VAR(func);
|
|
|
|
|
|
|
|
|
|
+ // Urho3D: modified to use EMMS instead to not modify the floating point control word
|
|
|
asm("pushl %ecx \n"
|
|
asm("pushl %ecx \n"
|
|
|
- "fninit \n"
|
|
|
|
|
|
|
+ "emms \n"
|
|
|
|
|
|
|
|
// Need to align the stack pointer so that it is aligned to 16 bytes when making the function call.
|
|
// Need to align the stack pointer so that it is aligned to 16 bytes when making the function call.
|
|
|
// It is assumed that when entering this function, the stack pointer is already aligned, so we need
|
|
// It is assumed that when entering this function, the stack pointer is already aligned, so we need
|
|
@@ -454,7 +457,8 @@ void NOINLINE CallCDeclFunctionObjLast(const void *obj, const asDWORD *args, int
|
|
|
push ecx
|
|
push ecx
|
|
|
|
|
|
|
|
// Clear the FPU stack, in case the called function doesn't do it by itself
|
|
// Clear the FPU stack, in case the called function doesn't do it by itself
|
|
|
- fninit
|
|
|
|
|
|
|
+ // Urho3D: modified to use EMMS instead to not modify the floating point control word
|
|
|
|
|
+ emms
|
|
|
|
|
|
|
|
// Push the object pointer as the last argument to the function
|
|
// Push the object pointer as the last argument to the function
|
|
|
push obj
|
|
push obj
|
|
@@ -493,8 +497,9 @@ endcopy:
|
|
|
UNUSED_VAR(paramSize);
|
|
UNUSED_VAR(paramSize);
|
|
|
UNUSED_VAR(func);
|
|
UNUSED_VAR(func);
|
|
|
|
|
|
|
|
|
|
+ // Urho3D: modified to use EMMS instead to not modify the floating point control word
|
|
|
asm("pushl %ecx \n"
|
|
asm("pushl %ecx \n"
|
|
|
- "fninit \n"
|
|
|
|
|
|
|
+ "emms \n"
|
|
|
|
|
|
|
|
// Need to align the stack pointer so that it is aligned to 16 bytes when making the function call.
|
|
// Need to align the stack pointer so that it is aligned to 16 bytes when making the function call.
|
|
|
// It is assumed that when entering this function, the stack pointer is already aligned, so we need
|
|
// It is assumed that when entering this function, the stack pointer is already aligned, so we need
|
|
@@ -544,7 +549,8 @@ void NOINLINE CallCDeclFunctionObjFirst(const void *obj, const asDWORD *args, in
|
|
|
push ecx
|
|
push ecx
|
|
|
|
|
|
|
|
// Clear the FPU stack, in case the called function doesn't do it by itself
|
|
// Clear the FPU stack, in case the called function doesn't do it by itself
|
|
|
- fninit
|
|
|
|
|
|
|
+ // Urho3D: modified to use EMMS instead to not modify the floating point control word
|
|
|
|
|
+ emms
|
|
|
|
|
|
|
|
// Copy arguments from script
|
|
// Copy arguments from script
|
|
|
// stack to application stack
|
|
// stack to application stack
|
|
@@ -583,8 +589,9 @@ endcopy:
|
|
|
UNUSED_VAR(paramSize);
|
|
UNUSED_VAR(paramSize);
|
|
|
UNUSED_VAR(func);
|
|
UNUSED_VAR(func);
|
|
|
|
|
|
|
|
|
|
+ // Urho3D: modified to use EMMS instead to not modify the floating point control word
|
|
|
asm("pushl %ecx \n"
|
|
asm("pushl %ecx \n"
|
|
|
- "fninit \n"
|
|
|
|
|
|
|
+ "emms \n"
|
|
|
|
|
|
|
|
// Need to align the stack pointer so that it is aligned to 16 bytes when making the function call.
|
|
// Need to align the stack pointer so that it is aligned to 16 bytes when making the function call.
|
|
|
// It is assumed that when entering this function, the stack pointer is already aligned, so we need
|
|
// It is assumed that when entering this function, the stack pointer is already aligned, so we need
|
|
@@ -634,7 +641,8 @@ void NOINLINE CallCDeclFunctionRetByRefObjFirst_impl(const void *obj, const asDW
|
|
|
push ecx
|
|
push ecx
|
|
|
|
|
|
|
|
// Clear the FPU stack, in case the called function doesn't do it by itself
|
|
// Clear the FPU stack, in case the called function doesn't do it by itself
|
|
|
- fninit
|
|
|
|
|
|
|
+ // Urho3D: modified to use EMMS instead to not modify the floating point control word
|
|
|
|
|
+ emms
|
|
|
|
|
|
|
|
// Copy arguments from script
|
|
// Copy arguments from script
|
|
|
// stack to application stack
|
|
// stack to application stack
|
|
@@ -682,8 +690,9 @@ endcopy:
|
|
|
UNUSED_VAR(func);
|
|
UNUSED_VAR(func);
|
|
|
UNUSED_VAR(retPtr);
|
|
UNUSED_VAR(retPtr);
|
|
|
|
|
|
|
|
|
|
+ // Urho3D: modified to use EMMS instead to not modify the floating point control word
|
|
|
asm("pushl %ecx \n"
|
|
asm("pushl %ecx \n"
|
|
|
- "fninit \n"
|
|
|
|
|
|
|
+ "emms \n"
|
|
|
|
|
|
|
|
// Need to align the stack pointer so that it is aligned to 16 bytes when making the function call.
|
|
// Need to align the stack pointer so that it is aligned to 16 bytes when making the function call.
|
|
|
// It is assumed that when entering this function, the stack pointer is already aligned, so we need
|
|
// It is assumed that when entering this function, the stack pointer is already aligned, so we need
|
|
@@ -737,7 +746,8 @@ void NOINLINE CallCDeclFunctionRetByRef_impl(const asDWORD *args, int paramSize,
|
|
|
push ecx
|
|
push ecx
|
|
|
|
|
|
|
|
// Clear the FPU stack, in case the called function doesn't do it by itself
|
|
// Clear the FPU stack, in case the called function doesn't do it by itself
|
|
|
- fninit
|
|
|
|
|
|
|
+ // Urho3D: modified to use EMMS instead to not modify the floating point control word
|
|
|
|
|
+ emms
|
|
|
|
|
|
|
|
// Copy arguments from script
|
|
// Copy arguments from script
|
|
|
// stack to application stack
|
|
// stack to application stack
|
|
@@ -779,8 +789,9 @@ endcopy:
|
|
|
UNUSED_VAR(func);
|
|
UNUSED_VAR(func);
|
|
|
UNUSED_VAR(retPtr);
|
|
UNUSED_VAR(retPtr);
|
|
|
|
|
|
|
|
|
|
+ // Urho3D: modified to use EMMS instead to not modify the floating point control word
|
|
|
asm("pushl %ecx \n"
|
|
asm("pushl %ecx \n"
|
|
|
- "fninit \n"
|
|
|
|
|
|
|
+ "emms \n"
|
|
|
|
|
|
|
|
// Need to align the stack pointer so that it is aligned to 16 bytes when making the function call.
|
|
// Need to align the stack pointer so that it is aligned to 16 bytes when making the function call.
|
|
|
// It is assumed that when entering this function, the stack pointer is already aligned, so we need
|
|
// It is assumed that when entering this function, the stack pointer is already aligned, so we need
|
|
@@ -831,7 +842,8 @@ void NOINLINE CallCDeclFunctionRetByRefObjLast_impl(const void *obj, const asDWO
|
|
|
push ecx
|
|
push ecx
|
|
|
|
|
|
|
|
// Clear the FPU stack, in case the called function doesn't do it by itself
|
|
// Clear the FPU stack, in case the called function doesn't do it by itself
|
|
|
- fninit
|
|
|
|
|
|
|
+ // Urho3D: modified to use EMMS instead to not modify the floating point control word
|
|
|
|
|
+ emms
|
|
|
|
|
|
|
|
push obj
|
|
push obj
|
|
|
|
|
|
|
@@ -877,8 +889,9 @@ endcopy:
|
|
|
UNUSED_VAR(func);
|
|
UNUSED_VAR(func);
|
|
|
UNUSED_VAR(retPtr);
|
|
UNUSED_VAR(retPtr);
|
|
|
|
|
|
|
|
|
|
+ // Urho3D: modified to use EMMS instead to not modify the floating point control word
|
|
|
asm("pushl %ecx \n"
|
|
asm("pushl %ecx \n"
|
|
|
- "fninit \n"
|
|
|
|
|
|
|
+ "emms \n"
|
|
|
|
|
|
|
|
// Need to align the stack pointer so that it is aligned to 16 bytes when making the function call.
|
|
// Need to align the stack pointer so that it is aligned to 16 bytes when making the function call.
|
|
|
// It is assumed that when entering this function, the stack pointer is already aligned, so we need
|
|
// It is assumed that when entering this function, the stack pointer is already aligned, so we need
|
|
@@ -932,7 +945,8 @@ void NOINLINE CallSTDCallFunction(const asDWORD *args, int paramSize, size_t fun
|
|
|
push ecx
|
|
push ecx
|
|
|
|
|
|
|
|
// Clear the FPU stack, in case the called function doesn't do it by itself
|
|
// Clear the FPU stack, in case the called function doesn't do it by itself
|
|
|
- fninit
|
|
|
|
|
|
|
+ // Urho3D: modified to use EMMS instead to not modify the floating point control word
|
|
|
|
|
+ emms
|
|
|
|
|
|
|
|
// Copy arguments from script
|
|
// Copy arguments from script
|
|
|
// stack to application stack
|
|
// stack to application stack
|
|
@@ -965,8 +979,9 @@ endcopy:
|
|
|
UNUSED_VAR(paramSize);
|
|
UNUSED_VAR(paramSize);
|
|
|
UNUSED_VAR(func);
|
|
UNUSED_VAR(func);
|
|
|
|
|
|
|
|
|
|
+ // Urho3D: modified to use EMMS instead to not modify the floating point control word
|
|
|
asm("pushl %ecx \n"
|
|
asm("pushl %ecx \n"
|
|
|
- "fninit \n"
|
|
|
|
|
|
|
+ "emms \n"
|
|
|
|
|
|
|
|
// Need to align the stack pointer so that it is aligned to 16 bytes when making the function call.
|
|
// Need to align the stack pointer so that it is aligned to 16 bytes when making the function call.
|
|
|
// It is assumed that when entering this function, the stack pointer is already aligned, so we need
|
|
// It is assumed that when entering this function, the stack pointer is already aligned, so we need
|
|
@@ -1014,7 +1029,8 @@ void NOINLINE CallThisCallFunction(const void *obj, const asDWORD *args, int par
|
|
|
push ecx
|
|
push ecx
|
|
|
|
|
|
|
|
// Clear the FPU stack, in case the called function doesn't do it by itself
|
|
// Clear the FPU stack, in case the called function doesn't do it by itself
|
|
|
- fninit
|
|
|
|
|
|
|
+ // Urho3D: modified to use EMMS instead to not modify the floating point control word
|
|
|
|
|
+ emms
|
|
|
|
|
|
|
|
// Copy arguments from script
|
|
// Copy arguments from script
|
|
|
// stack to application stack
|
|
// stack to application stack
|
|
@@ -1063,8 +1079,9 @@ endcopy:
|
|
|
UNUSED_VAR(paramSize);
|
|
UNUSED_VAR(paramSize);
|
|
|
UNUSED_VAR(func);
|
|
UNUSED_VAR(func);
|
|
|
|
|
|
|
|
|
|
+ // Urho3D: modified to use EMMS instead to not modify the floating point control word
|
|
|
asm("pushl %ecx \n"
|
|
asm("pushl %ecx \n"
|
|
|
- "fninit \n"
|
|
|
|
|
|
|
+ "emms \n"
|
|
|
|
|
|
|
|
// Need to align the stack pointer so that it is aligned to 16 bytes when making the function call.
|
|
// Need to align the stack pointer so that it is aligned to 16 bytes when making the function call.
|
|
|
// It is assumed that when entering this function, the stack pointer is already aligned, so we need
|
|
// It is assumed that when entering this function, the stack pointer is already aligned, so we need
|
|
@@ -1115,7 +1132,8 @@ void NOINLINE CallThisCallFunctionRetByRef_impl(const void *obj, const asDWORD *
|
|
|
push ecx
|
|
push ecx
|
|
|
|
|
|
|
|
// Clear the FPU stack, in case the called function doesn't do it by itself
|
|
// Clear the FPU stack, in case the called function doesn't do it by itself
|
|
|
- fninit
|
|
|
|
|
|
|
+ // Urho3D: modified to use EMMS instead to not modify the floating point control word
|
|
|
|
|
+ emms
|
|
|
|
|
|
|
|
// Copy arguments from script
|
|
// Copy arguments from script
|
|
|
// stack to application stack
|
|
// stack to application stack
|
|
@@ -1173,8 +1191,9 @@ endcopy:
|
|
|
UNUSED_VAR(func);
|
|
UNUSED_VAR(func);
|
|
|
UNUSED_VAR(retPtr);
|
|
UNUSED_VAR(retPtr);
|
|
|
|
|
|
|
|
|
|
+ // Urho3D: modified to use EMMS instead to not modify the floating point control word
|
|
|
asm("pushl %ecx \n"
|
|
asm("pushl %ecx \n"
|
|
|
- "fninit \n"
|
|
|
|
|
|
|
+ "emms \n"
|
|
|
|
|
|
|
|
// Need to align the stack pointer so that it is aligned to 16 bytes when making the function call.
|
|
// Need to align the stack pointer so that it is aligned to 16 bytes when making the function call.
|
|
|
// It is assumed that when entering this function, the stack pointer is already aligned, so we need
|
|
// It is assumed that when entering this function, the stack pointer is already aligned, so we need
|