Subversion Repositories Kolibri OS

Rev

Rev 313 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 313 Rev 6353
1
;
1
;
2
; Ghost Monitor - óòèëèòà (ñòðåññ) òåñòèðîâàíèÿ è ìîíèòîðèíãà ñèñòåìû
2
; Ghost Monitor - утилита (стресс) тестирования и мониторинга системы
3
; Copyright (C) 2005, 2006, 2007 Mihailov Ilia (ghost.nsk@mail.ru)
3
; Copyright (C) 2005, 2006, 2007 Mihailov Ilia (ghost.nsk@mail.ru)
4
; All Right Reserved
4
; All Right Reserved
5
;
5
;
6
; k6, k7, p5 & p6 tests based on Robert J. Redelmeier cpuburn-1.4
6
; k6, k7, p5 & p6 tests based on Robert J. Redelmeier cpuburn-1.4
7
; Copyright 1999, 2000  Robert J. Redelmeier.  All Right Reserved 
7
; Copyright 1999, 2000  Robert J. Redelmeier.  All Right Reserved 
8
; Licensed under GNU General Public Licence 2.0.  No warrantee. 
8
; Licensed under GNU General Public Licence 2.0.  No warrantee. 
9
 
9
 
10
;  adapted by Mihailov Ilia
10
;  adapted by Mihailov Ilia
11
;
11
;
12
; Çàìåòêè :
12
; Заметки :
13
;	ïåðåïèñòü ðåàêöèþ íà îøèáêè
13
;	переписть реакцию на ошибки
14
 
14
 
15
k6:
15
k6_:
16
	finit
16
	finit
17
	push	ebp
17
	push	ebp
18
	mov	ebp, esp
18
	mov	ebp, esp
19
	and	ebp, -32
19
	and	ebp, -32
20
	sub	esp, 96
20
	sub	esp, 96
21
	fldpi
21
	fldpi
22
	fld	qword [rtt]
22
	fld	qword [rtt]
23
	fstp	qword [ebp - 24]
23
	fstp	qword [ebp - 24]
24
	fld	qword [e]
24
	fld	qword [e]
25
	fstp	qword [ebp - 32]
25
	fstp	qword [ebp - 32]
26
	mov	edx, [half]
26
	mov	edx, [half]
27
	mov	[ebp - 8], edx
27
	mov	[ebp - 8], edx
28
k6_after_check:
28
k6_after_check:
29
	xor	eax, eax
29
	xor	eax, eax
30
	mov	ebx, eax
30
	mov	ebx, eax
31
	lea	esi, [eax - 1]
31
	lea	esi, [eax - 1]
32
	mov	ecx, 400000000
32
	mov	ecx, 400000000
33
	mov	[ebp - 4], ecx
33
	mov	[ebp - 4], ecx
34
align	32
34
align	32
35
	;rev. eng. win. ver. (lea esi, [esi]) ; Ghost
35
	;rev. eng. win. ver. (lea esi, [esi]) ; Ghost
36
k6_crunch:				
36
k6_crunch:				
37
	fld	qword [ebp+esi*8-16]		; CALC BLOCK
37
	fld	qword [ebp+esi*8-16]		; CALC BLOCK
38
	fmul	qword [ebp+esi*8-24]
38
	fmul	qword [ebp+esi*8-24]
39
	add	edx, [half + 9 + esi + esi * 8]	;!!!
39
	add	edx, [half + 9 + esi + esi * 8]	;!!!
40
	jnz	$ + 2
40
	jnz	$ + 2
41
	faddp	
41
	faddp	
42
	fld	qword [ebp+esi*8-16]
42
	fld	qword [ebp+esi*8-16]
43
	dec	ebx
43
	dec	ebx
44
	sub	edx, [half + 9 + esi + esi * 8]	;!!!
44
	sub	edx, [half + 9 + esi + esi * 8]	;!!!
45
	jmp	$ + 2
45
	jmp	$ + 2
46
	fmul	qword [ebp+esi*8-24]
46
	fmul	qword [ebp+esi*8-24]
47
	inc	ebx
47
	inc	ebx
48
	dec	dword [ebp+esi*8+4]
48
	dec	dword [ebp+esi*8+4]
49
	fsubp	
49
	fsubp	
50
	jnz	k6_crunch			; time for testing ?
