From d18813441649665f42b524443c65d0b6bb4ac59a Mon Sep 17 00:00:00 2001 From: Rose Hogenson Date: Tue, 12 Jul 2022 22:55:48 -0700 Subject: Add builtin operations to IR1. --- csc/ir1.csc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'csc/ir1.csc') 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)) + ; 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 + (make-call-builtin operation arguments) + call-builtin? + %call-builtin + (operation call-builtin-operation) + (arguments call-builtin-arguments)) + + ; head tail ; Evaluate head, ignoring any result. Then tail is evaluated. (define-match-record-type -- cgit v1.3.1