68da9b0ecf
[core] codegen: Implement StructProxy on existing proxies
2025-02-03 11:51:57 +08:00
b521bc0c82
[core] codegen: Add Proxy{Type,Value}::as_abi_{type,value}
...
Needed for PtrToOrBasic{Type,Value}.
2025-02-03 11:51:57 +08:00
32f24261f2
[artiq] add global variables to modules
2025-01-16 12:40:14 +08:00
bd66fe48d8
[core] codegen: Refactor to use CodeGenContext::get_size_type
...
Simplifies a lot of API usage.
2025-01-15 13:23:19 +08:00
8baf111734
[meta] Apply clippy suggestions
2025-01-06 17:11:31 +08:00
eaaa194a87
[artiq] symbol_resolver: Cast ndarray.{shape,strides} globals to usize*
...
This is needed as ndarray.{shapes,strides} are ArrayValues, and so a GEP
operation is required to convert them into pointers to their first
elements.
2025-01-06 16:53:33 +08:00
352c7c880b
[artiq] symbol_resolver: Fix incorrect global type for ndarray.strides
2025-01-06 16:53:33 +08:00
3c5e247195
[artiq] symbol_resolver: Use TargetData to get size of dtype
...
dtype.size_of() may not return a constant value.
2025-01-06 16:53:33 +08:00
4e21def1a0
[artiq] symbol_resolver: Add missing promotion for host compilation
...
Shape tuple is always in i32, so a zero-extension to i64 is
necessary when assigning the shape tuple into the shape field of the
ndarray.
2025-01-06 16:53:33 +08:00
d9c180ed13
[artiq] symbol_resolver: Fix support for np.bool_ -> bool decay
2025-01-06 16:53:33 +08:00
12fddc3533
[core] codegen/ndarray: Make ndims non-optional
...
Now that everything is ported to use strided impl, dynamic-ndim ndarray
instances do not exist anymore.
2025-01-03 15:43:08 +08:00
8b3429d62a
[artiq] Reimplement get_obj_value for strided ndarray
...
Based on 7ef93472
: artiq: reimplement get_obj_value to use ndarray with
strides
2024-12-13 15:23:31 +08:00
08a7d01a13
[core] Add itemsize and strides to NDArray struct
...
Temporarily disable linalg ndarray tests as they are not ported to work
with strided-ndarray.
2024-12-13 15:22:09 +08:00
eb4b881690
[core] Expose {types,values}::ndarray modules
...
Allows better encapsulation of members in these modules rather than
allowing them to leak into types/values mod.
2024-12-12 11:30:14 +08:00
ac978864f2
[meta] Apply clippy suggestions
2024-12-09 12:08:41 +08:00
964945d244
string_store: update embedding map after compilation
2024-12-03 16:45:46 +08:00
5f940f86d9
[artiq] Fix obtaining ndarray struct from NDArrayType
2024-11-25 15:01:39 +08:00
9d9ead211e
[core] Move Proxies to their own modules
2024-11-19 13:46:23 +08:00
26a1b85206
[core] codegen/classes: Remove Underlying type
...
This is confusing and we want a better abstraction than this.
2024-11-19 13:45:55 +08:00
a98f33e6d1
[meta] Reorganize order of use declarations - Phase 2
...
Some more rules:
- For module-level imports, prefer no prefix > super > crate.
- Use crate instead of super if super refers to the crate-level module
2024-10-17 15:57:33 +08:00
9fdbe9695d
[core] Add generator to SymbolResolver::get_symbol_value
...
Needed in a future commit.
2024-10-04 13:20:29 +08:00
fe06b2806f
[meta] Reorganize order of use declarations
...
Use declarations are now grouped into 4 groups:
- Declarations from the standard library
- Declarations from external crates
- Declarations from other crates in this project
- Declarations from within this module
Furthermore, all use declarations are grouped together to enhance
readability. super::super is also replaced by an equivalent crate::
declaration.
2024-10-04 12:52:01 +08:00
f3dc02d646
[meta] Apply cargo fmt
2024-09-09 14:24:52 +08:00
668ccb1c95
nac3core: expose inkwell and nac3parser
2024-09-06 11:06:26 +08:00
c8dfdcfdea
standalone & artiq: remove class_names from resolver
2024-08-27 23:43:40 +08:00
0b074c2cf2
[artiq] symbol_resolver: Set private linkage for constants
2024-08-19 14:41:43 +08:00
69320a6cf1
[artiq] Fix LLVM representation of strings
...
Should be `%str` rather than `[N x i8]`.
2024-08-14 09:30:08 +08:00
6a64c9d1de
core/typecheck/typedef: Add is_vararg_ctx to TTuple
2024-08-06 11:45:54 +08:00
3db3061d99
artiq/symbol_resolver: Handle type of zero-length lists
2024-07-19 14:42:14 +08:00
2194dbddd5
core/type_annotation: Refactor List type to TObj
...
In preparation for operators on lists.
2024-07-04 15:32:18 +08:00
b0b804051a
nac3artiq: allow class attribute access without init function
2024-06-25 16:06:33 +08:00
202a63274d
artiq: Implement pyty-to-ty conversion
2024-06-19 18:56:15 +08:00
76dd5191f5
artiq: Implement Python-to-LLVM conversion of ndarray
2024-06-19 18:56:15 +08:00
1bc95a7ba6
Add handling for np.bool_ and np.str_
2024-06-19 15:10:47 +08:00
ce3e9bf4fe
nac3artiq: add support string attributes in classes
2024-06-17 16:53:51 +08:00
676412fe6d
apply cargo fmt
2024-06-14 09:46:42 +08:00
fed1361c6a
core: rename to_var_map to into_var_map
2024-06-13 16:59:10 +08:00
f026b48e2a
core: refactor to use TypeVarId
and TypeVar
2024-06-13 16:59:10 +08:00
23974feae7
meta: Restrict number of allowed lints
2024-06-12 16:10:57 +08:00
fd36f78005
core: refactor PrimitiveDefinitionId
into enum PrimDef
2024-06-12 15:01:01 +08:00
8168692cc3
apply cargo fmt
2024-06-12 14:45:03 +08:00
3a6c53d760
core/toplevel/numpy: Split ndarray type var utilities
2024-04-03 00:07:33 +08:00
5ca2dbeec8
core/typedef: Add Type::obj_id to replace get_obj_id
2024-04-02 16:49:10 +08:00
4bb0e60981
core: Apply clippy suggestions
2024-04-01 16:46:41 +08:00
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
234a6bde2a
core: Use TObj for NDArray
2024-03-01 15:41:55 +08:00
49de81ef1e
core: Apply clippy suggestions
2024-02-23 15:41:06 +08:00
c395472094
core: Initial infrastructure for ndarray
2023-12-21 15:39:46 +08:00
b47ac1b89b
core: Minor formatting cleanup
2023-12-15 17:46:44 +08:00
a19f1065e3
meta: Refactor to use more let-else bindings
2023-12-12 16:31:14 +08:00