; Listing generated by Microsoft (R) Optimizing Compiler Version 14.00.50727.42 

	TITLE	c:\Documents and Settings\Tobi\My Documents\Visual Studio 2005\Projects\Scimark2-AMD\source\SOR.c
	.686P
	.XMM
	include listing.inc
	.model	flat

INCLUDELIB OLDNAMES

PUBLIC	__real@3fd0000000000000
PUBLIC	__real@3fd4000000000000
PUBLIC	_SOR_execute
;	COMDAT __real@3fd0000000000000
; File c:\documents and settings\tobi\my documents\visual studio 2005\projects\scimark2-amd\source\sor.c
CONST	SEGMENT
__real@3fd0000000000000 DQ 03fd0000000000000r	; 0.25
CONST	ENDS
;	COMDAT __real@3fd4000000000000
CONST	SEGMENT
__real@3fd4000000000000 DQ 03fd4000000000000r	; 0.3125
; Function compile flags: /Ogtpy
CONST	ENDS
_TEXT	SEGMENT
tv1904 = -20						; size = 4
tv1939 = -16						; size = 4
tv1986 = -12						; size = 4
tv1163 = -8						; size = 4
_Mm1$ = -4						; size = 4
_Nm1$ = 8						; size = 4
_N$ = 8							; size = 4
_G$ = 12						; size = 4
_SOR_execute PROC
; _M$ = ecx
; _num_iterations$ = eax

