mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 03:30:27 +02:00
Rework backend-specific CPS lowering
* module/system/base/target.scm (target-runtime): New export. * module/language/cps/optimize.scm (make-cps-lowerer): Load a backend-specific lowering module dynamically. * module/language/cps/guile-vm.scm: New module for lowering to Guile's VM. * module/language/cps/guile-vm/loop-instrumentation.scm: * module/language/cps/guile-vm/lower-primcalls.scm: * module/language/cps/guile-vm/reify-primitives.scm: Move here, from parent dir. * module/language/cps/hoot.scm: New module for lowering to Wasm/GC via Hoot. * module/language/cps/guile-vm/tailify.scm: * module/language/cps/guile-vm/unify-returns.scm: Move here, from parent dir. * am/bootstrap.am: Update for new file list.
This commit is contained in:
parent
d66c1c67a0
commit
d99d03039d
10 changed files with 151 additions and 51 deletions
|
@ -26,6 +26,8 @@
|
|||
|
||||
target-cpu target-vendor target-os
|
||||
|
||||
target-runtime
|
||||
|
||||
target-endianness target-word-size
|
||||
|
||||
target-max-size-t
|
||||
|
@ -159,6 +161,15 @@
|
|||
"Return the vendor name of the target platform."
|
||||
(triplet-vendor (target-type)))
|
||||
|
||||
(define (target-runtime)
|
||||
"Determine what kind of virtual machine we are targetting. Usually this
|
||||
is @code{guile-vm} when generating bytecode for Guile's virtual machine,
|
||||
but it can be @code{hoot} when targetting WebAssembly."
|
||||
(if (and (member (target-cpu) '("wasm32" "wasm64"))
|
||||
(equal? (target-os) "hoot"))
|
||||
'hoot
|
||||
'guile-vm))
|
||||
|
||||
(define (target-os)
|
||||
"Return the operating system name of the target platform."
|
||||
(triplet-os (target-type)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue