Commit Graph

249 Commits

Author SHA1 Message Date
David Mak dddf10c41d WIP - [artiq] Test 2024-08-15 04:26:02 +08:00
David Mak b3d86f7187 WIP - [artiq] Revert to unified 2024-08-15 04:03:26 +08:00
David Mak 4522077644 WIP - [artiq] More test 2024-08-15 04:03:06 +08:00
David Mak 758ea48a4b WIP - [artiq] More test 2024-08-15 04:01:12 +08:00
David Mak 22a2c3f3dd WIP - [artiq] More test 2024-08-15 03:55:08 +08:00
David Mak 2c2f3e4da4 WIP - [artiq] Invert parse order 2024-08-15 03:16:10 +08:00
David Mak 0c18154d15 WIP - [artiq] Force completion 2024-08-15 02:59:42 +08:00
David Mak 710038288a WIP - [artiq] Change to unified implementation 2024-08-15 02:19:05 +08:00
David Mak ad1b2dfd88 WIP - [artiq] only change slot 2024-08-14 18:23:43 +08:00
David Mak 6afcd37b83 WIP - [artiq] Nope 2024-08-14 18:12:13 +08:00
David Mak 2b2cc06776 WIP - [artiq] Constants 2024-08-14 18:10:16 +08:00
David Mak c55ee08e4c WIP - [artiq] Fix RPC of ndarrays from host 2024-08-14 17:54:02 +08:00
David Mak 3486c7942c [artiq] Fix RPC of ndarrays to host 2024-08-14 15:53:52 +08:00
David Mak 33792bea0d [artiq] Fix LLVM representation of strings
Should be `%str` rather than `[N x i8]`.
2024-08-13 16:24:17 +08:00
David Mak 6beff7a268 [artiq] Implement core_log and rtio_log in terms of polymorphic_print
Implementation mostly references the original implementation in Python.
2024-08-13 15:19:03 +08:00
David Mak 6ca7aecd4a [artiq] Add core_log and rtio_log function declarations 2024-08-13 15:19:03 +08:00
David Mak 8fd7216243 [core] toplevel/composer: Add lateinit_builtins
This is required for the new core_log and rtio_log functions, which take
a generic type as its parameter. However, in ARTIQ builtins are
initialized using one unifier and then actually used by another unifier.

lateinit_builtins workaround this issue by deferring the initialization
of functions requiring type variables until the actual unifier is ready.
2024-08-13 15:19:03 +08:00
David Mak 4f5e417012 [core] codegen: Add function to get format constants for integers 2024-08-13 15:19:03 +08:00
David Mak 6a64c9d1de core/typecheck/typedef: Add is_vararg_ctx to TTuple 2024-08-06 11:45:54 +08:00
David Mak cbf79c5e9c core/typecheck/typedef: Add is_vararg to FuncArg, ConcreteFuncArg 2024-08-06 11:43:13 +08:00
David Mak 0ba68f6657 core: Set target triple and datalayout for each module
Fixes an issue with inconsistent pointer sizes causing crashes.
2024-07-26 13:35:40 +08:00
David Mak 5faeede0e5 Determine size_t using LLVM target machine 2024-07-26 13:35:38 +08:00
David Mak 4948395ca2 core/toplevel/type_annotation: Add handling for mismatching class def
Primitive types only contain fields in its Type and not its TopLevelDef.
This causes primitive object types to lack some fields.
2024-07-19 14:42:14 +08:00
David Mak 3db3061d99 artiq/symbol_resolver: Handle type of zero-length lists 2024-07-19 14:42:14 +08:00
David Mak 2194dbddd5 core/type_annotation: Refactor List type to TObj
In preparation for operators on lists.
2024-07-04 15:32:18 +08:00
abdul124 b0b804051a nac3artiq: allow class attribute access without init function 2024-06-25 16:06:33 +08:00
abdul124 134af79fd6 core: add support for class attributes 2024-06-25 16:06:33 +08:00
lyken 06e9d90d57 apply clippy changes 2024-06-21 14:14:01 +08:00
David Mak d3cd2a8d99 artiq: Add support for generating RPC tag for ndarray 2024-06-19 18:56:16 +08:00
David Mak 202a63274d artiq: Implement pyty-to-ty conversion 2024-06-19 18:56:15 +08:00
David Mak 76dd5191f5 artiq: Implement Python-to-LLVM conversion of ndarray 2024-06-19 18:56:15 +08:00
David Mak 8d9df0a615 artiq: Fix ndarray class ID
We want the class ID of the ndarray class, not its corresponding typing
class.
2024-06-19 18:56:15 +08:00
David Mak 1bc95a7ba6 Add handling for np.bool_ and np.str_ 2024-06-19 15:10:47 +08:00
abdul124 ce3e9bf4fe nac3artiq: add support string attributes in classes 2024-06-17 16:53:51 +08:00
lyken 676412fe6d apply cargo fmt 2024-06-14 09:46:42 +08:00
lyken fed1361c6a core: rename to_var_map to into_var_map 2024-06-13 16:59:10 +08:00
lyken f026b48e2a core: refactor to use `TypeVarId` and `TypeVar` 2024-06-13 16:59:10 +08:00
David Mak 23974feae7 meta: Restrict number of allowed lints 2024-06-12 16:10:57 +08:00
David Mak 40a3bded36 meta: Set clippy lints in {main,lib}.rs
So that this does not have to be manually passed to the `cargo clippy`
command-line every single time. Also allows incrementally addressing
these lints by removing and fixing them one-by-one.
2024-06-12 16:10:57 +08:00
lyken fd36f78005 core: refactor `PrimitiveDefinitionId` into enum `PrimDef` 2024-06-12 15:01:01 +08:00
lyken 8168692cc3 apply cargo fmt 2024-06-12 14:45:03 +08:00
David Mak 82cc693b11 meta: Update dependencies 2024-06-03 16:40:02 +08:00
David Mak 3a6c53d760 core/toplevel/numpy: Split ndarray type var utilities 2024-04-03 00:07:33 +08:00
David Mak 5ca2dbeec8 core/typedef: Add Type::obj_id to replace get_obj_id 2024-04-02 16:49:10 +08:00
David Mak 4bb0e60981 core: Apply clippy suggestions 2024-04-01 16:46:41 +08:00
David Mak 77de24ef74 core: Use BTreeMap for type variable mapping
There have been multiple instances where I had the need to iterate over
type variables, only to discover that the traversal order is arbitrary.

This commit fixes that by adding SortedMapping, which utilizes BTreeMap
internally to guarantee a traversal order. All instances of VarMap are
now refactored to use this to ensure that type variables are iterated in
 the order of its variable ID, which should be monotonically incremented
 by the unifier.
2024-03-04 23:56:04 +08:00
David Mak 234a6bde2a core: Use TObj for NDArray 2024-03-01 15:41:55 +08:00
David Mak c3db6297d9 core: Add primitive definition-id list
So that we have a single ground truth for the definition IDs of
primitive types.
2024-03-01 11:29:10 +08:00
David Mak 82fdb02d13 core: Extract LLVM intrinsic functions to their functions 2024-02-23 15:41:06 +08:00
David Mak 49de81ef1e core: Apply clippy suggestions 2024-02-23 15:41:06 +08:00