create m5ops.cpp to count instructions before main

C++ has 2M while C has 100k.
This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-12-17 00:00:01 +00:00
parent ab6f733140
commit 5e39c1b911
2 changed files with 57 additions and 9 deletions

View File

@@ -11578,7 +11578,10 @@ gem5 allocates some magic instructions on unused instruction encodings for conve
Those instructions are exposed through the <<m5>> in tree executable.
To make things simpler to understand, you can play around with our own minimized educational `m5` subset link:userland/c/m5ops.c[].
To make things simpler to understand, you can play around with our own minimized educational `m5` subset:
* link:userland/c/m5ops.c[]
* link:userland/cpp/m5ops.cpp[]
The instructions used by `./c/m5ops.out` are present in link:lkmc/m5ops.h[] in a very simple to understand and reuse inline assembly form.
@@ -19433,10 +19436,10 @@ Summary of manually collected results on <<p51>> at LKMC a18f28e263c91362519ef55
.Busy loop MIPS for different simulator setups
[options="header"]
|===
|LKMC |Benchmark |Emulator |Loops |Time (s) |Instruction count |Approximate MIPS
|LKMC |Benchmark build |Emulator command |Loops |Time (s) |Instruction count |Approximate MIPS
|a18f28e263c91362519ef550150b5c9d75fa3679 + 1
|userland/gcc/busy_loop.c -O0
|link:userland/gcc/busy_loop.c[] `-O0`
|`qemu --arch aarch64`
|10^10
|68
@@ -19444,7 +19447,7 @@ Summary of manually collected results on <<p51>> at LKMC a18f28e263c91362519ef55
|2000
|a18f28e263c91362519ef550150b5c9d75fa3679 + 1
|userland/gcc/busy_loop.c -O0
|link:userland/gcc/busy_loop.c[] `-O0`
|`gem5 --arch aarch64`
|10^7
|100
@@ -19452,7 +19455,7 @@ Summary of manually collected results on <<p51>> at LKMC a18f28e263c91362519ef55
|1
|a18f28e263c91362519ef550150b5c9d75fa3679 + 1
|userland/gcc/busy_loop.c -O0
|link:userland/gcc/busy_loop.c[] `-O0`
|`+gem5 --arch aarch64 -- --cpu-type MinorCPU --caches+`
|10^6
|31
@@ -19460,7 +19463,7 @@ Summary of manually collected results on <<p51>> at LKMC a18f28e263c91362519ef55
|0.4
|a18f28e263c91362519ef550150b5c9d75fa3679 + 1
|userland/gcc/busy_loop.c -O0
|link:userland/gcc/busy_loop.c[] `-O0`
|`+gem5 --arch aarch64 -- --cpu-type DerivO3CPU --caches+`
|10^6
|52
@@ -19468,7 +19471,7 @@ Summary of manually collected results on <<p51>> at LKMC a18f28e263c91362519ef55
|0.2
|a18f28e263c91362519ef550150b5c9d75fa3679 + 1
|userland/gcc/busy_loop.c -O0
|link:userland/gcc/busy_loop.c[] `-O0`
|`+gem5 --arch aarch64 --gem5-build-id MOESI_CMP_directory -- --cpu-type DerivO3CPU --caches --ruby+`
|1 * 1000000 = 10^6
|63
@@ -19476,7 +19479,7 @@ Summary of manually collected results on <<p51>> at LKMC a18f28e263c91362519ef55
|0.2
|605448f07e6380634b1aa7e9732d111759f69fd
|<<dhrystone>> -O3
|<<dhrystone>> `-O3`
|`gem5 --arch aarch64`
|4 * 10^5
|68
@@ -19484,13 +19487,29 @@ Summary of manually collected results on <<p51>> at LKMC a18f28e263c91362519ef55
|1.6
|5d233f2664a78789f9907d27e2a40e86cefad595
|<<stream-benchmark>> -O3
|<<stream-benchmark>> `-O3`
|`gem5 --arch aarch64 --userland-args 300000 2`
|3 * 10^5 * 2
|64
|9.9674773 * 10^7
|1.6
|ab6f7331406b22f8ab6e2df5f8b8e464fb35b611
|link:userland/c/m5ops.c[] `-O0`
|`gem5 --arch aarch64 --userland-args e`
|1
|2
|1.26479 * 10^5
|0.05
|ab6f7331406b22f8ab6e2df5f8b8e464fb35b611
|link:userland/cpp/m5ops.cpp[] `-O0`
|`gem5 --arch aarch64 --userland-args e`
|1
|2
|2.385012 * 10^6
|1
|===
The first step is to determine a number of loops that will run long enough to have meaningful results, but not too long that we will get bored, so about 1 minute.