How to calculate MIPS of my processor?

I have an old computer.
I want to accurately calculate MIPS (Million Instruction Per Second) and DMIPS of my processor.
What can I do for this?

+5
source share
4 answers

According to what you wanted, here is some bootloader code that performs a kind of test that can probably be used to measure MIPS in some way. The main goal here was low-level, and I believe that this is the lowest level at which you can really program on a PC, unless you want to replace your BIOS or something like that.

, -, ( add s, sub ) . ITERS. , , .

rdtsc, , 64- edx eax. , , . , BIOS 10h . , , , .

. NASM -f bin, , - , dd. . USB-, BIOS. , , .

bits 16
org 0x7c00

ITERS equ 1000000

jmp 0x0000:start

start:
    cli
    xor ax, ax
    mov ds, ax
    mov ss, ax
    mov sp, stack_end

    rdtsc
    mov [old_rdtsc], eax
    mov [old_rdtsc+4], edx
    mov eax, ITERS

.loop:
    add ebx, ecx
    add ecx, edx

    sub eax, 1
    jnz .loop

    rdtsc

    sub eax, [old_rdtsc]
    sbb edx, [old_rdtsc+4]

    mov si, 15

.fillbuf_eax:
    mov edi, eax
    shr eax, 4
    and di, 0xf
    mov bl, [hex_chars+di]
    mov [str_buf+si], bl
    sub si, 1
    cmp si, 7
    ja .fillbuf_eax

.fillbuf_edx:
    mov edi, edx
    shr edx, 4
    and di, 0xf
    mov bl, [hex_chars+di]
    mov [str_buf+si], bl
    sub si, 1
    jns .fillbuf_edx

    mov ah, 0xe
    xor bx, bx
.bios_write:
    pusha
    mov al, [str_buf+bx]
    int 10h
    popa
    add bx, 1
    cmp bx, 16
    jb .bios_write

    sti

.halt:
    hlt
    jmp .halt

hex_chars db "0123456789ABCDEF"
old_rdtsc resq 1
str_buf resb 16

STACK_SIZE equ 200
stack resb STACK_SIZE
stack_end equ $

times 510-($-$$) db 0x90
db 0x55, 0xaa

AMD Athlon XP 1700+ 0x1e8596 , 2000278 . 1466 , 1,36 .

+4

:

get start time.
add two numbers million times <- repeat this N times, N >= 1
get end time.

MIPS = (end time - start time) in seconds / N. 

( C, int + )

https://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Dhrystone/?diff_format=h&sortby=date

Dhrystone mips Dhrystone, , 1757.

+3

MIPS processortype GHZ,

http://en.wikipedia.org/wiki/Instructions_per_second

( ) - , .....

+2

MIPS , , .

MIPS = ( * Num , )/(10 ^ 6).

For example, the TI 6487 can execute 8 32-bit instructions per cycle, and the clock frequency is 1.2 GHz per core.

therefore MIPS = ((1.2 * 10 ^ 9) * 8) / (10 ^ 6) = 9600 MIPS per core, and this DSP has 3 cores, so the total MIPS DSP is 28800.

0
source

All Articles