aboutsummaryrefslogtreecommitdiff
path: root/tests/bench/sieve.zc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/bench/sieve.zc')
-rw-r--r--tests/bench/sieve.zc8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/bench/sieve.zc b/tests/bench/sieve.zc
index 1fb579b..9259bf4 100644
--- a/tests/bench/sieve.zc
+++ b/tests/bench/sieve.zc
@@ -1,11 +1,11 @@
// primes below N. the same loops as tests/bench/sieve.c: one word per flag,
// marks start at i*i. the count is 9592.
-// a fixed []int, bounds-checked, plain bytecode
+// a fixed int[?], bounds-checked, plain bytecode
// b the same function lifted by o3
// c o3 through a raw *int, no per-index check
const int N = 100000;
-int sieve(fixed []int f) {
+int sieve(fixed int[?] f) {
int n = len(f), c = 0;
for (int i = 2; i < n; i++) f[i] = 1;
for (int i = 2; i * i < n; i++)
@@ -13,7 +13,7 @@ int sieve(fixed []int f) {
for (int i = 2; i < n; i++) c += f[i];
return c;
}
-o3 int sieve3(fixed []int f) {
+o3 int sieve3(fixed int[?] f) {
int n = len(f), c = 0;
for (int i = 2; i < n; i++) f[i] = 1;
for (int i = 2; i * i < n; i++)
@@ -39,7 +39,7 @@ int main() {
free(d*raw);
return 0;
}
- fixed []int f = new(fixed []int, N);
+ fixed int[?] f = new(fixed int[?], N);
while (reps > 0) {
if (which == 'b') r = sieve3(f);
else r = sieve(f);