mirror of
https://github.com/janet-lang/janet
synced 2024-11-05 16:26:17 +00:00
19 lines
335 B
Plaintext
19 lines
335 B
Plaintext
|
(def ir-asm
|
||
|
@{:instructions
|
||
|
'(
|
||
|
# Types
|
||
|
(type-prim Double f64)
|
||
|
(type-array BigVec Double 100)
|
||
|
|
||
|
# Declarations
|
||
|
(bind 0 BigVec)
|
||
|
(bind 1 BigVec)
|
||
|
(bind 2 BigVec)
|
||
|
(add 2 0 1)
|
||
|
(return 2))
|
||
|
:parameter-count 2
|
||
|
:link-name "add_vector"})
|
||
|
|
||
|
(def as (sysir/asm ir-asm))
|
||
|
(print (sysir/to-c as))
|