summaryrefslogtreecommitdiff
path: root/math.c
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2009-08-11 04:01:08 +0000
committerMatt Turner <mattst88@gmail.com>2009-08-11 04:01:08 +0000
commit37c2d4e8e6c66e51c132ffe99d2f98ec92eb3cc9 (patch)
tree0f60cadcc280d97e8a6ce995bb5ebc6ecfd96e1a /math.c
parent1b1ba4b2f4766e503a5072c46402689e7474cb25 (diff)
Also build with ccc for benchmarking
git-svn-id: svn://mattst88.com/svn/cpml-benchmarks@3 dfcbb71e-afff-4d4a-b3c7-756acd92cddf
Diffstat (limited to 'math.c')
-rw-r--r--math.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/math.c b/math.c
index 3c99e51..8e9629d 100644
--- a/math.c
+++ b/math.c
@@ -1,8 +1,19 @@
+#ifdef __DECC
+
+#include <machine/builtins.h>
+#define __rpcc(x) __RPCC(x)
+extern int printf (const char * format, ...);
+#define M_PI 3.14159265358979323846 /* pi */
+
+#elif defined __GNUC__
+
+#define __rpcc(x) __builtin_alpha_rpcc(x)
#include <stdio.h>
#include <math.h>
-#include <stdint.h>
-#define __rpcc __builtin_alpha_rpcc
+#else
+#error Unknown compiler
+#endif
#define CPML "cpml"
#define GLIBC "glibc"
@@ -25,13 +36,14 @@ double FUNCTION(double);
#define INCREMENT 0.1
#endif
+
int main(int argc, char * argv[]) {
double x;
double results[100];
int i;
int iterations;
- uint32_t start, end;
+ unsigned int start, end;
start = __rpcc();