50
	jnz	k6_crunch			; time for testing ?
51
 
51
 
52
	test	ebx, ebx			; TEST BLOCK
52
	test	ebx, ebx			; TEST BLOCK
53
	jnz	k6_int_exit
53
	jnz	k6_int_exit
54
	cmp	edx, [half]
54
	cmp	edx, [half]
55
	jnz	k6_int_exit
55
	jnz	k6_int_exit
56
	fldpi
56
	fldpi
57
	fcomp	st1
57
	fcomp	st1
58
	fstsw	ax
58
	fstsw	ax
59
	sahf
59
	sahf
60
	jz	k6_after_check
60
	jz	k6_after_check
61
	dec	ebx
61
	dec	ebx
62
k6_int_exit:
62
k6_int_exit:
63
	dec	ebx
63
	dec	ebx
64
	add	esp, 96
64
	add	esp, 96
65
	pop	ebp
65
	pop	ebp
66
	mov	eax, -1
66
	mov	eax, -1
67
	int	0x40
67
	int	0x40
68
;#######################################################################
68
;#######################################################################
69
;#######################################################################
69
;#######################################################################
70
k7:	finit
70
k7_:	finit
71
	mov	ebp, esp
71
	mov	ebp, esp
72
	and	ebp,-32
72
	and	ebp,-32
73
	sub	esp,96
73
	sub	esp,96
74
	fld	qword [rtt]
74
	fld	qword [rtt]
75
	fstp	qword [ebp-40]
75
	fstp	qword [ebp-40]
76
	fld	qword [e]
76
	fld	qword [e]
77
	fstp	qword [ebp-32]
77
	fstp	qword [ebp-32]
78
	fldpi
78
	fldpi
79
	fldpi
79
	fldpi
80
	xor	eax, eax
80
	xor	eax, eax
81
	xor	ebx, ebx
81
	xor	ebx, ebx
82
	xor	ecx, ecx
82
	xor	ecx, ecx
83
	mov	edx, half
83
	mov	edx, half
84
	lea	esi,[eax-1] 
84
	lea	esi,[eax-1] 
85
	mov	[ebp-12], eax 
85
	mov	[ebp-12], eax 
86
	mov	[ebp-8], edx
86
	mov	[ebp-8], edx
87
 
87
 
88
k7_after_check:
88
k7_after_check:
89
	mov	dword[ebp-4], 0x32A9F880;0x850000000	;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
89
	mov	dword[ebp-4], 0x32A9F880;0x850000000	;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
90
ALIGN 16
90
ALIGN 16
91
k7_crunch:
91
k7_crunch:
92
	fxch					; CALC BLOCK
92
	fxch					; CALC BLOCK
93
	fld	qword [ebp+esi*8-24]		; 17 instr / 6.0 cycles
93
	fld	qword [ebp+esi*8-24]		; 17 instr / 6.0 cycles
94
	fmul	qword [ebp+esi*8-32]
94
	fmul	qword [ebp+esi*8-32]
95
	faddp
95
	faddp
96
	dec	ecx
96
	dec	ecx
97
	fld	qword [ebp+esi*8-24]
97
	fld	qword [ebp+esi*8-24]
98
	dec	ebx
98
	dec	ebx
99
	inc	dword [ebp+esi*8-12]
99
	inc	dword [ebp+esi*8-12]
100
	inc	ecx
100
	inc	ecx
101
	fmul	qword [ebp+esi*8-32]
101
	fmul	qword [ebp+esi*8-32]
102
	inc	ebx
102
	inc	ebx
103
	dec	dword [ebp+esi*8-4]
103
	dec	dword [ebp+esi*8-4]
104
	jmp     $+2
104
	jmp     $+2
105
	fsubp    st2, st0
105
	fsubp    st2, st0
106
	jnz	k7_crunch			; time for testing ?
106
	jnz	k7_crunch			; time for testing ?
107
	test	ebx, ebx			; TEST BLOCK
107
	test	ebx, ebx			; TEST BLOCK
108
	jnz	k7_int_exit
108
	jnz	k7_int_exit
109
	test	ecx, ecx
109
	test	ecx, ecx
110
	jnz	k7_int_exit
110
	jnz	k7_int_exit
111
	cmp	edx, half
111
	cmp	edx, half
