raz / commit 06d8b4bf

commit
06d8b4bf0926b300b29f2e8f656623c30c2f9cb5
author
Luis <42945842+ldiaz94@users.noreply.github.com>
date
parent
7176b227
Report 2026-10.18: slices in code procedures

A code procedure may take slices, each two of the six integer registers (address, then length), and return one in rax and rdx, as System V passes a struct of two integers.

By the owner's word.

patch · log

1 file changed, +9 -3

doc/raz.md (history) modified +9 -3

@@ -9,7 +9,7 @@
99 This report defines the language. It is short on purpose. Whatever it
1010 doesn't allow, raz doesn't have.
1111
12-This is version 2026-10.17 of the report; section 12 says what each
12+This is version 2026-10.18 of the report; section 12 says what each
1313 version changed. 2026-10.11 and 2026-10.12 are a thaw the owner chose,
1414 for a language anyone can build again. They break programs written
1515 for 2026-10.10 and before: for 2026-10.9, say, the report of compiler
@@ -1068,8 +1068,12 @@
10681068 and pointer arguments arrive in `rdi`, `rsi`, `rdx`, `rcx`, `r8` and
10691069 `r9`, `F32` and `F64` ones in `xmm0` to `xmm7`, and the result goes in
10701070 `rax` (and `rdx` for a second) or `xmm0`. Its parameters and results
1071-are therefore of the types C can take (section 9), at most six integer
1072-and eight real parameters, and at most two results. The instructions
1071+are therefore of the types C can take (section 9), or slices, at most
1072+six integer and eight real parameters, and at most two results. A
1073+slice is two integers, as System V passes a struct of them: as a
1074+parameter its address arrives in one register and its length in the
1075+next, the two counting among the six; as the result its address goes
1076+in `rax` and its length in `rdx`, and it is the only result. The instructions
10731077 are the whole procedure, `ret` included; they must keep `rbx`, `rbp`,
10741078 `rsp` and `r12` to `r15` as they found them. The compiler doesn't look
10751079 past what they say.
@@ -1925,6 +1929,8 @@
19251929 `copy` (section 11).
19261930 - **2026-10.17.** `COPY` copies the elements of one array or slice to
19271931 another as a block (section 6.8).
1932+- **2026-10.18.** A code procedure takes and returns slices (section
1933+ 8).
19281934
19291935 ## Appendix A. What an implementation chooses
19301936