Close

More statistics - top 5 instructions

A project log for Super-V

Research possibilities for superscalar 32-bit RISC-V under GPL v3

shaosSHAOS 12/25/2018 at 04:010 Comments

I extended emulator by finding of top 5 most frequent instructions - these are results for some RISC-V benchmarks:

dhrystone:

Five Most Frequent:
1) ADDI   = 87830 (27.05%)
2) BEQ   = 33399 (10.29%)
3) SW   = 33037 (10.17%)
4) LW   = 31050 (9.56%)
5) LBU   = 27712 (8.53%)

median:

Five Most Frequent:
1) ADDI    = 3758 (23.13%)
2) LW    = 3519 (21.66%)
3) BNE    = 1825 (11.23%)
4) BGE    = 1240 (7.63%)
5) SW    = 1141 (7.02%)

multiply:

Five Most Frequent:
1) ADDI    = 9581 (19.29%)
2) BNE    = 7309 (14.72%)
3) SLLI    = 7052 (14.20%)
4) BEQ    = 6691 (13.47%)
5) ANDI    = 6540 (13.17%)

qsort:

Five Most Frequent:
1) ADDI    = 77881 (32.97%)
2) LW    = 56308 (23.84%)
3) BLT    = 37593 (15.91%)
4) SW    = 17257 (7.31%)
5) BLTU    = 7834 (3.32%)

rsort:

Five Most Frequent:
1) LW    = 76238 (20.37%)
2) ADDI    = 54419 (14.54%)
3) SW    = 53704 (14.35%)
4) ADD    = 51461 (13.75%)
5) SLLI    = 50106 (13.39%)

towers:

Five Most Frequent:
1) ADDI    = 6397 (34.29%)
2) SW    = 3716 (19.92%)
3) LW    = 3682 (19.74%)
4) LI*    = 944 (5.06%) <=== this is part of ADDI
5) BEQ    = 615 (3.30%)

vvadd:

Five Most Frequent:
1) ADDI    = 3809 (31.81%)
2) LW    = 2135 (17.83%)
3) BNE    = 1443 (12.05%)
4) SW    = 945 (7.89%)
5) ADD    = 745 (6.22%)

As you can see most frequent RISC-V instruction is ADDI (that is also used for LI "load immediate" assembler command and some others as NOP and MV). The only exception is rsort benchmark test where ADDI is 2nd and 1st one is LW (load word). As you can see I counting LI separately (this count included to ADDI count) just to have visibility to its usage.

Discussions