Browse Source

Compile Dhrystone with multiple GCC runs

This doesn't actually make a difference because we had some pragmas in
there to avoid badness, but this sets a better example.
pull/279/head
Palmer Dabbelt 9 years ago
parent
commit
0da639dbc3
  1. 6
      test/benchmarks/dhrystone/check
  2. 2
      test/benchmarks/dhrystone/dhrystone.h
  3. 2
      test/benchmarks/dhrystone/dhrystone_main.c

6
test/benchmarks/dhrystone/check

@ -28,7 +28,11 @@ echo "ERROR: $march-$mabi failed to run" >$out
tempdir=$(mktemp -d)
trap "rm -rf $tempdir" EXIT
$cc ${c[@]} -march=$march -mabi=$mabi -O3 -o $tempdir/dhrystone -static -Wno-all
for f in ${c[@]}
do
$cc -c $f -march=$march -mabi=$mabi -O3 -fno-common -fno-inline -o $tempdir/$(basename $f).o -static -Wno-all
done
$cc -march=$march -mabi=$mabi $tempdir/*.o -o $tempdir/dhrystone
$objdump -d $tempdir/dhrystone > ~/dump
begin_pc=$($objdump -d $tempdir/dhrystone | grep 'Begin_Time' | grep -e 'sd' -e 'sw' | cut -d: -f1 | xargs echo)

2
test/benchmarks/dhrystone/dhrystone.h

@ -391,7 +391,7 @@ extern clock_t clock();
*** You must define HZ!!! ***
#endif /* HZ */
#ifndef PASS2
struct tms time_info;
extern struct tms time_info;
#endif
/*extern int times ();*/
/* see library function "times" */

2
test/benchmarks/dhrystone/dhrystone_main.c

@ -7,6 +7,8 @@
// This is the classic Dhrystone synthetic integer benchmark.
//
struct tms time_info;
#define read_csr(reg) ({ unsigned long __tmp; \
asm volatile ("csrr %0, " #reg : "=r"(__tmp)); \
__tmp; })

Loading…
Cancel
Save