From e224225dfc724f01aa79607936274f2378506950 Mon Sep 17 00:00:00 2001 From: Luis <42945842+ldiaz94@users.noreply.github.com> Date: Mon, 12 Oct 2026 17:49:53 +0100 Subject: [PATCH] Slices in registers A slice whose address isn't taken may have two of the variables' registers, its pointer's and its length's (reg2), chosen by the read-ahead as a single value is, its count halved for each register: counted whole, a slice took registers from busier single values, and rat ran 3% slower. Its item names both registers: PushVar reads either word, IndexSlice and Slice use them as they are, a failed check takes the length from its register, CopyTo loads both, and what wants its memory has its words stored in a temporary. rat 583 -> 557 ms (-4.5%), text -0.1%; heap sort -5%, search -4%, sum within noise; make check compiles test/bench. --- diff --git a/PLAN.md b/PLAN.md index 8dc293a..898b7f8 100644 --- a/PLAN.md +++ b/PLAN.md @@ -19,7 +19,7 @@ Each step is measured as v0.7.0's were, on rat and on its kernel, and one that buys less than 2% on both is reverted and noted here. -1. **Slices in registers.** A slice parameter or variable whose address +1. Done: **Slices in registers.** A slice parameter or variable whose address isn't taken lives in two of the variables' registers, its pointer and its length, chosen by the read-ahead as a single value is, and counted as two. FPC's search keeps its slice in `rdi` and `rsi`; diff --git a/doc/compiler.md b/doc/compiler.md index dd51ef9..42ced96 100644 --- a/doc/compiler.md +++ b/doc/compiler.md @@ -262,6 +262,48 @@ though this path uses one of them. Each could go, at the cost of lines a reader would have to follow. +## Better code again, in v0.8.0 + +Each change below was measured on rat, a terminal emulator written in +raz, running its 26 MB workload, and on the kernels of `test/bench`, +against their twins built by FPC `-O2` (`make kernels`); one that +bought less than 2% on both was taken out again. + +1. **Slices in registers.** `sum(s: []INT)` kept its slice in the + frame, and read its pointer from there for each element: + + ``` + mov [rbp - 16], rdi ; the prologue: s, to its slots + mov [rbp - 8], rsi + ... + mov r9, r14 ; s[i], each time round + shl r9, 3 + add r9, [rbp - 16] + ``` + + Now a slice whose address isn't taken can have two of the + variables' registers, its pointer's and its length's + (`o^.reg2`), chosen as a single value's is but for half its weight + in each: + + ``` + mov r12, rdi + mov r13, rsi + ... + mov r9, r14 + shl r9, 3 + add r9, r12 + ``` + + Its item is at `bReg`, and its `TAdr` names both registers (`hi` + for the length's): `PushVar` reads either word (`RegAt`), + `IndexSlice` and `Slice` compare with the length's and add the + pointer's, a failed check takes the length from its register + (`InRegister`), and `CopyTo` loads both. What wants a slice's + memory, a comparison or `COPY`, has its words stored in a + temporary first (`CopyToTemp`). rat 5% faster, the heap sort 5%, + the search 4%. + ## diag.pas: messages Every message the compiler prints is made here. A position, `TPos`, is @@ -532,7 +574,8 @@ first. The prologue saves them, zeroes them, and moves a parameter into its register from the register or stack slot it arrived in; the epilogue -restores them. A variable in one is an +restores them. A slice may have two, its pointer's and its length's +(see "Better code again" above). A variable in one is an item at `bReg`: `PushVar` notes it (`lHeld`) rather than copying it, `Peek` reads it in place where the value is only read, so `i < n` is `cmp rbx, r12`, and `PopVar` and `IncDecReg` write it. Rt finds the @@ -726,7 +769,8 @@ the body ahead, as `InstancesFor` does, and counts each variable's uses: 1 for each, 4 in a loop, 16 in two, at most 64 (loops nested three deep or more); one `ADR` takes is out. The -five busiest used at least three times get registers (`o^.reg`). An +busiest used at least three times get the five registers (`o^.reg`), +a slice two (`o^.reg2` too), its count halved for each. An address wanted after all, by a `var` parameter, say, comes to `Address` (`item.pas`), which puts the variable back in memory and sets `demoted`: `Body` then throws the procedure's code away @@ -862,7 +906,8 @@ `_ := f(x)` drops one on purpose. `-Werror` makes each an error. - **Registers for variables.** Up to five of a procedure's single values, not reals, whose address is never taken, live in `rbx` and - `r12` to `r15`; the trap report shows them as it shows the others. + `r12` to `r15`, a slice taking two of them; the trap report shows + them as it shows the others, but for slices, which it never shows. - **Several results** that are two words, and a slice, come back in rax and rdx, as from a code procedure; others through a hidden pointer to the caller's slots. diff --git a/src/gen.pas b/src/gen.pas index e5323ac..5e617c2 100644 --- a/src/gen.pas +++ b/src/gen.pas @@ -70,7 +70,9 @@ TAdr = record base: TBase; chunk: longint; { bGlobal: the chunk; bSlot: the frame slot; bReg: the register } - off: int64; { added to the address } + off: int64; { added to the address; for bReg, which word, 0 or 8 } + hi: longint; { bReg, a slice: the register of its length, the + second word; chunk is that of its pointer } end; { The code made so far, to go back to for a second try at a body } @@ -411,6 +413,13 @@ Fits32 := (v >= low(longint)) and (v <= high(longint)); end; +{ The register of the word at a, a variable in registers: the variable's + own, or for a slice its pointer's (off 0) or its length's (off 8) } +function RegAt(const a: TAdr): longint; +begin + if a.off = 0 then RegAt := a.chunk else RegAt := a.hi; +end; + { The memory a names. An address on the stack is popped, and is in its register still; one in a slot is loaded into r. } function Place(const a: TAdr; r: longint): TMem; @@ -458,7 +467,7 @@ var m: TMem; r: longint; begin if a.base = bReg then begin - NewEntry(k, lHeld, a.chunk); + NewEntry(k, lHeld, RegAt(a)); exit; end; { in the order PushAdr explains } @@ -483,7 +492,7 @@ var r: longint; v: int64; begin if a.base = bReg then begin - if TopConst(v) then MovRI(a.chunk, v) else MovRR(a.chunk, Peek(depth - 1)); + if TopConst(v) then MovRI(RegAt(a), v) else MovRR(RegAt(a), Peek(depth - 1)); Drop; exit; end; @@ -553,10 +562,16 @@ CopyBytes(size); end; -{ Pops a source's address, and copies size bytes to a. } +{ Pops a source's address, and copies size bytes to a: for a slice in + registers, its two words into them. } procedure CopyTo(const a: TAdr; size: int64); begin PopTo(RSI); + if a.base = bReg then begin + Load(a.chunk, Mem(RSI, 0), 8, false); + Load(a.hi, Mem(RSI, 8), 8, false); + exit; + end; Lea(RDI, Place(a, RDI)); CopyBytes(size); end; @@ -1069,6 +1084,7 @@ const NoBase = -2; { a TMem that is no memory } + ARegister = -3; { a TMem that is no memory but a register, its index } { The program goes on if the condition cc holds, and otherwise stops in Rt.fail(what, a, b, len, at, name), which says what failed at p, @@ -1110,7 +1126,9 @@ LineCol(at, line, col); NoteLine(line, col); if ra <> RSI then MovRR(RSI, ra); - if m.base = NoBase then MovRI(RCX, n) else Load(RCX, m, 8, false); + if m.base = NoBase then MovRI(RCX, n) + else if m.base = ARegister then MovRR(RCX, m.index) + else Load(RCX, m, 8, false); if name >= 0 then Lea(R9, MemRip(name, 0)); if failStubs[what] < 0 then failStubs[what] := NewChunk(secText, Intern('Rt', 2), Intern(@StubNames[what][1], 6)); CallChunk(failStubs[what]); @@ -1122,6 +1140,13 @@ function NoMem: TMem; begin NoMem := Mem(NoBase, 0); +end; + +{ For Check: a length in register r, a slice's in registers } +function InRegister(r: longint): TMem; +begin + InRegister := Mem(ARegister, 0); + InRegister.index := r; end; { The index on top is below n, unsigned } @@ -1160,21 +1185,31 @@ It is worked out in the index's own register, which then holds the address; but if the slice's address is on the stack, under the index, the element's register is the one that holds that, still - needed, so the work is done in rax. } + needed, so the work is done in rax. A slice in registers is + compared with and added to them. } procedure IndexSlice(const a: TAdr; size: int64; checked: boolean; const p: TPos); var m, ml: TMem; r: longint; inRax: boolean; begin inRax := a.base = bStack; if inRax then begin r := RAX; PopTo(RAX) end else begin r := Top; Drop end; - m := Place(a, RCX); - ml := m; ml.disp := ml.disp + 8; - if checked then begin - AluM(aluCmp, r, ml); - Check(ccB, 0, p, r, ml, 0, -1); + if a.base = bReg then begin + if checked then begin + Alu(aluCmp, r, a.hi); + Check(ccB, 0, p, r, InRegister(a.hi), 0, -1); + end; + MulI(r, size); + Alu(aluAdd, r, a.chunk); + end else begin + m := Place(a, RCX); + ml := m; ml.disp := ml.disp + 8; + if checked then begin + AluM(aluCmp, r, ml); + Check(ccB, 0, p, r, ml, 0, -1); + end; + MulI(r, size); + AluM(aluAdd, r, m); end; - MulI(r, size); - AluM(aluAdd, r, m); if inRax then MovRR(Target, RAX) else Claim(depth); { the index's register again, now for the address } Computed(kWord); @@ -1188,12 +1223,16 @@ begin PopTo(RDX); PopTo(RCX); - m := Place(a, RDI); - ml := m; ml.disp := ml.disp + 8; + if a.base = bReg then ml := InRegister(a.hi) { a slice in registers } + else begin + m := Place(a, RDI); + ml := m; ml.disp := ml.disp + 8; + end; if checked then begin { two checks, both unsigned, so that a negative bound fails too: hi against the length, then lo against hi } if isArray then begin CmpI(RDX, n); ml := NoMem end + else if a.base = bReg then Alu(aluCmp, RDX, a.hi) else AluM(aluCmp, RDX, ml); Check(ccBE, 1, p, RCX, ml, n, -1); Alu(aluCmp, RCX, RDX); @@ -1203,7 +1242,9 @@ Alu(aluSub, RAX, RCX); Store(Mem(RBP, tmp + 8), RAX, 8); MulI(RCX, size); - if isArray then Lea(RAX, m) else Load(RAX, m, 8, false); + if isArray then Lea(RAX, m) + else if a.base = bReg then MovRR(RAX, a.chunk) + else Load(RAX, m, 8, false); Alu(aluAdd, RAX, RCX); Store(Mem(RBP, tmp), RAX, 8); end; @@ -1441,7 +1482,7 @@ p^.val := AllocPerm(16, 8); for k := 0 to 1 do begin inReg[numIn] := IntRegs[ni]; inSlot[numIn] := p^.val + 8 * k; - inSize[numIn] := 8; inObj[numIn] := nil; + inSize[numIn] := 8; inObj[numIn] := p; inc(numIn); inc(ni); end; end else begin @@ -1513,7 +1554,7 @@ registers of variables are zeroed in place, their save slots are written before they are read, and so is every temporary. } procedure EnterBody(c, line: longint); -var i, top: longint; n: int64; p: PObj; +var i, top, r: longint; n: int64; p: PObj; begin BeginChunk(c); codeChunk := c; @@ -1550,12 +1591,15 @@ inc(n); end; { the parameters that came in registers, to their slots or, for a - register variable, to its register } + register variable, to its register: a slice's second word, the one + for the slot 8 bytes into its own, to its length's } for i := 0 to numIn - 1 do if inReg[i] < 0 then MovsdMX(Mem(RBP, inSlot[i]), -1 - inReg[i]) else if (inObj[i] <> nil) and (inObj[i]^.reg <> 0) then begin - MovRR(inObj[i]^.reg, inReg[i]); - if inSize[i] < 8 then Extend(inObj[i]^.reg, inSize[i], inObj[i]^.typ^.signed); + r := inObj[i]^.reg; + if inSlot[i] <> inObj[i]^.val then r := inObj[i]^.reg2; + MovRR(r, inReg[i]); + if inSize[i] < 8 then Extend(r, inSize[i], inObj[i]^.typ^.signed); end else Store(Mem(RBP, inSlot[i]), inReg[i], inSize[i]); { a register variable's parameter that came on the stack, above the frame (val > 0), is loaded from there } @@ -1564,7 +1608,10 @@ if (p^.reg <> 0) and (p^.val > 0) then if p^.typ^.form in [fInt, fBool, fEnum, fSet] then Load(p^.reg, Mem(RBP, p^.val), p^.typ^.size, p^.typ^.signed) - else Load(p^.reg, Mem(RBP, p^.val), 8, false); + else begin + Load(p^.reg, Mem(RBP, p^.val), 8, false); + if p^.typ^.form = fSlice then Load(p^.reg2, Mem(RBP, p^.val + 8), 8, false); + end; p := p^.next; end; end; diff --git a/src/item.pas b/src/item.pas index ad42fd3..1f71f2a 100644 --- a/src/item.pas +++ b/src/item.pas @@ -191,6 +191,7 @@ FrameAdr.base := bFrame; FrameAdr.chunk := -1; FrameAdr.off := off; + FrameAdr.hi := 0; end; function GlobalAdr(c: longint): TAdr; @@ -198,14 +199,17 @@ GlobalAdr.base := bGlobal; GlobalAdr.chunk := c; GlobalAdr.off := 0; + GlobalAdr.hi := 0; end; -{ Where the variable x is, for gen } +{ Where the variable x is, for gen; a slice in registers has two } function AdrOf(const x: TItem): TAdr; begin AdrOf.base := x.base; AdrOf.chunk := x.chunk; AdrOf.off := x.off; + AdrOf.hi := 0; + if x.base = bReg then AdrOf.hi := x.obj^.reg2; end; { An item for "found ...": a constant without a type of its own as it @@ -373,6 +377,7 @@ { its address is wanted after all: the procedure is compiled again with the variable in memory; till then, this code is thrown away } x.obj^.reg := 0; + x.obj^.reg2 := 0; demoted := true; x.base := bFrame; x.off := x.obj^.val; @@ -417,10 +422,21 @@ { x, copied to a temporary } procedure CopyToTemp(var x: TItem); -var t: int64; f, g: PObj; +var t: int64; f, g: PObj; a: TAdr; begin if x.vol then MarkAt(x.pos, 'can''t copy through a volatile pointer'); t := AllocTemp(x.typ^.size, x.typ^.align); + if (x.mode = mVar) and (x.base = bReg) then begin + { a slice in registers, which has no address: its words stored } + a := AdrOf(x); + PushVar(a, 8, false, kWord); + PopVar(FrameAdr(t), 8); + a.off := 8; + PushVar(a, 8, false, kWord); + PopVar(FrameAdr(t + 8), 8); + TempItem(x, x.typ, t); + exit; + end; if x.mode = mWords then begin { the second result is on top, so it is popped first } f := x.typ^.fields; g := f^.next; @@ -542,6 +558,7 @@ PopVar(AdrOf(dst), ScalarSize(dst.typ)); end else begin if dst.vol or src.vol then MarkAt(src.pos, 'can''t copy through a volatile pointer'); + if (src.mode = mVar) and (src.base = bReg) then CopyToTemp(src); { a slice in registers } Address(src); if dst.base = bStack then CopyBlock(dst.typ^.size, dst.off) else CopyTo(AdrOf(dst), dst.typ^.size); @@ -1164,7 +1181,7 @@ if x.mode = mWords then exit; { there already } { copied to a temporary unless its two words are in memory at a place that a later argument can't change } - if (x.mode <> mVar) or x.vol or not (x.base in [bFrame, bGlobal, bSlot]) then CopyToTemp(x); + if (x.mode <> mVar) or x.vol or not (x.base in [bFrame, bGlobal, bSlot, bReg]) then CopyToTemp(x); adr := AdrOf(x); if x.typ^.form = fSlice then begin PushVar(adr, 8, false, kWord); diff --git a/src/parse.pas b/src/parse.pas index ae5c2c8..174cbae 100644 --- a/src/parse.pas +++ b/src/parse.pas @@ -1818,12 +1818,12 @@ if o^.reg = VarRegs[i] then VarKind := k + o^.typ^.size * 16 + (i + 1) * 512; end; -{ Whether variable o could live in a register: a single value, not - a real, that isn't C's } +{ Whether variable o could live in registers: a single value, not a + real, or a slice, in two, that isn't C's } function RegFit(o: PObj): boolean; begin RegFit := (o^.cls = oVar) and not o^.ind and not o^.ext - and ((o^.typ^.form in [fInt, fBool, fEnum, fPtr, fProc, fError]) + and ((o^.typ^.form in [fInt, fBool, fEnum, fPtr, fProc, fError, fSlice]) or (o^.typ^.form = fSet) and (o^.typ^.size <= 8)); end; @@ -1840,12 +1840,12 @@ its "begin" to its end, a use counts 1, in a loop 4, in two 16, in three or more 64, and a variable ADR is taken of can't have one. A register costs a save and a restore, so a variable used less than three times keeps its - place in memory. } + place in memory. A slice takes two, its pointer's and its length's. } procedure ChooseRegs(params, before: PObj); var cand: array[0..63] of PObj; weight: array[0..63] of longint; isLoop: array[0..255] of boolean; - n, i, k, d, loops, best: longint; o: PObj; st: TScanState; afterDot, wasSkipping: boolean; + n, i, k, d, loops, best, need: longint; o: PObj; st: TScanState; afterDot, wasSkipping: boolean; function Candidate(name: longint): longint; var j: longint; @@ -1899,15 +1899,24 @@ until (d = 0) or (tok = sEof); RestoreScan(st); skipping := wasSkipping; - { the five heaviest, each used at least three times, take the - registers in turn } - for k := 0 to 4 do begin + { a slice's weight is shared by its two registers } + for i := 0 to n - 1 do + if cand[i]^.typ^.form = fSlice then weight[i] := weight[i] div 2; + { the heaviest, each used at least three times a register, take the + five registers in turn, while there are enough for each } + k := 0; + repeat best := -1; for i := 0 to n - 1 do if (cand[i]^.reg = 0) and (weight[i] >= 3) and ((best < 0) or (weight[i] > weight[best])) then best := i; if best < 0 then break; - cand[best]^.reg := VarRegs[k]; - end; + need := 1 + ord(cand[best]^.typ^.form = fSlice); + if k + need <= 5 then begin + cand[best]^.reg := VarRegs[k]; + if need = 2 then cand[best]^.reg2 := VarRegs[k + 1]; + inc(k, need); + end else weight[best] := 0; { too big for what is left } + until k = 5; end; end; @@ -1919,13 +1928,13 @@ m := 0; o := params; while o <> nil do begin - for k := 0 to 4 do if o^.reg = VarRegs[k] then m := m or (1 shl k); + for k := 0 to 4 do if (o^.reg = VarRegs[k]) or (o^.reg2 = VarRegs[k]) then m := m or (1 shl k); o := o^.next; end; o := FirstLocal(before); while o <> nil do begin if o^.cls = oVar then - for k := 0 to 4 do if o^.reg = VarRegs[k] then m := m or (1 shl k); + for k := 0 to 4 do if (o^.reg = VarRegs[k]) or (o^.reg2 = VarRegs[k]) then m := m or (1 shl k); o := o^.link; end; RegsOf := m; diff --git a/src/sym.pas b/src/sym.pas index f6f61e5..29c01fd 100644 --- a/src/sym.pas +++ b/src/sym.pas @@ -72,7 +72,9 @@ fwd: boolean; { oProc: declared forward, no body yet } isCode: boolean; { oProc: a code procedure } openEnd: boolean; { oProc: has results, and may reach its end } - reg: longint; { oVar: the register it lives in, or 0 if in memory } + reg: longint; { oVar: the register it lives in, or 0 if in memory; + for a slice, the one its pointer is in } + reg2: longint; { oVar: a slice in registers: the one its length is in } ext: boolean; { oProc, oVar: C's, reached through its chunk, which holds its address } fields: PObj; { oCase: its fields } diff --git a/test/check.sh b/test/check.sh index 25bd1bb..2de1f97 100755 --- a/test/check.sh +++ b/test/check.sh @@ -65,7 +65,7 @@ fi } -for f in examples/*.raz test/run/*.raz test/libc/*.raz; do +for f in examples/*.raz test/run/*.raz test/libc/*.raz test/bench/*.raz; do run $(dirname $f) $(basename $f .raz) done diff --git a/test/run/SliceRegs.expect b/test/run/SliceRegs.expect new file mode 100644 index 0000000..adbfa2b --- /dev/null +++ b/test/run/SliceRegs.expect @@ -0,0 +1,6 @@ +21 +4 3 +0 +1003 abcd +41 +27 diff --git a/test/run/SliceRegs.raz b/test/run/SliceRegs.raz new file mode 100644 index 0000000..f54bae4 --- /dev/null +++ b/test/run/SliceRegs.raz @@ -0,0 +1,78 @@ +(* Slices in registers: a slice parameter or variable used enough to + be given its two registers, through every way a slice is used. *) +module SliceRegs; +import Out; + +proc sum(s: []INT): INT; +var i, t: INT; +begin + for i := 0 to LEN(s) - 1 do t := t + s[i]; end; + return t; +end; + +(* s sliced, assigned, passed and returned, all in registers *) +proc tail(s: []INT; n: INT): []INT; +var i: INT; +begin + for i := 1 to n do + if LEN(s) > 0 then s := s[1..LEN(s)]; end; + end; + return s; +end; + +(* two slices compared, copied and assigned to each other *) +proc mix(a, b: []U8): INT; +var i, n: INT; c: []U8; +begin + for i := 0 to LEN(a) - 1 do + if a[i] = b[i] then INC(n); end; + end; + if a = b then INC(n, 100); end; + COPY(b, a); + if a = b then INC(n, 1000); end; + c := a; + for i := 0 to LEN(c) - 1 do INC(n, INT(c[i]) - INT(a[i])); end; + return n; +end; + +proc bump(var s: []INT); +begin + s := s[1..LEN(s)]; +end; + +(* s passed to a var parameter: demoted to memory, and still right *) +proc demote(s: []INT): INT; +var i, t: INT; +begin + for i := 0 to LEN(s) - 1 do t := t + s[i]; end; + bump(s); + for i := 0 to LEN(s) - 1 do t := t + s[i]; end; + return t; +end; + +(* seven slices: some in registers, some not *) +proc many(a, b, c, d, e, f, g: []INT): INT; +var i, t: INT; +begin + for i := 0 to 1 do + t := t + a[i] + b[i] + c[i] + d[i] + e[i] + f[i] + g[i]; + end; + return t; +end; + +proc main*; +var x: [6]INT; i: INT; p, q: [4]U8; s: []INT; +begin + for i := 0 to 5 do x[i] := i + 1; end; + Out.int(sum(x)); Out.ln; + s := tail(x, 2); + Out.int(LEN(s)); Out.char(' '); Out.int(s[0]); Out.ln; + Out.int(LEN(tail(x, 9))); Out.ln; + p := "abcd"; + q := "abxd"; + Out.int(mix(p, q)); Out.char(' '); Out.str(q); Out.ln; + Out.int(demote(x)); Out.ln; + Out.int(many(x, x[1..6], x, x, x, x[2..6], x)); Out.ln; +end; + +end SliceRegs. diff --git a/test/run/SliceRegsCheck.expect b/test/run/SliceRegsCheck.expect new file mode 100644 index 0000000..8351c19 --- /dev/null +++ b/test/run/SliceRegsCheck.expect @@ -0,0 +1 @@ +14 diff --git a/test/run/SliceRegsCheck.raz b/test/run/SliceRegsCheck.raz new file mode 100644 index 0000000..57cc9e6 --- /dev/null +++ b/test/run/SliceRegsCheck.raz @@ -0,0 +1,21 @@ +(* A failed check of an index into a slice in registers says the + length, read from its register. *) +module SliceRegsCheck; +import Out; + +proc squares(s: []INT; n: INT): INT; +var i, t: INT; +begin + for i := 0 to n do t := t + s[i] * s[i]; end; + return t; +end; + +proc main*; +var x: [3]INT; +begin + x := [1, 2, 3]; + Out.int(squares(x, 2)); Out.ln; + Out.int(squares(x, 3)); Out.ln; +end; + +end SliceRegsCheck. diff --git a/test/run/SliceRegsCheck.status b/test/run/SliceRegsCheck.status new file mode 100644 index 0000000..0cfbf08 --- /dev/null +++ b/test/run/SliceRegsCheck.status @@ -0,0 +1 @@ +2 diff --git a/test/run/SliceRegsCheck.stderr b/test/run/SliceRegsCheck.stderr new file mode 100644 index 0000000..230a5df --- /dev/null +++ b/test/run/SliceRegsCheck.stderr @@ -0,0 +1,3 @@ +test/run/SliceRegsCheck.raz:9:35: index 3 is out of range for a length of 3 + in SliceRegsCheck.squares at test/run/SliceRegsCheck.raz:9:35: n = 3, i = 3, t = 14 + in SliceRegsCheck.main at test/run/SliceRegsCheck.raz:18:5