Commit graph

717 commits

Author SHA1 Message Date
Lars Frogner
560171c238
Add Num.[f32,f64,dec]_[to,from]_bits builtins and deprecate Num.[f32,f64]_[to,from]_parts (#7741)
* Add `Num.[f32,f64,dec]_[to,from]_bits` builtins

* Update mono tests

* Deprecate `Num.[f32,f64]_[to,from]_parts`
2025-04-18 10:10:45 +02:00
Norbert Hajagos
fc0a9ec4cf
add with_ascii_uppercased and caseless_ascii_equals to Str 2025-01-23 15:21:11 +01:00
shua
6c29d7aa1f
Merge branch 'main' into fromutf-roc 2025-01-20 19:16:38 +01:00
Norbert Hajagos
8403f1ea19
with_ascii_lowercased zig builtin 2025-01-20 10:58:41 +01:00
Sam Mohr
a292e070d4
Prefer and and or for boolean operators 2025-01-17 16:15:31 -08:00
shua
414fecd14d
add fromUtf16 and 32, as well as lossy variants 2025-01-15 00:17:09 +01:00
Luke Boswell
37cd04c002
Merge branch 'main' into simplify-refcount 2025-01-09 10:18:00 +11:00
Sam Mohr
b56fbd38e1
Progress on updating entire compiler for snake_case 2025-01-05 03:48:03 -08:00
Brendan Hansknecht
7e6b004f36
remove unnecessary function nesting 2025-01-01 13:56:54 -08:00
Brendan Hansknecht
4b8693537a
Simplify Refcounting
Instead of -max_size to -1 for regular refcounts, use 1 to max_size.
0 still means constant refcount.
The highest bit is used to signify atomic refcounting required.
This does not turn on any sort of atomic refcounting.
2025-01-01 11:00:18 -08:00
Brendan Hansknecht
c277d9a6b9
add missing compiler rt function 2024-12-11 18:00:46 -08:00
Brendan Hansknecht
0a573ca557
Merge remote-tracking branch 'origin/main' into upgrade-llvm-zig 2024-12-11 16:38:34 -08:00
Brendan Hansknecht
37c6330c6f
cleanup when expects are run 2024-12-11 15:15:46 -08:00
Brendan Hansknecht
4cf5683ee8
Always generate dbg expressions 2024-12-11 14:55:32 -08:00
Luke Boswell
f6f2830bac
clippy 2024-12-07 20:37:57 +11:00
Ayaz Hafiz
6ddb65d529 Fix pass by reference for compare fn
https://roc.zulipchat.com/#narrow/channel/463736-bugs/topic/LLVM.20IR.20output.20in.20compiler.20crash.20during.20AOC!
2024-12-07 02:02:00 -05:00
Asher Frost
c2d06e3658
Made test pass 2024-12-01 16:03:40 -05:00
Asher Frost
7055253564
Merge branch 'main' into int_overflow 2024-12-01 15:32:39 -05:00
shua
5712e265ae
patch: macos arm64, fix gen-llvm i128 bitcode call 2024-12-01 00:02:49 +01:00
shua
8fd2fbc3a1
gen-dev: complete Num{Mul,Add,Sub}Saturated impls
MulSaturated and AddSaturated are now implemented for u128, i128
SubSaturated is now implemented for Dec even if it's a little strange to
saturate at a decimal value:

```
» Num.subSaturated -170_141_183_460_469_231_731dec 1

-170141183460469231731.687303715884105728 : Dec
```

I decided to rm the `build_num_{mul,add}_saturated` methods because
they don't require any asm-specifics. They either call out to bitcode, or
use the non-saturated version for floats.
2024-11-30 23:01:44 +01:00
Luke Boswell
656a7bcd87
Merge remote-tracking branch 'remote/main' into upgrade-llvm-zig 2024-11-30 10:18:11 +11:00
wizard7377
a81d07f19c
Merge branch 'main' into int_overflow 2024-11-29 15:45:12 -05:00
Richard Feldman
bfbc9ceef0
Merge pull request #7258 from JRI98/remove_unused_typedhole_variant
Remove unused code
2024-11-29 00:19:49 -05:00
wizard7377
7866331f67
Merge branch 'main' into int_overflow 2024-11-28 21:26:38 -05:00
Luke Boswell
b7c226212c
remove stray comment 2024-11-29 10:06:18 +11:00
Luke Boswell
2feb5d3c2e
Merge remote-tracking branch 'remote/main' into upgrade-llvm-zig 2024-11-29 08:58:47 +11:00
JRI98
75f13d3f2e
Remove unused RuntimeErrorFunction variant from roc_mono::ir::Expr 2024-11-28 20:11:56 +00:00
wizard7377
62db49f7d2
Merge branch 'roc-lang:main' into int_overflow 2024-11-28 08:35:17 -05:00
shua
039e5dd3d7
fix gen-llvm 2024-11-27 22:41:56 +01:00
Asher Frost
bddd2a0f57 Fixed casts from integer to integer 2024-11-26 17:32:11 -05:00
shua
a98acff0b9
gen-dev: impl Num.neg for Dec,F32,F64
Dec negation was implemented across gen-dev, gen-llvm, gen-wasm as a call
to the compiled zig function `bitcode::DEC_NEGATE`.

f32 and f64 negation were implemented already for gen-llvm, gen-wasm.

for gen-dev x86_64, float negation is implemented by flipping the sign
bit, which means `xorps` for f32, and `xorpd` for f64

for gen-dev aarch64, there is conveniently a `fneg` instruction
2024-11-23 19:17:55 +01:00
Joshua Warner
9ead801536
Remove expect-fx syntax and handling
This was never fully hooked up in platforms, and the plan is to replace the need for this with doing purity-inference on normal `expect` statements.

On the other hand, fuzzing is finding some bugs caused by having a hyphenated keyword, so this is a great time to go ahead and remove it!
2024-11-17 20:25:37 -08:00
Isaac Van Doren
d99c347998
rename Str.split 2024-11-15 21:12:23 -06:00
Luke Boswell
dc3aa06d61
Merge remote-tracking branch 'remote/main' into upgrade-llvm-zig 2024-11-13 09:02:20 +11:00
Agus Zubiaga
e3c6b756d3
Make sure to drop suffix from symbols exposed to the host 2024-11-07 18:54:23 -03:00
Luke Boswell
915097d792
Merge remote-tracking branch 'remote/main' into upgrade-llvm-zig 2024-10-08 18:21:24 +11:00
Brendan Hansknecht
5b8b781bad
remove single entrypoint 2024-10-07 21:16:30 -07:00
Ayaz
cef2c8ae87
Update build.rs
Signed-off-by: Ayaz <20735482+ayazhafiz@users.noreply.github.com>
2024-09-21 09:50:17 -04:00
Ayaz
9c656dd28e
Merge branch 'main' into ayaz/optimize-list-literal-alloc 2024-09-21 09:44:50 -04:00
Luke Boswell
49dedf0b7b
Merge branch 'main' into ayaz/optimize-list-literal-alloc 2024-09-17 19:44:02 +10:00
Brendan Hansknecht
4e3ec97d7a
generate array of alignment type to enforce tag data alignment 2024-09-16 17:10:49 -07:00
Brendan Hansknecht
a7eae239f0
Avoid explicit tag padding
Explicit padding changes the c-abi when passed to/returned from functions.
This is leading to incorrect loading of types like `Task U64 {}`.
2024-09-16 16:47:20 -07:00
Luke Boswell
99e2bc2038
Merge remote-tracking branch 'remote/main' into upgrade-llvm-zig 2024-09-05 12:11:51 +10:00
Brendan Hansknecht
7997cf95e7
ensure alignment is never 0. Must be at least 1. 2024-08-25 11:48:46 -07:00
Brendan Hansknecht
cf5cd84d60
fix alignment of 16 bytes 2024-08-21 09:04:07 -07:00
Brendan Hansknecht
6b04318e27
handle float types 2024-08-09 19:27:47 -07:00
Brendan Hansknecht
462872551e
fix up list literal constant loading 2024-08-09 19:07:01 -07:00
Ayaz Hafiz
9abbcfaafc
Optimize literal list construction in LLVM backend
Currently, list literals are always heap-allocated and their elements
are stored by emitting a GEP and store for each item in the literal.
This produces huge quantities of IR, causing compile times for e.g.
programs with large literals or ingested files to blow up.

Instead, if a list literal consists entirely of literal values, create a
global section for the literal and return a pointer to it.
2024-08-09 18:51:17 -07:00
Luke Boswell
1750e8b833
remove stray comment 2024-08-05 10:49:07 +10:00
Brendan Hansknecht
93b7056ccc
update stacksave pointer name 2024-08-04 13:00:00 +10:00