; 14   :     {

	sub	esp, 20					; 00000014H

; 15   : 
; 16   :         long double omega_over_four = omega * 0.25;
; 17   :         long double one_minus_omega = 1.0 - omega;
; 18   : 
; 19   :         /* update interior points */
; 20   : 
; 21   :         long Mm1 = M-1;
; 22   :         long Nm1 = N-1; 

	mov	edx, DWORD PTR _N$[esp+16]
	push	ebx
	push	ebp
	add	ecx, -1
	add	edx, -1

; 23   :         long p;
; 24   :         long i;
; 25   :         long j;
; 26   :         long double *Gi;
; 27   :         long double *Gim1;
; 28   :         long double *Gip1;
; 29   : 
; 30   :         for (p=0; p<num_iterations; p++)

	test	eax, eax
	push	esi
	push	edi
	mov	DWORD PTR _Mm1$[esp+36], ecx
	mov	DWORD PTR _Nm1$[esp+32], edx
	jle	$LN7@SOR_execut
	movsd	xmm4, QWORD PTR __real@3fd4000000000000
	movsd	xmm5, QWORD PTR __real@3fd0000000000000
	mov	DWORD PTR tv1986[esp+36], eax
$LL9@SOR_execut:

; 31   :         {
; 32   :             for (i=1; i<Mm1; i++)

	cmp	ecx, 1
	jle	$LN8@SOR_execut
	mov	edi, DWORD PTR _G$[esp+32]
	add	edi, 8
	add	ecx, -1
	mov	DWORD PTR tv1904[esp+36], edi
	mov	DWORD PTR tv1939[esp+36], ecx
$LN6@SOR_execut:

; 33   :             {
; 34   :                 Gi = G[i];
; 35   :                 Gim1 = G[i-1];
; 36   :                 Gip1 = G[i+1];
; 37   :                 for (j=1; j<Nm1; j++)

	mov	eax, DWORD PTR _Nm1$[esp+32]
	mov	ebx, DWORD PTR [edi-4]
	mov	ebp, DWORD PTR [edi-8]
	mov	esi, DWORD PTR [edi]
	add	eax, -1
	cmp	eax, 4
	mov	edx, 1
	jl	$LC19@SOR_execut

; 38   :                     Gi[j] = omega_over_four * (Gim1[j] + Gip1[j] + Gi[j-1] + Gi[j+1]) + one_minus_omega * Gi[j];

	mov	edi, ebp
	sub	edi, ebx
	lea	eax, DWORD PTR [ebx+16]
	mov	ebx, esi
	lea	ecx, DWORD PTR [ebp+24]
	mov	DWORD PTR tv1163[esp+36], edi
	sub	ebx, ebp
	jmp	SHORT $LN20@SOR_execut
$LL21@SOR_execut:
	mov	edi, DWORD PTR tv1163[esp+36]

; 33   :             {
; 34   :                 Gi = G[i];
; 35   :                 Gim1 = G[i-1];
; 36   :                 Gip1 = G[i+1];
; 37   :                 for (j=1; j<Nm1; j++)

$LN20@SOR_execut:

; 38   :                     Gi[j] = omega_over_four * (Gim1[j] + Gip1[j] + Gi[j-1] + Gi[j+1]) + one_minus_omega * Gi[j];

	movsd	xmm0, QWORD PTR [esi+edx*8]
	addsd	xmm0, QWORD PTR [eax-16]
	addsd	xmm0, QWORD PTR [ecx-16]
	movsd	xmm2, QWORD PTR [eax]
	movsd	xmm1, QWORD PTR [eax-8]
	movsd	xmm3, QWORD PTR [eax+8]
	mulsd	xmm1, xmm5
	addsd	xmm0, xmm2
	mulsd	xmm0, xmm4
	subsd	xmm0, xmm1
	movsd	QWORD PTR [eax-8], xmm0
	add	edi, eax
	movsd	xmm1, QWORD PTR [edi+ebx]
	addsd	xmm1, xmm0
	addsd	xmm1, xmm3
	addsd	xmm1, QWORD PTR [edi]
	mov	edi, DWORD PTR _Nm1$[esp+32]
	mulsd	xmm1, xmm4
	mulsd	xmm2, xmm5
	subsd	xmm1, xmm2
	movsd	xmm2, QWORD PTR [eax+16]
	movsd	QWORD PTR [eax], xmm1
	movsd	xmm0, QWORD PTR [ebx+ecx]
	addsd	xmm0, xmm1
	addsd	xmm0, QWORD PTR [ecx]
	addsd	xmm0, xmm2
	mulsd	xmm0, xmm4
	mulsd	xmm3, xmm5
	subsd	xmm0, xmm3
	movsd	QWORD PTR [eax+8], xmm0
	movsd	xmm1, QWORD PTR [esi+edx*8+24]
	addsd	xmm1, QWORD PTR [eax+24]
	addsd	xmm1, QWORD PTR [ecx+8]
	addsd	xmm1, xmm0
	mulsd	xmm1, xmm4
	mulsd	xmm2, xmm5
	subsd	xmm1, xmm2
	movsd	QWORD PTR [eax+16], xmm1
	add	edx, 4
	add	edi, -3					; fffffffdH
	add	eax, 32					; 00000020H
	add	ecx, 32					; 00000020H
	cmp	edx, edi
	jl	$LL21@SOR_execut
	mov	edi, DWORD PTR tv1904[esp+36]
$LC19@SOR_execut:

; 33   :             {
; 34   :                 Gi = G[i];
; 35   :                 Gim1 = G[i-1];
; 36   :                 Gip1 = G[i+1];
; 37   :                 for (j=1; j<Nm1; j++)

	cmp	edx, DWORD PTR _Nm1$[esp+32]
	jge	SHORT $LN5@SOR_execut
	mov	ecx, DWORD PTR [edi-4]
	sub	esi, ebp
	lea	eax, DWORD PTR [ecx+edx*8]
	sub	ebp, ecx
	mov	ecx, DWORD PTR _Nm1$[esp+32]
	sub	ecx, edx
	npad	8
$LC3@SOR_execut:

; 38   :                     Gi[j] = omega_over_four * (Gim1[j] + Gip1[j] + Gi[j-1] + Gi[j+1]) + one_minus_omega * Gi[j];

	movsd	xmm1, QWORD PTR [eax]
	lea	edx, DWORD PTR [eax+ebp]
	movsd	xmm0, QWORD PTR [edx+esi]
	addsd	xmm0, QWORD PTR [eax-8]
	addsd	xmm0, QWORD PTR [eax+8]
	addsd	xmm0, QWORD PTR [edx]
	mulsd	xmm0, xmm4
	mulsd	xmm1, xmm5
	subsd	xmm0, xmm1
	movsd	QWORD PTR [eax], xmm0
	add	eax, 8
	sub	ecx, 1
	jne	SHORT $LC3@SOR_execut
$LN5@SOR_execut:

; 31   :         {
; 32   :             for (i=1; i<Mm1; i++)

	add	edi, 4
	sub	DWORD PTR tv1939[esp+36], 1
	mov	DWORD PTR tv1904[esp+36], edi
	jne	$LN6@SOR_execut
	mov	ecx, DWORD PTR _Mm1$[esp+36]
$LN8@SOR_execut:

; 23   :         long p;
; 24   :         long i;
; 25   :         long j;
; 26   :         long double *Gi;
; 27   :         long double *Gim1;
; 28   :         long double *Gip1;
; 29   : 
; 30   :         for (p=0; p<num_iterations; p++)

	sub	DWORD PTR tv1986[esp+36], 1
	jne	$LL9@SOR_execut
$LN7@SOR_execut:

; 39   :             }
; 40   :         }
; 41   :     }

	pop	edi
	pop	esi
	pop	ebp
	pop	ebx
	add	esp, 20					; 00000014H
	ret	0
_SOR_execute ENDP
_TEXT	ENDS
PUBLIC	__real@4018000000000000
PUBLIC	__real@3ff0000000000000
PUBLIC	_SOR_num_flops
;	COMDAT __real@4018000000000000
CONST	SEGMENT
__real@4018000000000000 DQ 04018000000000000r	; 6
CONST	ENDS
;	COMDAT __real@3ff0000000000000
CONST	SEGMENT
__real@3ff0000000000000 DQ 03ff0000000000000r	; 1
; Function compile flags: /Ogtpy
CONST	ENDS
_TEXT	SEGMENT
_M$ = 8							; size = 4
_N$ = 12						; size = 4
_num_iterations$ = 16					; size = 4
_SOR_num_flops PROC

; 5    :         double Md = (double) M;
; 6    :         double Nd = (double) N;
; 7    :         double num_iterD = (double) num_iterations;
; 8    : 
; 9    :         return (Md-1)*(Nd-1)*num_iterD*6.0;

	movsd	xmm1, QWORD PTR __real@3ff0000000000000
	cvtsi2sd xmm0, DWORD PTR _M$[esp-4]
	cvtsi2sd xmm2, DWORD PTR _N$[esp-4]
	subsd	xmm0, xmm1
	subsd	xmm2, xmm1
	cvtsi2sd xmm1, DWORD PTR _num_iterations$[esp-4]
	mulsd	xmm0, xmm2
	mulsd	xmm0, xmm1
	mulsd	xmm0, QWORD PTR __real@4018000000000000

; 10   :     }

	ret	0
_SOR_num_flops ENDP
END
