Mercurial > hg > Papers > 2023 > soto-master
comparison Paper/src/twice.c @ 1:a72446879486
Init paper
author | soto <soto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 12 Jan 2023 20:28:50 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
0:8df537cb6a18 | 1:a72446879486 |
---|---|
1 // Twice | |
2 __code twice(struct Context* context, struct LoopCounter* loopCounter, int index, int alignment, int* array) { | |
3 int i = loopCounter->i; | |
4 | |
5 if (i < alignment) { | |
6 array[i+index*alignment] = array[i+index*alignment]*2; | |
7 loopCounter->i++; | |
8 | |
9 goto meta(context, Twice); | |
10 } | |
11 | |
12 loopCounter->i = 0; | |
13 | |
14 stack_pop(context->code_stack, &context->next); | |
15 goto meta(context, context->next); | |
16 } |