112
	jnz	k7_int_exit
112
	jnz	k7_int_exit
113
	fcom	st1
113
	fcom	st1
114
	fstsw	ax
114
	fstsw	ax
115
	sahf
115
	sahf
116
	jz	k7_after_check
116
	jz	k7_after_check
117
	dec	ebx
117
	dec	ebx
118
k7_int_exit:
118
k7_int_exit:
119
	dec	ebx
119
	dec	ebx
120
	add	esp,96
120
	add	esp,96
121
	mov	eax, -1
121
	mov	eax, -1
122
	int	0x40
122
	int	0x40
123
;#######################################################################
123
;#######################################################################
124
;#######################################################################
124
;#######################################################################
125
p5:	finit
125
p5:	finit
126
	push	ebp
126
	push	ebp
127
	mov	ebp, esp
127
	mov	ebp, esp
128
	and	ebp, -32
128
	and	ebp, -32
129
	sub	esp, 96
129
	sub	esp, 96
130
	fld	qword [half]
130
	fld	qword [half]
131
	fstp	qword [ebp - 24]
131
	fstp	qword [ebp - 24]
132
	fld	qword [rtt]
132
	fld	qword [rtt]
133
	fst	qword [ebp - 16]
133
	fst	qword [ebp - 16]
134
	fld	st
134
	fld	st
135
	fld	st
135
	fld	st
136
p5_after_check:
136
p5_after_check:
137
	xor	eax, eax
137
	xor	eax, eax
138
	mov	eax, ebx
138
	mov	eax, ebx
139
	mov	ecx, 200000000
139
	mov	ecx, 200000000
140
align	32
140
align	32
141
				;# MAIN LOOP  16 flops / 18 cycles
141
				;# MAIN LOOP  16 flops / 18 cycles
142
p5_crunch:	   
142
p5_crunch:	   
143
	fmul	qword [ebp - 24]
143
	fmul	qword [ebp - 24]
144
	fxch	st1
144
	fxch	st1
145
	fadd	qword [ebp - 16]
145
	fadd	qword [ebp - 16]
146
	fxch	st2
146
	fxch	st2
147
	fmul	qword [ebp - 24]
147
	fmul	qword [ebp - 24]
148
	fxch	st1
148
	fxch	st1
149
	fadd	qword [ebp - 16]
149
	fadd	qword [ebp - 16]
150
	fxch	st2
150
	fxch	st2
151
 
151
 
152
	fmul	qword [ebp - 24]
152
	fmul	qword [ebp - 24]
153
	fxch	st1
153
	fxch	st1
154
	fadd	qword [ebp - 16]
154
	fadd	qword [ebp - 16]
155
	fxch	st2
155
	fxch	st2
156
	fmul	qword [ebp - 24]
156
	fmul	qword [ebp - 24]
157
	fxch	st1
157
	fxch	st1
158
	fadd	qword [ebp - 16]
158
	fadd	qword [ebp - 16]
159
	fxch	st2
159
	fxch	st2
160
 
160
 
161
	fmul	qword [ebp - 24]
161
	fmul	qword [ebp - 24]
162
	fxch	st1
162
	fxch	st1
163
	fadd	qword [ebp - 16]
163
	fadd	qword [ebp - 16]
164
	fxch	st2
164
	fxch	st2
165
	fmul	qword [ebp - 24]
165
	fmul	qword [ebp - 24]
166
	fxch	st1
166
	fxch	st1
167
	fadd	qword [ebp - 16]
167
	fadd	qword [ebp - 16]
168
	fxch	st2
168
	fxch	st2
169
 
169
 
170
	fmul	qword [ebp - 24]
170
	fmul	qword [ebp - 24]
171
	fxch	st1
171
	fxch	st1
172
	fadd	qword [ebp - 16]
172
	fadd	qword [ebp - 16]
173
	fxch	st2
173
	fxch	st2
174
	fmul	qword [ebp - 24]
174
	fmul	qword [ebp - 24]
175
	fxch	st1
175
	fxch	st1
176
	fadd	qword [ebp - 16]
176
	fadd	qword [ebp - 16]
177
	fxch	st2
177
	fxch	st2
178
 
178
 
179
	dec	ecx
179
	dec	ecx
180
	jnz	p5_crunch
180
	jnz	p5_crunch
181
 
