Subversion Repositories Kolibri OS

Rev

Rev 205 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

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