diff options
| author | Rose Hogenson <rhogenson@google.com> | 2022-07-12 22:55:48 -0700 |
|---|---|---|
| committer | Rose Hogenson <rhogenson@google.com> | 2022-07-12 22:55:48 -0700 |
| commit | d18813441649665f42b524443c65d0b6bb4ac59a (patch) | |
| tree | 434659955a2f1a0d18c4c02e6bbf5d31d980ae27 /csc/ir1.csc | |
| parent | Slightly improve diff formatting. (diff) | |
| download | chromatopelma-d18813441649665f42b524443c65d0b6bb4ac59a.tar.zst | |
Add builtin operations to IR1.
Diffstat (limited to 'csc/ir1.csc')
| -rw-r--r-- | csc/ir1.csc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/csc/ir1.csc b/csc/ir1.csc index 942f8f9..484b38f 100644 --- a/csc/ir1.csc +++ b/csc/ir1.csc @@ -1,6 +1,7 @@ (define-library (csc ir1) (export %call + %call-builtin %constant %define-syntax %if @@ -12,6 +13,9 @@ %library-ref %sequence call-arguments + call-builtin-arguments + call-builtin-operation + call-builtin? call-procedure call? constant-expression @@ -46,6 +50,7 @@ library-ref-name library-ref? make-call + make-call-builtin make-constant make-define-syntax make-if @@ -157,6 +162,20 @@ (arguments call-arguments)) + ; <call-builtin> operation arguments + ; Executes the given builtin operation on the arguments. The known builtin + ; operations are listed below. Each operation can return a value, or not. + ; - alloc: size -> result + ; - peek: pointer * offset -> result + ; - poke: word * pointer * offset -> () + (define-match-record-type <call-builtin> + (make-call-builtin operation arguments) + call-builtin? + %call-builtin + (operation call-builtin-operation) + (arguments call-builtin-arguments)) + + ; <sequence> head tail ; Evaluate head, ignoring any result. Then tail is evaluated. (define-match-record-type <sequence> |
