#include #include #include #define __rpcc __builtin_alpha_rpcc #define CPML "cpml" #define GLIBC "glibc" #ifndef FUNCTION #error Must define FUNCTION #else double FUNCTION(double); #endif #ifndef DOMAIN_START #error Must define RANGE_START #endif #ifndef DOMAIN_END #error Must define DOMAIN_END #endif #ifndef INCREMENT #define INCREMENT 0.1 #endif int main(int argc, char * argv[]) { double x; double results[100]; int i; int iterations; uint32_t start, end; start = __rpcc(); for (i = 0, x = DOMAIN_START; x < DOMAIN_END; i++, x += INCREMENT) { results[i] = FUNCTION(x); } end = __rpcc(); iterations = i; if (argc != 1) { for (i = 0; i < iterations; i++) { printf("%f\n", results[i]); } } printf("%u,", (end - start) / iterations); return 0; }