aboutsummaryrefslogtreecommitdiffstats
path: root/test/c/perlin.c
diff options
context:
space:
mode:
authorDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2020-04-20 14:06:21 +0200
committerDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2020-04-20 14:06:21 +0200
commit168393089024b5f926836cb813fddf14e6b6e4d4 (patch)
tree5d018198dc26be847544f162b87ad3dcecbab479 /test/c/perlin.c
parent633b72565b022f159526338b5bbb9fcac86dfd2b (diff)
parentb3431b1d9ee5121883d307cff0b62b7e53369891 (diff)
downloadcompcert-kvx-168393089024b5f926836cb813fddf14e6b6e4d4.tar.gz
compcert-kvx-168393089024b5f926836cb813fddf14e6b6e4d4.zip
Merge remote-tracking branch 'origin/mppa-work' into mppa-fast-div
(unfinished)
Diffstat (limited to 'test/c/perlin.c')
-rw-r--r--test/c/perlin.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/test/c/perlin.c b/test/c/perlin.c
index e7bbd22d..29ebf964 100644
--- a/test/c/perlin.c
+++ b/test/c/perlin.c
@@ -63,13 +63,22 @@ static void init(void) {
p[256+i] = p[i] = permutation[i];
}
+#ifdef __K1C__
+#define INCREMENT 0.5
+#define MIN -3.0
+#define MAX 3.0
+#else
+#define INCREMENT 0.1
+#define MIN -5.0
+#define MAX 5.0
+#endif
int main(int argc, char ** argv) {
init();
double x, y, z, sum = 0.0;
- for (x = -5.0; x < 5.0; x += 0.1)
- for (y = -5.0; y < 5.0; y += 0.1)
- for (z = -5.0; z < 5.0; z += 0.1)
+ for (x = MIN; x < MAX; x += INCREMENT)
+ for (y = MIN; y < MAX; y += INCREMENT)
+ for (z = MIN; z < MAX; z += INCREMENT)
sum += noise(x, y, z);
printf("%.4e\n", sum);