181
 
182
	jmp	p5_after_check
182
	jmp	p5_after_check
183
;#######################################################################
183
;#######################################################################
184
;#######################################################################	
184
;#######################################################################	
185
p6:	finit
185
p6:	finit
186
	push	ebp
186
	push	ebp
187
	mov	ebp, esp
187
	mov	ebp, esp
188
	and	ebp, -32
188
	and	ebp, -32
189
	sub	esp, 96
189
	sub	esp, 96
190
	fldpi
190
	fldpi
191
	fld	qword [rtt]
191
	fld	qword [rtt]
192
	fstp	qword [ebp - 24]
192
	fstp	qword [ebp - 24]
193
	fld	qword [e]
193
	fld	qword [e]
194
	fstp	qword [ebp - 32]
194
	fstp	qword [ebp - 32]
195
	mov	edx, [half]
195
	mov	edx, [half]
196
	mov	[ebp - 8], edx
196
	mov	[ebp - 8], edx
197
p6_after_check:
197
p6_after_check:
198
	xor	eax, eax
198
	xor	eax, eax
199
	mov	ebx, eax
199
	mov	ebx, eax
200
	lea	esi, [eax - 1]
200
	lea	esi, [eax - 1]
201
	mov	ecx, 539000000		;# check after this count  
201
	mov	ecx, 539000000		;# check after this count  
202
	mov	[ebp - 4], ecx
202
	mov	[ebp - 4], ecx
203
align	32
203
align	32
204
p6_crunch:				;# MAIN LOOP	21uops / 8.0 clocks
204
p6_crunch:				;# MAIN LOOP	21uops / 8.0 clocks
205
	fld	qword [ebp+esi*8-16]
205
	fld	qword [ebp+esi*8-16]
206
	fmul	qword [ebp+esi*8-24]
206
	fmul	qword [ebp+esi*8-24]
207
	add	edx, [half]
207
	add	edx, [half]
208
	jnz	$ + 2
208
	jnz	$ + 2
209
	faddp	
209
	faddp	
210
	fld	qword [ebp - 24]
210
	fld	qword [ebp - 24]
211
	dec	ebx
211
	dec	ebx
212
	sub	edx, [half + 9 + esi + esi*8]
212
	sub	edx, [half + 9 + esi + esi*8]
213
	jmp	$ + 2
213
	jmp	$ + 2
214
	fmul	qword [ebp+esi*8-24]
214
	fmul	qword [ebp+esi*8-24]
215
	inc	ebx
215
	inc	ebx
216
	dec	dword [ebp+esi*8+4]
216
	dec	dword [ebp+esi*8+4]
217
	fsubp	
217
	fsubp	
218
	jnz	p6_crunch		
218
	jnz	p6_crunch		
219
 
219
 
220
	test	ebx, ebx		;# Testing block
220
	test	ebx, ebx		;# Testing block
221
	mov	ebx, 0
221
	mov	ebx, 0
222
	jnz	p6_int_exit
222
	jnz	p6_int_exit
223
	cmp	edx, [half]
223
	cmp	edx, [half]
224
	jnz	p6_int_exit
224
	jnz	p6_int_exit
225
	fldpi
225
	fldpi
226
	fcomp	st1
226
	fcomp	st1
227
	fstsw	ax
227
	fstsw	ax
228
	sahf
228
	sahf
229
	jz	p6_after_check		;# fp result = pi ?
229
	jz	p6_after_check		;# fp result = pi ?
230
	dec	ebx
230
	dec	ebx
231
p6_int_exit:				;# error abort
231
p6_int_exit:				;# error abort
232
	dec	ebx
232
	dec	ebx
233
	add	esp, 96
233
	add	esp, 96
234
	pop	ebp
234
	pop	ebp
235
	mov	eax, -1
235
	mov	eax, -1
236
	int	0x40
236
	int	0x40
237
;---------------------------------------------
237
;---------------------------------------------
238
align	32
238
align	32
239
	half	dd	0x7fffffff, 0
239
	half	dd	0x7fffffff, 0
240
	e	dd	0xffffffff, 0x3fdfffff
240
	e	dd	0xffffffff, 0x3fdfffff
241
	rtt	dd	0xffffffff, 0x3fefffff
241
	rtt	dd	0xffffffff, 0x3fefffff