line break consistency fix: 3dmathSIMD.asm.cpp (btw inline asm SUCKS)
This commit is contained in:
parent
8ae5b052e7
commit
24d86ab329
|
@ -42,18 +42,18 @@ segment .text
|
|||
extern "C" void __declspec(naked) DetectSIMD(int func, int * iedx, int * iecx)
|
||||
{
|
||||
_asm {
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
mov eax,[func]
|
||||
cpuid
|
||||
mov eax,[iedx]
|
||||
mov [eax],edx
|
||||
mov eax,[iecx]
|
||||
mov [eax],ecx
|
||||
leave
|
||||
ret
|
||||
}
|
||||
}
|
||||
leave
|
||||
ret
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************
|
||||
;
|
||||
|
@ -65,8 +65,8 @@ extern "C" void __declspec(naked) TransformVectorSSE(float *src, float *dst, flo
|
|||
{
|
||||
__asm
|
||||
{
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
|
||||
mov ecx,[src]
|
||||
mov eax,[dst]
|
||||
|
@ -91,17 +91,17 @@ extern "C" void __declspec(naked) TransformVectorSSE(float *src, float *dst, flo
|
|||
addps xmm0,xmm2 ; mat[0][2]*src[0]+mat[1][2]*src[1]+mat[2][2]*src[2] mat[0][1]*src[0]+mat[1][1]*src[1]+mat[2][1]*src[2] 0 mat[0][0]*src[0]+mat[1][0]*src[1]+mat[2][0]*src[2]
|
||||
movss [eax],xmm0 ; mat[0][0]*src[0]+mat[1][0]*src[1]+mat[2][0]*src[2]
|
||||
movhps [eax+4],xmm0 ; mat[0][2]*src[0]+mat[1][2]*src[1]+mat[2][2]*src[2] mat[0][1]*src[0]+mat[1][1]*src[1]+mat[2][1]*src[2]
|
||||
leave
|
||||
ret
|
||||
}
|
||||
}
|
||||
leave
|
||||
ret
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" void __declspec(naked) MulMatricesSSE(float m1[4][4],float m2[4][4],float r[4][4])
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
|
||||
mov eax,[r]
|
||||
mov ecx,[m1]
|
||||
|
@ -204,17 +204,17 @@ extern "C" void __declspec(naked) MulMatricesSSE(float m1[4][4],float m2[4][4],f
|
|||
addps xmm4,xmm7
|
||||
|
||||
movaps [eax+48],xmm4
|
||||
leave
|
||||
ret
|
||||
}
|
||||
}
|
||||
leave
|
||||
ret
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" void __declspec(naked) NormalizeVectorSSE (float *v)
|
||||
{
|
||||
_asm
|
||||
{
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
|
||||
mov edx, [v]
|
||||
movaps xmm0, [edx] ; x y z 0
|
||||
|
@ -229,10 +229,10 @@ extern "C" void __declspec(naked) NormalizeVectorSSE (float *v)
|
|||
rsqrtps xmm0, xmm0 ; 1.0/sqrt(x*x+z*z+y*y)
|
||||
mulps xmm2, xmm0 ; x/sqrt(x*x+z*z+y*y) y/sqrt(x*x+z*z+y*y) z/sqrt(x*x+z*z+y*y) 0
|
||||
movaps [edx], xmm2
|
||||
leave
|
||||
ret
|
||||
}
|
||||
}
|
||||
leave
|
||||
ret
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
;
|
||||
|
@ -243,8 +243,8 @@ extern "C" void __declspec(naked) NormalizeVectorSSE (float *v)
|
|||
float __declspec(naked) DotProductSSE3(register float *v1, register float *v2)
|
||||
{
|
||||
_asm {
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
|
||||
mov eax,[v1]
|
||||
mov edx,[v2]
|
||||
|
@ -253,10 +253,10 @@ float __declspec(naked) DotProductSSE3(register float *v1, register float *v2)
|
|||
haddps xmm0, xmm0
|
||||
haddps xmm0, xmm0
|
||||
; movss eax, xmm0
|
||||
leave
|
||||
ret
|
||||
}
|
||||
}
|
||||
leave
|
||||
ret
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************
|
||||
;
|
||||
|
@ -267,8 +267,8 @@ float __declspec(naked) DotProductSSE3(register float *v1, register float *v2)
|
|||
extern "C" void __declspec(naked) TransformVector3DNOW(float *src, float *dst, float mat[4][4])
|
||||
{
|
||||
_asm {
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
|
||||
femms
|
||||
mov ecx,[src]
|
||||
|
@ -296,16 +296,16 @@ extern "C" void __declspec(naked) TransformVector3DNOW(float *src, float *dst, f
|
|||
movq [eax],mm0 ; mat[0][1]*src[0]+mat[1][1]*src[1]+mat[2][1]*src[2] mat[0][0]*src[0]+mat[1][0]*src[1]+mat[2][0]*src[2]
|
||||
movd [eax+8],mm3 ; mat[0][2]*src[0]+mat[1][2]*src[1]+mat[2][2]*src[2]
|
||||
femms
|
||||
leave
|
||||
ret
|
||||
}
|
||||
}
|
||||
leave
|
||||
ret
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" void __declspec(naked) InverseTransformVector3DNOW(float *src, float *dst, float mat[4][4])
|
||||
{
|
||||
_asm {
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
|
||||
femms
|
||||
mov ecx,[src]
|
||||
|
@ -333,16 +333,16 @@ extern "C" void __declspec(naked) InverseTransformVector3DNOW(float *src, float
|
|||
movq [eax],mm0 ; mat[1][0]*src[0]+mat[1][1]*src[1]+mat[1][2]*src[2] mat[0][0]*src[0]+mat[0][1]*src[1]+mat[0][2]*src[2]
|
||||
movd [eax+8],mm2 ; mat[2][0]*src[0]+mat[2][1]*src[1]+mat[2][2]*src[2]
|
||||
femms
|
||||
leave
|
||||
ret
|
||||
}
|
||||
}
|
||||
leave
|
||||
ret
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" void __declspec(naked) MulMatrices3DNOW(float m1[4][4],float m2[4][4],float r[4][4])
|
||||
{
|
||||
_asm {
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
|
||||
femms
|
||||
mov ecx,[m1]
|
||||
|
@ -465,16 +465,16 @@ extern "C" void __declspec(naked) MulMatrices3DNOW(float m1[4][4],float m2[4][4
|
|||
movq [eax+48],mm7
|
||||
movq [eax+56],mm3
|
||||
femms
|
||||
leave
|
||||
ret
|
||||
}
|
||||
}
|
||||
leave
|
||||
ret
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" float __declspec(naked) DotProduct3DNOW(register float *v1, register float *v2)
|
||||
{
|
||||
_asm {
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
|
||||
femms
|
||||
mov edx,[v1]
|
||||
|
@ -489,15 +489,15 @@ extern "C" float __declspec(naked) DotProduct3DNOW(register float *v1, register
|
|||
pfadd mm0,mm1
|
||||
movd eax,mm0
|
||||
femms
|
||||
leave
|
||||
ret
|
||||
}
|
||||
}
|
||||
leave
|
||||
ret
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" void __declspec(naked) NormalizeVector3DNOW(float *v)
|
||||
{
|
||||
_asm {
|
||||
push ebp
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
femms
|
||||
mov edx,[v]
|
||||
|
@ -521,7 +521,7 @@ extern "C" void __declspec(naked) NormalizeVector3DNOW(float *v)
|
|||
movq [edx],mm1
|
||||
movq [edx+8],mm2
|
||||
femms
|
||||
leave
|
||||
ret
|
||||
}
|
||||
leave
|
||||
ret
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue