1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-18 14:44:48 +00:00
janet/examples/sysir/arrays2.janet
Calvin Rose 3a782d27b1 Allow for multiple functions in a sysir "context".
Allows for in memory linking.
2023-10-22 16:05:38 -05:00

20 lines
366 B
Plaintext

(def ir-asm
'((link-name "add_vectorp")
(parameter-count 2)
# Types
(type-prim Double f64)
(type-array BigVec Double 100)
(type-pointer BigVecP BigVec)
# Declarations
(bind 0 BigVecP)
(bind 1 BigVecP)
(bind 2 BigVecP)
(add 2 0 1)
(return 2)))
(def ctx (sysir/context))
(sysir/asm ctx ir-asm)
(print (sysir/to-c ctx))