You've already forked linux-packaging-mono
acceptance-tests
data
debian
docs
external
Newtonsoft.Json
api-doc-tools
api-snapshot
aspnetwebstack
bdwgc
binary-reference-assemblies
bockbuild
boringssl
cecil
cecil-legacy
corefx
corert
helix-binaries
ikdasm
ikvm
illinker-test-assets
linker
llvm-project
clang
clang-tools-extra
compiler-rt
cmake
docs
include
lib
test
BlocksRuntime
asan
builtins
TestCases
Unit
timing
ashldi3.c
ashrdi3.c
divdi3.c
floatdidf.c
floatdisf.c
floatdixf.c
floatundidf.c
floatundisf.c
floatundixf.c
lshrdi3.c
moddi3.c
modsi3.c
muldi3.c
negdi2.c
time
timing.h
udivdi3.c
umoddi3.c
CMakeLists.txt
lit.cfg
lit.site.cfg.in
cfi
dfsan
esan
fuzzer
hwasan
interception
lsan
msan
profile
safestack
sanitizer_common
scudo
tsan
ubsan
ubsan_minimal
xray
CMakeLists.txt
lit.common.cfg
lit.common.configured.in
unittests
www
.arcconfig
.gitignore
CMakeLists.txt
CODE_OWNERS.TXT
CREDITS.TXT
LICENSE.TXT
README.txt
libcxx
libcxxabi
libunwind
lld
lldb
llvm
openmp
polly
nuget-buildtasks
nunit-lite
roslyn-binaries
rx
xunit-binaries
how-to-bump-roslyn-binaries.md
ikvm-native
llvm
m4
man
mcs
mk
mono
msvc
netcore
po
runtime
samples
scripts
support
tools
COPYING.LIB
LICENSE
Makefile.am
Makefile.in
NEWS
README.md
acinclude.m4
aclocal.m4
autogen.sh
code_of_conduct.md
compile
config.guess
config.h.in
config.rpath
config.sub
configure.REMOVED.git-id
configure.ac.REMOVED.git-id
depcomp
install-sh
ltmain.sh.REMOVED.git-id
missing
mkinstalldirs
mono-uninstalled.pc.in
test-driver
winconfig.h
48 lines
1.1 KiB
C
48 lines
1.1 KiB
C
![]() |
#include "timing.h"
|
||
|
#include <stdio.h>
|
||
|
|
||
|
#define INPUT_TYPE int64_t
|
||
|
#define INPUT_SIZE 512
|
||
|
#define FUNCTION_NAME __floatdisf
|
||
|
|
||
|
#ifndef LIBNAME
|
||
|
#define LIBNAME UNKNOWN
|
||
|
#endif
|
||
|
|
||
|
#define LIBSTRING LIBSTRINGX(LIBNAME)
|
||
|
#define LIBSTRINGX(a) LIBSTRINGXX(a)
|
||
|
#define LIBSTRINGXX(a) #a
|
||
|
|
||
|
float FUNCTION_NAME(INPUT_TYPE x);
|
||
|
|
||
|
int main(int argc, char *argv[]) {
|
||
|
INPUT_TYPE input[INPUT_SIZE];
|
||
|
int i, j;
|
||
|
|
||
|
srand(42);
|
||
|
|
||
|
// Initialize the input array with data of various sizes.
|
||
|
for (i=0; i<INPUT_SIZE; ++i)
|
||
|
input[i] = (((uint64_t)rand() << 32) | (uint64_t)rand()) >> (rand() & 63);
|
||
|
|
||
|
double bestTime = __builtin_inf();
|
||
|
void *dummyp;
|
||
|
for (j=0; j<1024; ++j) {
|
||
|
|
||
|
uint64_t startTime = mach_absolute_time();
|
||
|
for (i=0; i<INPUT_SIZE; ++i)
|
||
|
FUNCTION_NAME(input[i]);
|
||
|
uint64_t endTime = mach_absolute_time();
|
||
|
|
||
|
double thisTime = intervalInCycles(startTime, endTime);
|
||
|
bestTime = __builtin_fmin(thisTime, bestTime);
|
||
|
|
||
|
// Move the stack alignment between trials to eliminate (mostly) aliasing effects
|
||
|
dummyp = alloca(1);
|
||
|
}
|
||
|
|
||
|
printf("%16s: %f cycles.\n", LIBSTRING, bestTime / (double) INPUT_SIZE);
|
||
|
|
||
|
return 0;
|
||
|
}
|