forked from AsmOptC-RiscV/Assembly-Optimized-C-RiscV
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
48 lines (35 loc) · 940 Bytes
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include "scheme.h"
#include "test/test.h"
#include "test/test_aead.h"
#include "test/test_hash.h"
#ifdef MURAX
#include "murax/hal.h"
#endif
#include <stdio.h>
inline static void __attribute__((always_inline)) do_nothing() {
for (int i = 0; i < 1000; ++i) {
__asm__("NOP");
}
for (int i = 0; i < 2; ++i)
printf("\n");
}
int main(void) {
// Instruction cache misses are relatively expensive, so for more
// consistent benchmarks that depend less on the relative speed of
// the QSPI flash, you might want to fill the instruction cache first.
// Note that it can hold 16 KiB of instructions on the HiFive1.
do_nothing();
printf("starting benchmarking program\n");
do_nothing();
#ifdef ADDITIONAL
additional_tests();
#endif
#ifdef crypto_hash
test_crypto_hash();
#endif
#ifdef crypto_aead_encrypt
test_crypto_aead();
#endif
printf("DONE!\n");
return 0;
}