• Joined on 2021-03-29
ychenfo commented on pull request M-Labs/nac3#160 2022-01-08 06:37:51 +08:00
Introduce IRRT and implement power operator (#50)

I'm not really sure if that's possible... there's also the issue of loss of precision with floats and int64. A float64 has only 52 bits of mantissa and large int64 results will be imprecise and…

ychenfo pushed to power_operator at M-Labs/nac3 2022-01-08 06:30:25 +08:00
9586910bec nac3core: introduce ir runtime for implementing power operator and better range length calculation
ychenfo commented on pull request M-Labs/nac3#160 2022-01-07 15:16:13 +08:00
Introduce IRRT and implement power operator (#50)

and why can't we use the intrinsic? is it removed in newer versions?

Yes another way is to use the double**int -> double llvm intrinsic (llvm does not provide int**int -> int intrinsic..).…

ychenfo commented on pull request M-Labs/nac3#140 2022-01-07 14:26:18 +08:00
List Slice Support (#72)

I think it should be faster, both __builtin_memmove and __builtin_memcpy are translated into llvm intrinsics, and llvm intrinsics for memmove allows overlap while memcpy does not allow. So…

ychenfo commented on pull request M-Labs/nac3#160 2022-01-07 14:19:49 +08:00
Introduce IRRT and implement power operator (#50)

Does it play nice with constant propagation/folding? A common situation is shifting bits by multiplying by a power of 2, and this absolutely has to be folded. The code in the legacy compiler uses…

ychenfo created pull request M-Labs/nac3#160 2022-01-07 06:04:54 +08:00
WIP: implement power operator (#50)
ychenfo pushed to power_operator at M-Labs/nac3 2022-01-07 05:33:38 +08:00
78c0561b02 nac3core: implement power operator
ychenfo created branch power_operator in M-Labs/nac3 2022-01-07 05:33:37 +08:00
ychenfo pushed to list_slice at M-Labs/nac3 2022-01-07 05:26:25 +08:00
5edec788b2 nac3core: move irrt related code to codegen module
b4117be61d nac3core: remove slice assign fast path in codegen
7c8dc9ca06 nac3core: fix list assign update length
Compare 3 commits »
ychenfo pushed to list_slice at M-Labs/nac3 2022-01-07 02:46:42 +08:00
a227d99516 nac3core: move irrt related code to codegen module
ychenfo commented on pull request M-Labs/nac3#140 2022-01-07 02:39:31 +08:00
List Slice Support (#72)

I tentatively move all the ir runtime library related code to nac3core/codegem/nac3irrt, hopefully this will be better

ychenfo pushed to list_slice at M-Labs/nac3 2022-01-07 02:37:24 +08:00
8e16ecab5f nac3core: move irrt related code to codegen module
1c005b6a60 nac3core: remove slice assign fast path in codegen
58f2d50cab nac3core: fix list assign update length
cd9afc3d31 nac3core: more concise
Compare 4 commits »
ychenfo pushed to list_slice at M-Labs/nac3 2022-01-07 02:33:17 +08:00
0b1c3df091 nac3core: move irrt related code to codegen module
ychenfo commented on pull request M-Labs/nac3#140 2022-01-06 22:03:34 +08:00
List Slice Support (#72)

So is it ok to use some patch like the below so that we can call the unwrapped clang without calling clang-13 to output wasm32 llvm bitcode here?

diff --git a/flake.nix…
ychenfo commented on pull request M-Labs/nac3#140 2022-01-06 21:44:11 +08:00
List Slice Support (#72)

handled in the new commits

ychenfo commented on pull request M-Labs/nac3#140 2022-01-06 21:43:39 +08:00
List Slice Support (#72)

changed to memcpy in the new commit

ychenfo commented on pull request M-Labs/nac3#140 2022-01-06 21:42:29 +08:00
List Slice Support (#72)

Removed in the new commits. Indeed this fast path only optimize the a small amount of common cases (even not things like a[:], b[:] = c[:], d[:] due to the assignment unpacking).

ychenfo pushed to list_slice at M-Labs/nac3 2022-01-06 21:36:13 +08:00
94216fb1ab nac3core: remove slice assign fast path in codegen
ae68c4a1ac nac3core: fix list assign update length
615aec5a1d nac3core: more concise
Compare 3 commits »
ychenfo commented on pull request M-Labs/nac3#140 2022-01-06 19:31:22 +08:00
List Slice Support (#72)

Ah thanks I see, then I think I also need to change the code to modify the list length in the rust side.

ychenfo commented on pull request M-Labs/nac3#140 2022-01-06 19:21:18 +08:00
List Slice Support (#72)

In c I seem to also failed to find a way to call stacksave and stackrestore manually... But here I think this should be fine since this temp array will be freed when exiting this slice assignment…