forked from M-Labs/nac3
1
0
Fork 0
Commit Graph

1166 Commits

Author SHA1 Message Date
David Mak 7a5a2db842 core: Fix handling of float-to-int32 casts
Out-of-bound conversions should be wrapped around.
2023-11-03 16:24:26 +08:00
David Mak 447eb9c387 standalone: Fix output format string for output_uint* 2023-11-03 16:24:26 +08:00
David Mak 92d6f0a5d3 core: Implement bitwise not for unsigned ints and fix implementation 2023-11-03 16:24:26 +08:00
David Mak 7e4dab15ae standalone: Add math tests for non-number arguments 2023-11-01 18:03:29 +08:00
David Mak ff1fed112c core: Rework gamma/gammaln to match SciPy behavior
Matches behavior for infinities and NaNs.
2023-11-01 18:03:29 +08:00
David Mak 36a6a7b8cd core: Replace TopLevelDef comments with documentation 2023-11-01 18:03:29 +08:00
David Mak 2b635a0b97 core: Implement numpy and scipy functions 2023-11-01 18:03:29 +08:00
David Mak 60ad100fbb core: Implement and expose {isinf,isnan} 2023-11-01 18:03:29 +08:00
David Mak 316f0824d8 flake: Add scipy 2023-11-01 18:03:29 +08:00
David Mak 7cf7634985 core: Add create_fn_by_* functions
Used for abstracting the creation of function from different sources.
2023-11-01 18:03:29 +08:00
David Mak 068f0d9faf core: Do not cast floor/ceil result to int
NumPy explicitly states that the return type of the floor/ceil is float.
2023-11-01 18:03:29 +08:00
David Mak 95810d4229 core: Remove {ceil64,floor64,round,round64}
These are not present in NumPy or Artiq.
2023-11-01 18:03:29 +08:00
David Mak 630897b779 standalone: Do not output sign if float is NaN
Matches behavior in Python.
2023-11-01 18:03:29 +08:00
Sebastien Bourdeauducq e546535df0 flake: update nixpkgs 2023-11-01 15:53:47 +08:00
David Mak 352f70b885 artiq: Update host exception list to match possibly thrown types 2023-11-01 13:28:48 +08:00
David Mak e95586f61e core: Fix IR generation of `for` loop containing break/continue
Fix cases where the body BB would have two terminators because of a
preceding continue/break statement already emitting a terminator.
2023-11-01 13:21:27 +08:00
David Mak bb27e3d400 standalone: Fix indentation of demo.c 2023-11-01 13:20:26 +08:00
David Mak bb5147521f standalone: Fix indentation of test files 2023-11-01 13:20:26 +08:00
David Mak 9518d3fe14 artiq: Fix timeline not resetting upon exiting sequential block 2023-10-30 14:04:53 +08:00
David Mak cbd333ab10 artiq: Extract `parallel` block timeline utilities 2023-10-30 14:04:53 +08:00
David Mak 65d6104d00 artiq: Improve IR value naming and add documentation 2023-10-30 14:04:53 +08:00
David Mak 8373a6cb0f artiq: Use gen_block when generating "with sequential" 2023-10-30 14:04:53 +08:00
David Mak f75ae78677 cargo: Update dependencies 2023-10-30 14:04:53 +08:00
Sebastien Bourdeauducq ea2ab0ef7c update nixpkgs, python 3.11 2023-10-25 21:09:22 +08:00
David Mak e49b760e34 ld: Support multiple CFIs with different encoding in .eh_frame
We now parse each CFI to read its encoding as opposed to assuming that
all CFIs within the same EH_Frame uses the same encoding. FDEs are now
iterated in a per-CFI manner.
2023-10-20 18:15:03 +08:00
David Mak aa92778363 ld: Fix remapping of FDEs with multiple CFIs 2023-10-20 18:14:27 +08:00
David Mak e1487ed335 cargo: Update dependencies 2023-10-20 18:11:45 +08:00
David Mak 73500c9081 core: Remove lazy_static from dependencies 2023-10-16 15:55:10 +08:00
David Mak 9ca34c714e flake: Enable thread-safe mode for LLVM
This is required as we use the LLVM APIs from multiple threads.
2023-10-16 15:55:10 +08:00
David Mak 7fc2a30c14 Force single-threaded compilation if LLVM is not thread-safe 2023-10-16 15:55:10 +08:00
David Mak 950f431483 standalone: Update help text for `--emit-llvm` 2023-10-16 15:52:51 +08:00
David Mak a50c690428 standalone: Fix run_demo script
- Link main and module*.bc together if using multiple threads
- Fix temporary files not being deleted
2023-10-16 15:52:48 +08:00
David Mak 48eb64403f standalone: Treat -T0 as using all available threads 2023-10-13 14:57:16 +08:00
David Mak 2c44b58bb8 standalone: Require use of `-T` for specifying thread count 2023-10-13 14:36:34 +08:00
David Mak 50230e61f3 core: Simplify loop condition check for list comprehension 2023-10-06 12:24:03 +08:00
David Mak 0205161e35 core: Simplify list creation for comprehension 2023-10-06 12:22:38 +08:00
David Mak a2fce49b26 core: Allocate exceptions at the beginning of function
Only one instance of exception is necessary, as exceptions will always
be initialized before being thrown.
2023-10-06 12:13:20 +08:00
David Mak 60a503a791 core: Allocate more stack variables at the beginning of function
All allocas for temporary objects are now placed in the beginning of the
function. Allocas for on-temporary objects are not modified because
these variables may appear in a loop and thus must be uniquely
allocated by different allocas.
2023-10-06 11:42:47 +08:00
David Mak 0c49b30a90 core: Restore debug info before function call is invoked
Previously, the IR which sets up the call to the target function will
have its debug location pointing at the last argument of the function
call instead of the function call itself.
2023-10-06 11:35:23 +08:00
David Mak c7de22287e core: Fix restoration of stack address
All allocas for temporary objects are now placed in the beginning of the
function. Allocas for on-temporary objects are not modified because
these variables may appear in a loop and thus must be uniquely
represented.
2023-10-06 11:34:23 +08:00
David Mak 1a54aaa1c0 core: Restore debug location when generating allocas
Debug location is lost when moving the builder cursor.
2023-10-06 11:11:50 +08:00
David Mak c5629d4eb5 standalone: Remove redundant const in demo library 2023-10-06 10:32:58 +08:00
David Mak a79286113e standalone: Add output_bool in demo library 2023-10-06 10:19:22 +08:00
Sebastien Bourdeauducq 901e921e00 windows: fix build 2023-10-05 18:02:53 +08:00
Sebastien Bourdeauducq 45a323e969 windows: update msys2 packages 2023-10-05 17:52:29 +08:00
Sebastien Bourdeauducq 11759a722f flake: fix pgo build 2023-10-05 17:38:36 +08:00
David Mak 480a4bc0ad core: Implement comparison operators for unsigned types 2023-10-05 17:13:10 +08:00
Sebastien Bourdeauducq a1d3093196 flake: update dependencies 2023-10-05 17:05:57 +08:00
Sebastien Bourdeauducq 85c5f2c044 cargo: update dependencies 2023-10-05 17:03:35 +08:00
David Mak f34c6053d6 standalone: Add flags to control demo output options 2023-10-04 18:11:44 +08:00