Richard Feldman
24ff91b45a
Add a List.first test
2020-04-25 07:52:43 -04:00
Richard Feldman
a0512a5f97
Add some List.len and List.isEmpty tests
2020-04-25 07:05:19 -04:00
Richard Feldman
034f1c916a
Load canonical builtins in gen tests
2020-04-25 07:01:30 -04:00
Richard Feldman
b77b3bda14
Add some List.len and List.isEmpty tests
2020-04-25 07:01:02 -04:00
Richard Feldman
bff89e7e2e
Remove DEFAULT_CALLING_CONVENTION
2020-04-25 06:30:01 -04:00
Richard Feldman
b43e582c7a
Add intrinsics for sqrt and round
2020-04-25 06:30:01 -04:00
Richard Feldman
aac5077c8b
Remove DEFAULT_CALLING_CONVENTION
2020-04-23 17:41:05 -04:00
Richard Feldman
5b7a16afad
Add intrinsics for sqrt and round
2020-04-23 17:41:05 -04:00
Richard Feldman
04ec592eeb
Revert "Thread ret_layout through CallByName"
...
This reverts commit 632d4eca92
.
2020-04-22 08:33:53 -04:00
Richard Feldman
a1b670d2a5
Revert "Extract build_tag"
...
This reverts commit e998a31cf9
.
2020-04-22 08:33:26 -04:00
Richard Feldman
9d37f7ae73
s/IndexOutOfBounds/OutOfBounds/g
2020-04-22 08:32:31 -04:00
Richard Feldman
632d4eca92
Thread ret_layout through CallByName
2020-04-22 08:30:41 -04:00
Richard Feldman
c450a67421
Add some tag code gen tests
2020-04-22 08:30:41 -04:00
Richard Feldman
e998a31cf9
Extract build_tag
2020-04-22 08:30:41 -04:00
Richard Feldman
53ecf6df3e
Drop some unnecessary parens
2020-04-18 15:32:17 -04:00
Richard Feldman
ea713023e8
Add explicit OptLevel to add_passes
2020-04-16 20:26:08 -04:00
Richard Feldman
2a03a74135
Use the equivalent of -O3 in Inkwell
2020-04-16 19:26:25 -04:00
Richard Feldman
1c1fee7e31
Trim trailing space off pretty_assertions dep
2020-04-16 19:24:24 -04:00
Richard Feldman
5980bc38da
Merge remote-tracking branch 'origin/trunk' into order-of-ops
2020-04-15 05:03:42 -04:00
Folkert
97c10e1211
setup for mono reports
2020-04-12 01:56:57 +02:00
Richard Feldman
9288e20469
Upgrade to LLVM 10
2020-04-08 06:41:53 -04:00
Folkert
604dbf7215
Merge remote-tracking branch 'origin/trunk' into precedence-error
2020-04-02 23:29:15 +02:00
Richard Feldman
01f3ae893f
Use include_bytes! to import llvm bitcode
2020-04-01 23:24:00 -04:00
Folkert
106a3646bf
add category to Eq constraint
2020-04-01 20:09:10 +02:00
Folkert
14ad793bd7
hook up TypeError
2020-04-01 16:28:10 +02:00
Richard Feldman
63b38ae174
clippy the original clipper
2020-04-01 00:03:27 -04:00
Richard Feldman
67e68d57b4
cargo fmt
2020-03-31 23:56:31 -04:00
Richard Feldman
cda6a21fa4
Implement Num.toFloat
2020-03-31 23:51:17 -04:00
Richard Feldman
37492f4aa6
Load builtins on startup
2020-03-31 23:50:55 -04:00
Richard Feldman
1609c058f6
Fix tests
2020-03-30 22:31:20 -04:00
Richard Feldman
5f817d8019
Add a basic CLI
2020-03-30 21:27:37 -04:00
Richard Feldman
47f35dde01
First pass at test_emit
2020-03-30 21:27:02 -04:00
Richard Feldman
0a0a736153
Move pass managers into llvm::build
2020-03-30 21:27:02 -04:00
Richard Feldman
d0b2d63511
Drop cranelift deps
2020-03-27 00:45:18 -04:00
Richard Feldman
ebb4963da7
Extract bounds check
2020-03-27 00:18:12 -04:00
Richard Feldman
ceb9cdd452
Revert "Attempt to bitcast structs"
...
This reverts commit a5b50730c33437f459da8705ee186f8f354c2454.
2020-03-27 00:18:12 -04:00
Richard Feldman
ab79e20956
Attempt to bitcast structs
2020-03-27 00:18:12 -04:00
Richard Feldman
e27359a812
Revert "Switch from i1 to i8 for bools"
...
This reverts commit 360d55483daa7eba53d66c7f14f9aec9db841986.
2020-03-27 00:18:12 -04:00
Richard Feldman
0217913dc7
Switch from i1 to i8 for bools
2020-03-27 00:18:12 -04:00
Richard Feldman
23eafd3a75
Reorganize gen tests
2020-03-27 00:18:12 -04:00
Richard Feldman
40be7a582d
Extract eval test helpers
2020-03-27 00:18:12 -04:00
Richard Feldman
8bcc23a9c7
Add some record tests
2020-03-27 00:18:12 -04:00
Richard Feldman
76fd347801
Explicitly set calling convention
2020-03-27 00:18:12 -04:00
Richard Feldman
7bb2a4e3b8
Use usize for pointer size in tests
2020-03-26 23:07:42 -04:00
Folkert
ad23fc7e4b
Merge remote-tracking branch 'origin/trunk' into tail-calls
2020-03-26 14:57:28 +01:00
Folkert
fc905b505c
codegen for letrec
2020-03-26 14:53:38 +01:00
Folkert
1108e56750
add Bool.not
2020-03-26 14:48:11 +01:00
Folkert
08403b0a1f
enable tail-call elimination in llvm
2020-03-26 14:02:53 +01:00
Richard Feldman
a561f343b2
Remove Cranelift for now.
2020-03-25 20:19:58 -04:00
Richard Feldman
a07acd875f
Fix test compilation error
2020-03-25 20:07:10 -04:00
Richard Feldman
8390bd966a
Revert "Try using special struct return values"
...
This reverts commit 0628c104513d1cae44859c1d804177c4a1e33c95.
2020-03-25 19:47:28 -04:00
Richard Feldman
fcd917c9fe
Re-disable cranelift test_gen tests for now
2020-03-25 19:47:28 -04:00
Richard Feldman
2491b2e43b
Restore some more things to how they were before
2020-03-25 19:47:28 -04:00
Richard Feldman
0951f8048e
Try using special struct return values
2020-03-25 19:47:28 -04:00
Richard Feldman
aae69e8b55
Try having main return multiple values
2020-03-25 19:47:28 -04:00
Richard Feldman
72742f3e4c
Restore some things to how they were before
2020-03-25 19:47:28 -04:00
Richard Feldman
f27f324c4c
Make clone_list more robust in crane build
2020-03-25 19:47:28 -04:00
Richard Feldman
5d28ae5fa6
Let us never speak of this again.
2020-03-25 19:47:28 -04:00
Richard Feldman
bb26692983
Fix load_list_ptr
2020-03-25 19:47:28 -04:00
Richard Feldman
8b881d90d9
Enable cranelift on all test_gen tests
2020-03-25 19:47:28 -04:00
Richard Feldman
3672900aaa
Update a comment
2020-03-25 19:47:28 -04:00
Richard Feldman
97ff5620ab
Clean up some cranelift stuff
2020-03-25 19:47:28 -04:00
Richard Feldman
aa1cbab373
Fix phi node bug
2020-03-25 19:47:28 -04:00
Richard Feldman
2c27e459b0
Inline list_set comparison
2020-03-25 19:47:28 -04:00
Richard Feldman
c560b7a6c5
Share code on LLVM List.set
2020-03-25 19:47:28 -04:00
Richard Feldman
56f4d553e5
More progress on List.set in Cranelift
2020-03-25 19:47:28 -04:00
Richard Feldman
41b39c0629
Add more llvm verification
2020-03-25 19:46:11 -04:00
Richard Feldman
bf129a7299
Progress on List.set in Cranelift
2020-03-25 19:46:11 -04:00
Folkert
579d0d9eff
fix booleans in crane
2020-03-24 15:59:11 +01:00
Folkert
958f3f9ad4
change pattern destructuring stores
...
they are now tracked in the Cond/Switch variants, rather than merged into the branch constructors. Required for 'beans'
2020-03-23 23:35:45 +01:00
Folkert
2bb69f333f
always Cond on a symbol
...
this will make 'beans' easier
2020-03-23 20:00:15 +01:00
Folkert
baeb8ad96a
test unit type patterns
2020-03-23 17:55:02 +01:00
Folkert
b9613fcdc5
clean up tag pattern match conversion
2020-03-23 17:55:02 +01:00
Folkert
46062439b5
remove label from Struct layout
2020-03-23 17:55:02 +01:00
Folkert
e2a7c970bc
refactor Access into AccessAtIndex
2020-03-23 17:55:02 +01:00
Richard Feldman
ee12e56d1c
Fix set_shared_list_oob test
2020-03-22 11:34:36 -04:00
Richard Feldman
db502fe2e7
Revise some tests
2020-03-21 22:51:11 -04:00
Richard Feldman
39249f3905
Add test for List.set bounds checking
2020-03-21 22:14:02 -04:00
Richard Feldman
52bfe3ce9e
Add bounds checking to List.setInPlace
2020-03-21 22:12:51 -04:00
Richard Feldman
3e71b5a38d
Extract bounds_check_comparison
2020-03-21 22:11:06 -04:00
Richard Feldman
a0dd31ee51
Add bounds checking for List.set in LLVM
2020-03-21 21:19:18 -04:00
Richard Feldman
63a8daa4c7
Reproduce no bounds checking on List.set in LLVM
2020-03-21 21:19:18 -04:00
Richard Feldman
d9fe38efce
Remove unnecessary lifetime annotations
2020-03-21 21:19:18 -04:00
Richard Feldman
d0a1adfef9
Fix set_shared_int_list for LLVM
2020-03-21 21:19:18 -04:00
Richard Feldman
8a26cac3f2
Add a test of just List.set by itself
2020-03-21 21:19:18 -04:00
Richard Feldman
facdc1e2f4
Revise some tests a bit
2020-03-21 21:19:18 -04:00
Richard Feldman
cc8683d241
Fix use of GEP (was using byte offset, not index)
2020-03-21 21:19:18 -04:00
Richard Feldman
4182e51877
Fix set_shared_int_list test
2020-03-21 21:19:18 -04:00
Richard Feldman
e6704d1fcb
Streamline empty list LLVM code gen
2020-03-21 21:19:18 -04:00
Richard Feldman
d2e7e373e6
Remove unused lifetimes
2020-03-21 21:19:18 -04:00
Richard Feldman
a286dec4cc
Reorganize some things
2020-03-21 21:19:18 -04:00
Richard Feldman
f86c3f1e7e
Avoid some redundant stores/loads
2020-03-21 21:19:18 -04:00
Richard Feldman
5b902b5a49
Use ptr_int over hardcoded i64
2020-03-21 21:19:18 -04:00
Richard Feldman
f2419bb9f8
Use struct_type.get_undef()
2020-03-21 21:19:18 -04:00
Richard Feldman
fc036453d9
Have List.set in LLVM clone before mutating
2020-03-21 21:19:18 -04:00
Richard Feldman
48954eb52b
Update to Inkwell version with memcpy
2020-03-21 21:19:18 -04:00
Folkert
9a0234e5dd
make bound variables available in guards
2020-03-22 01:11:19 +01:00
Folkert
1f3b8f7d68
guard exhaustiveness
2020-03-21 23:33:37 +01:00
Folkert
a16d48a6a9
code gen for simple guards
...
Guards cannot use variables bound in the pattern yet
2020-03-21 22:27:36 +01:00
Folkert
655dc32098
support nested pattern matches on tag unions
2020-03-20 22:14:38 +01:00
Folkert
0f22cbbf7d
fix incorrect layout for Switch
2020-03-20 19:56:50 +01:00
Folkert
d0da300042
fix equality/hash issue
...
lead to tests not being merged/shared
2020-03-20 16:23:56 +01:00
Folkert
e062404a63
support more complex nested patterns
2020-03-20 14:27:07 +01:00
Folkert
fbadd9d620
add pointer Layout
2020-03-20 11:53:21 +01:00
Folkert
e4566b9757
clean up comment
2020-03-20 11:47:22 +01:00
Richard Feldman
b33af811d0
Merge branch 'trunk' into unit-types
2020-03-19 22:05:22 -04:00
Folkert
14979ceb41
Merge remote-tracking branch 'origin/trunk' into unit-types
2020-03-20 01:02:13 +01:00
Folkert
f44fea42bb
Boolean and/or in cranelift
2020-03-20 00:59:26 +01:00
Folkert
e6bee2656d
add Bool.and for llvm
2020-03-19 23:18:44 +01:00
Folkert
82655556ab
exhaustiveness for record guards
2020-03-19 22:34:08 +01:00
Folkert
5fc96c09ee
Add record patterns
2020-03-19 17:08:29 +01:00
Folkert
9745d86efb
add tests
2020-03-19 14:59:05 +01:00
Folkert
006b1f8696
Switch on floats in llvm
2020-03-19 14:58:28 +01:00
Folkert
9b81a94786
Switch on floats in crane
2020-03-19 14:43:58 +01:00
Folkert
6b7b393d32
Switch on tags in crane
2020-03-19 14:39:04 +01:00
Folkert
0075e3fb04
attempt at float switches
...
needs something more , will circle back later
2020-03-19 14:25:37 +01:00
Folkert
f30655a103
Switch on tags in llvm
2020-03-19 14:18:54 +01:00
Folkert
0593a39e0f
uncomment test
2020-03-19 12:35:11 +01:00
Folkert
20dc928bfe
fix test on maybe
...
used elm syntax instead of roc
2020-03-19 12:32:48 +01:00
Folkert
c31116af87
preparation for recursive tag unions
2020-03-19 12:20:12 +01:00
Folkert
9d1e2a0ef1
support zero-sized values (empty record, unit type)
...
They now use no stack space
2020-03-19 11:31:06 +01:00
Dan Bruder
2c630fd014
Use sorted fields from struct layout as well as layout.stack_size in crane and llvm access
2020-03-19 05:59:29 -04:00
Dan Bruder
59bcda21f5
tests pass for crane f64
2020-03-19 05:46:11 -04:00
Richard Feldman
04f8b93a9b
the clippiest of clips
2020-03-18 21:31:01 -04:00
Richard Feldman
8f51b2d429
Don't hardcode elem_bytes in llvm
2020-03-18 21:31:01 -04:00
Richard Feldman
0a045ccec8
Don't hardcode List slots in Cranelift
2020-03-18 21:31:01 -04:00
Richard Feldman
43c4fadd6e
Use usize length, no capacity for llvm List
2020-03-18 21:31:01 -04:00
Richard Feldman
59368caa0c
Revert various attempts to use target_data
2020-03-18 21:26:51 -04:00
Richard Feldman
c425490317
Another failed attempt to use target_data
2020-03-18 21:26:51 -04:00
Richard Feldman
6e977d96fc
Failed attempt to use target_data
2020-03-18 21:26:51 -04:00
Richard Feldman
eed9fb0e69
Have Env store TargetData instead of pointer_bytes
2020-03-18 21:26:51 -04:00
Folkert
b93fe4e341
make arbitrary AccessAtIndex work
...
it now uses that actual layout, not a hardcoded one
2020-03-19 00:25:16 +01:00
Folkert
f3f135eca5
make Layout Hash
2020-03-18 23:26:17 +01:00
Folkert
0996f264e7
simplify Byte layout
2020-03-18 22:22:32 +01:00
Folkert
c11f374eb0
simplify Bool layout
2020-03-18 22:15:03 +01:00
Folkert
f906c9b4b4
uncomment cranelift tests
2020-03-18 21:39:39 +01:00
Folkert
99db336033
Working pattern match on Result Int Int
2020-03-18 21:35:10 +01:00
Folkert
53bd47221c
WIP things seem to work in theory
2020-03-18 16:44:53 +01:00
Folkert
845e30658e
WIP
2020-03-18 02:20:21 +01:00
Folkert
165c5d8363
load/store all tags in llvm
2020-03-17 22:04:11 +01:00
Folkert
6253d2d1af
pattern match on single-tag tag unions
...
in LLVM and crane
2020-03-17 19:44:59 +01:00
Folkert
ba69987c1a
llvm one element tag store
2020-03-17 15:29:40 +01:00
Folkert
9d756a3b2c
generate unpacked tags in Crane
2020-03-17 15:26:21 +01:00
Folkert
c3d550116b
make patterns store their bound variables
2020-03-17 14:04:26 +01:00
Folkert
6310341b7e
Merge remote-tracking branch 'origin/trunk' into pattern-compilation
2020-03-17 12:49:30 +01:00
Richard Feldman
9d950389f5
Implement list cloning and List.set in Cranelift
2020-03-17 00:45:07 -04:00
Richard Feldman
c0d0675919
Clean up some comments and names
2020-03-17 00:44:35 -04:00
Richard Feldman
97d084e224
Reproduce List.set on a shared list failing
2020-03-16 21:55:38 -04:00
Richard Feldman
f9e013793c
Drop unused mono::Expr::Pointer
2020-03-16 21:47:08 -04:00
Folkert
c20f777dba
comment tests that fail for llvm
2020-03-17 00:36:58 +01:00
Folkert
444e3063e0
reserve tag union as array of bytes in llvm
2020-03-17 00:36:58 +01:00
Folkert
6ff22de9dd
store/define tags in llvm
2020-03-17 00:36:58 +01:00
Folkert
72ca6d675c
further tag support in Cranelift
2020-03-17 00:36:58 +01:00
Folkert
74ec3682a2
add tests
2020-03-17 00:36:58 +01:00
Folkert
c9a90c32e3
prepare for Tag code gen
2020-03-17 00:36:58 +01:00
Folkert
e742b77e0b
parity with old implementation
2020-03-17 00:36:58 +01:00
Folkert
d875f8bfce
implement layout for Tag
2020-03-17 00:36:58 +01:00
Richard Feldman
505e69f956
Remove a stray space missed by cargo fmt
2020-03-15 15:25:54 -04:00
Richard Feldman
6cd8afd5d6
Fix using structs with records
2020-03-15 15:13:52 -04:00
Richard Feldman
d546f4340d
Improve an error message
2020-03-15 14:31:13 -04:00
Richard Feldman
010e390fd6
Make using records in defs work
2020-03-15 14:31:01 -04:00
Folkert
cdf05bc425
remove (now unneeded!) default case
2020-03-15 14:42:57 +01:00
Folkert
5926ac2f01
stub out Tag layout
2020-03-15 14:42:57 +01:00
Richard Feldman
5c3c30ed09
Fix List.get and List.set
2020-03-14 21:17:09 -04:00
Richard Feldman
a54db8bf92
Merge remote-tracking branch 'origin/trunk' into array-wrappers
2020-03-14 20:49:59 -04:00
Richard Feldman
5bf82fa42c
Fix Cranelift gen of nonempty lists
2020-03-14 20:44:39 -04:00
Richard Feldman
5beb65880c
Fix List.len
2020-03-14 20:12:27 -04:00
Richard Feldman
e01db9b284
wip empty list
2020-03-13 23:33:32 -04:00
Richard Feldman
de25dc0484
Re-enable empty list test
2020-03-13 22:41:46 -04:00
Richard Feldman
8d4331f903
Merge remote-tracking branch 'origin/trunk' into array-wrappers
2020-03-13 22:20:35 -04:00
Richard Feldman
4c19dd86ff
First pass at some List implementation stuff
2020-03-13 22:15:26 -04:00
Richard Feldman
80722b872a
Update List.set to use wrapper
2020-03-13 22:15:02 -04:00
Richard Feldman
6f64bb2f9b
Update List.getUnsafe to use wrapper
2020-03-13 22:15:02 -04:00
Folkert
1a8f380033
Merge remote-tracking branch 'origin/trunk' into mono-if
2020-03-14 01:00:25 +01:00
Folkert
1570e9b96e
make mono patterns nicer
2020-03-14 00:10:11 +01:00
Folkert
c4c40ec878
fix cond generation
...
With Enum patterns (u8 in size), the size of the condition and the branches could disagree. (the branches would be i64).
we now cast the branches to the smaller integer type based on the layout
2020-03-14 00:07:32 +01:00
Folkert
05a3e8c3d8
equality for Byte and Bool
2020-03-13 17:01:18 +01:00
Folkert
242679b841
fix clippy complaints
2020-03-13 16:14:37 +01:00
Folkert
97f1548a24
add tests
2020-03-13 15:16:27 +01:00
Folkert
6651180283
implement Bool in llvm
2020-03-13 15:13:43 +01:00
Dan Bruder
c16d5cb3f1
struct creation and access in llvm
2020-03-13 10:13:32 -04:00
Dan Bruder
eea25429b6
uncomment llvm tests for basic_record
2020-03-13 09:16:04 -04:00
Dan Bruder
099145e4b4
Merge branch 'trunk' into access-record-fields
2020-03-13 09:07:41 -04:00
Folkert
a7af366c3a
new code gen for Cond
2020-03-13 13:06:56 +01:00
Dan Bruder
bfd9150af4
access record fields progress
2020-03-12 10:37:07 -04:00
Richard Feldman
f74471012c
Improve an error message
2020-03-12 00:53:24 -04:00
Richard Feldman
173ba925ff
Formatting
2020-03-12 00:39:28 -04:00
Richard Feldman
db362f6df0
Reproduce named identity function bug
2020-03-12 00:31:53 -04:00
Richard Feldman
cf5e3f92a5
Have mono::Env store &mut Subs
2020-03-11 21:36:27 -04:00
Richard Feldman
df78068e81
Implement int and float subtraction
2020-03-11 21:10:41 -04:00
Richard Feldman
9fcfa90bff
Change capitalization
2020-03-11 21:06:08 -04:00
Richard Feldman
21e4eb505a
Implement and test Float.#add
2020-03-11 20:53:35 -04:00
Richard Feldman
523282e7bc
Implement Int.#add
2020-03-11 20:53:32 -04:00
Richard Feldman
649575fab8
Improve some error messages
2020-03-11 19:48:19 -04:00
Folkert
bb9c9d423a
make Procs a struct
2020-03-12 00:40:10 +01:00
Folkert
2d0649fa66
attempt fix for gen tests
2020-03-11 23:13:32 +01:00
Folkert
657901d760
bubble up pointer_size
2020-03-10 15:16:44 +01:00
Richard Feldman
8da2bebcde
Remove some dbg! statements
2020-03-10 02:56:56 -04:00
Richard Feldman
28b50c00c0
Clean up some comments
2020-03-10 02:56:56 -04:00
Richard Feldman
21d6d1cbd9
Disable empty_list_len for now
2020-03-10 02:56:56 -04:00
Richard Feldman
913f18226b
Got LLVM structs working
2020-03-10 02:56:56 -04:00
Richard Feldman
8da7f26237
Try a different Struct approach
2020-03-10 02:56:56 -04:00
Richard Feldman
8450597a07
Try an alloca approach for structs
2020-03-10 02:56:55 -04:00
Richard Feldman
f556f195d3
Handle more mono::Expr cases
2020-03-10 02:25:40 -04:00
Folkert
5237408b15
do what clippy wants
2020-03-09 23:51:48 +01:00
Richard Feldman
6ae1ee373e
Use a tag on rtfeldman/inkwell
2020-03-08 17:51:13 -04:00
Mario Rogic
a5c2844f54
Float.div implemented, Int.div WIP-ish
2020-03-08 18:32:48 +00:00
Richard Feldman
17e9f0b8c3
Error early on a type mismatch in test_gen
2020-03-08 12:13:59 -04:00
Mario Rogic
c502aee10e
Add test for potential multiplication and division order of ops ambiguity
2020-03-08 13:58:18 +00:00
Richard Feldman
be4abcf173
Fix List.set tests
2020-03-08 01:20:43 -05:00
Richard Feldman
74e92f35f1
Disable List.set tests for now
2020-03-08 00:33:13 -05:00
Richard Feldman
72ecb231f1
clip clop clip clop clippy
2020-03-07 23:11:42 -05:00
Richard Feldman
abe9b8efaa
Use Layout over Variable for both build modules
2020-03-07 23:04:28 -05:00
Richard Feldman
db4ef45708
Upgrade to List.set_in_place when appropriate
2020-03-07 12:43:24 -05:00
Richard Feldman
0f79a3311d
Upgrade bumpalo to 3.2
2020-03-07 11:20:35 -05:00
Richard Feldman
df4533296b
fix some tests
2020-03-06 18:24:37 -05:00
Richard Feldman
363a7a0abd
Mov gen to its own crate
2020-03-06 18:24:37 -05:00