whitequark
ea7549cfa4
compiler: coerce `while` condition to bool.
...
Fixes #768 .
2017-07-01 18:59:07 +00:00
whitequark
f7254dd3ce
compiler.validators.constness: take AugAssign into account.
2017-06-09 07:31:08 +00:00
whitequark
ad2ee714c2
compiler: do not permit iterating str values.
...
This currently breaks badly on UTF-8, and doesn't even return
a value of a correct type.
2017-06-09 07:29:31 +00:00
whitequark
4e7493843a
compiler: Constness is a validator, not analysis.
2017-06-09 07:29:31 +00:00
whitequark
5d841d08e9
compiler: do not permit mutation of bytes values ( #714 ).
2017-06-09 07:29:28 +00:00
whitequark
284382b1f5
compiler: add support for bytearray values in RPC ( #714 ).
2017-06-09 07:15:25 +00:00
whitequark
9ed4e9c1cd
compiler: add support for printing of bytearray values ( #714 ).
2017-06-09 07:15:25 +00:00
whitequark
e9564b15c8
compiler: add support for bytearray type ( #714 ).
2017-06-09 07:15:24 +00:00
whitequark
5b4fde30a8
compiler: unbreak subscripts for bytes values ( #714 ).
2017-06-09 07:10:48 +00:00
whitequark
66a683f583
compiler: add support for bytes values in RPC ( #714 ).
2017-06-09 07:10:48 +00:00
whitequark
778e7dc2ab
compiler: add support for concatenating bytes values ( #714 ).
2017-06-09 07:10:48 +00:00
whitequark
7b2da5294f
compiler: add support for printing of bytes values ( #714 ).
2017-06-09 07:10:48 +00:00
whitequark
dba4e1a28b
compiler: add support for bytes type and b"x" literals ( #714 ).
2017-06-09 07:10:48 +00:00
Sebastien Bourdeauducq
cd757c0f16
generate device database from executable python file
2017-05-18 23:14:55 +08:00
whitequark
bb64992395
compiler: remove dead code.
2017-04-21 18:38:43 +00:00
whitequark
c5d7445973
compiler: reject reachable implicit return if not returning TNone.
...
Fixes #718 .
2017-04-21 18:11:14 +00:00
whitequark
ed2b10c5aa
compiler: in codegen for delay(), round fp instead of truncating.
...
Consider delay(8*us). It results in the following computation...
>>> 8*1e-06/1e-09
7999.999999999999
with the result promptly getting truncated to 7999.
Fixes #706 .
2017-04-21 17:36:44 +00:00
whitequark
3a1fc729cf
compiler: refactor type annotations recognizing in kernels.
...
The new implementation is much more generic, more robust,
and shares code with the same for syscalls as well as RPCs.
Fixes #713 .
2017-04-13 08:26:10 +00:00
whitequark
31048f4b6a
compiler: fix monomorphization of coerced integer literals.
...
Fixes #703 .
2017-04-12 04:11:47 +00:00
whitequark
1bd4d13391
artiq_compile: make print() write to core log, not an invalid op.
...
Fixes #710 .
2017-04-11 03:16:34 +00:00
whitequark
86dea869b3
compiler.types: add missing TTuple.__hash__ implementation.
2017-03-03 03:27:49 +00:00
whitequark
7e886ddc89
transforms.inferencer: do not unnecessarily mutate typedtree.
...
This caused the hash to change after every iteration of inference,
if the result of any coercion was an integer of indefinite width.
2017-03-02 16:15:37 +00:00
whitequark
8c9f157563
compiler.embedding: fix an overly lax hasher.
2017-03-02 15:28:24 +00:00
whitequark
a79c3c2cff
compiler.transforms: implement a typedtree printer.
2017-03-02 15:28:04 +00:00
whitequark
4107938fd8
compiler.embedding: use attribute count in fixpoint condition.
...
Before this commit, we had a hack where inferencing would run
one more time, in case we can still infer more attributes even
after all the type information is there. This doesn't work
if *that* round of inferencing brings even more code, e.g.
this is easy to trigger with context managers.
2017-02-28 21:28:40 +00:00
whitequark
252cda6e7f
compiler.llvm_ir_generator: fix string quoting.
2017-02-28 21:28:38 +00:00
whitequark
de015b994d
compiler: allow dumping the object file with ARTIQ_DUMP_OBJ.
2017-02-26 17:09:21 +00:00
whitequark
3a1f14c16c
compiler: fix overly strict constness analysis.
...
Before this commit, the following code would fail to compile...
obj.foo.bar = True
... if foo is marked kernel_invariant in obj, even if bar is not
marked as such in obj.foo.
2017-02-26 01:58:21 +00:00
whitequark
d04e611232
firmware, compiler: rename rpc functions to be more consistent.
2017-02-25 14:12:58 +00:00
whitequark
c39394b4d5
firmware: port the exception handling routines to Rust.
2017-02-04 08:21:07 +00:00
whitequark
fd8b11532f
compiler, firmware: use Pascal strings everywhere.
...
This removes a large amount of very ugly code, and also simplifies
the compiler and runtime.
2017-02-03 11:53:27 +00:00
whitequark
ee1b2fa3ea
compiler: swap the order of ptr/len fields in lists.
...
This is to make them match the Rust slices.
Once the cslice crate becomes #![no_std] we'll also use its (tidier)
conversion functions.
2017-01-31 22:11:13 +00:00
whitequark
ab71c9a0ba
compiler: the len builtin is not polymorphic, coerce the result.
...
Fixes #659 .
2017-01-31 21:28:20 +00:00
whitequark
6acdcbb82a
Fix 2f37b1d
.
2017-01-30 10:25:11 +00:00
whitequark
2f37b1d1c0
compiler: support methods defined on singleton instances.
...
Fixes #638 .
2017-01-30 10:10:21 +00:00
whitequark
57f54dbd12
llvm_ir_generator: recognize inline and forceinline flags.
2017-01-25 10:25:00 +00:00
whitequark
f68e4ae519
compiler: rein in overzealous cast monomorphization.
2016-12-05 05:08:57 +00:00
whitequark
218720cfa7
Revert "compiler: rein in overzealous cast monomorphization."
...
This reverts commit 4305903dde
.
This broke the monomorphizer/round.py test.
2016-12-05 05:04:26 +00:00
whitequark
4305903dde
compiler: rein in overzealous cast monomorphization.
...
This caused failures on e.g. "int32(var64a >> var64b)", where
the type of the argument is already fully known, but was unified
with the result of the cast anyway.
2016-12-05 04:38:25 +00:00
whitequark
b5a684830d
compiler: fix parsing of TList annotations ( fixes #632 ).
2016-12-05 03:18:56 +00:00
whitequark
68de724554
compiler: monomorphize int64(round(x)) to not lose precision.
...
This applies to any expression with an indeterminate integer type
cast to int64(), not just round().
2016-12-02 15:02:44 +00:00
whitequark
ac997daf95
compiler: disable remarks.
2016-11-21 19:12:11 +00:00
whitequark
55ea68da7f
compiler: unbreak casts to int32/int64.
2016-11-21 14:20:28 +00:00
whitequark
53b7d59b6a
analyses.constness: fix false positive on x[...].
2016-11-21 14:20:26 +00:00
whitequark
35f4449ef2
inferencer: significantly improve the op-assignment diagnostic.
...
Before this commit, it displayed incorrect output if an error
appeared on 2nd run and beyond, and displayed messages for trying
to do "num32 -= num64" that made very little sense.
2016-11-21 14:20:24 +00:00
whitequark
009d396740
Move mu_to_seconds, seconds_to_mu to Core.
2016-11-21 05:37:30 +00:00
whitequark
7af41bd29c
llvm_ir_generator: handle no-op coercions.
2016-11-21 02:25:34 +00:00
whitequark
cdb29f9caa
Revert accidentally committed code.
2016-11-20 14:32:59 +00:00
whitequark
f5cca6b09e
analyses.invariant_detection: implement ( #622 ).
2016-11-20 12:48:26 +00:00
whitequark
d3ee858d16
llvm_ir_generator: use !{→unconditionally.}invariant.load metadata.
...
This helps LICM, among other things.
2016-11-12 04:08:58 +00:00