My kernel compiles, but disassembly shows that my loops have been unrolled completely, and at the end I get:
1388 x: AND_INT R26.x, T3.x, 1
y: AND_INT ____, R20.w, 1
z: LSHL ____, R26.x, 1 VEC_120
w: LSHL ____, R22.y, 1
t: LSHL ____, R15.z, 1
65 NOP NO_BARRIER
66 NOP NO_BARRIER
67 NOP NO_BARRIER
68 NOP NO_BARRIER
95 NOP NO_BARRIER
96 NOP NO_BARRIER
97 ALU: ADDR(2072577) CNT(1) NO_BARRIER
Error: Clause @ addr 16580616 (count=1, size=8) falls out of program range (size=62368).
Likely incorrect clause addr or slot count specified.
If I try to run this kernel I get a complete driver crash (execution takes too long and 1 CPU core freezes on Linux)
I tried googling for the error message but came up empty, and I can't find a way to more explicitly control loop unrolling. EDIT: The problem seems to be caused by having 2 while loops in the same kernel, using just a single loop worked.
The loop construct is attached as code
(I never could figure out how to use the loop instruction)
mov r99.x,l15.x whileloop iadd r99.x,r99.x,l2.x if_logicalz r99.x break endif ... endloop