Commit Graph

344 Commits

Author SHA1 Message Date
whitequark d419ccdeca compiler: do not permit str(...). (#878) 2017-12-27 11:48:21 +08:00
whitequark 4bda29f863 compiler: fix typo in a0a2650f. 2017-12-27 10:44:26 +08:00
whitequark fbf7e70ef8 compiler: do not ever emit !tbaa on invoke instructions. 2017-12-27 10:44:03 +08:00
whitequark ca48c29a8b compiler: update for llvmlite 0.20.0. 2017-12-27 10:43:55 +08:00
whitequark c9be535ba5 compiler: do not use invoke for calls to nounwind ffi functions.
Otherwise, declarations such as:

  @syscall(flags={"nounwind", "nowrite"})
  def foo(...):

trip an LLVM assert because the invoke instruction and the !tbaa
metadata are no longer compatible since LLVM 4.0.
2017-12-27 10:43:48 +08:00
whitequark 30b7bcf362 Update to LLVM 4.0. 2017-12-27 10:43:04 +08:00
Sebastien Bourdeauducq 0c47f83634 clean up rtio_log 2017-11-03 01:13:07 +08:00
whitequark ce7e30edfe compiler: implement ~ operator (fix #836). 2017-10-02 11:03:02 +08:00
whitequark a06f04dfbe compiler: minor intrinsic refactoring. 2017-10-02 11:03:02 +08:00
whitequark 1521231b1b compiler: correct semantics of floating point % operator (fix #830). 2017-10-02 11:03:02 +08:00
whitequark 67997d8955 compiler: correct semantics of integer % operator (#830). 2017-10-02 11:03:02 +08:00
whitequark ea7549cfa4 compiler: coerce `while` condition to bool.
Fixes #768.
2017-07-01 18:59:07 +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 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
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 31048f4b6a compiler: fix monomorphization of coerced integer literals.
Fixes #703.
2017-04-12 04:11:47 +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 a79c3c2cff compiler.transforms: implement a typedtree printer. 2017-03-02 15:28:04 +00:00
whitequark 252cda6e7f compiler.llvm_ir_generator: fix string quoting. 2017-02-28 21:28:38 +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 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 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 55ea68da7f compiler: unbreak casts to int32/int64. 2016-11-21 14:20:28 +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
David Nadlinger bfbdba9205 compiler: Emit all-kernel_invariant objects as LLVM constants
This enables constant propagation optimisations, as verified by
the included test case. This is only a first stop-gap measure, though;
we should support optimisation based on kernel invariants on a more
fine-grained level.
2016-11-09 14:50:48 +00:00
whitequark ec8fe6f8bd Revert "Revert "Revert "Revert "Update for LLVM 3.9.""""
This reverts commit 7b81ed1d18.
2016-11-08 14:22:47 +00:00
whitequark 7b81ed1d18 Revert "Revert "Revert "Update for LLVM 3.9."""
This reverts commit 0d7688017b.
2016-11-08 12:58:20 +00:00
whitequark 0d7688017b Revert "Revert "Update for LLVM 3.9.""
This reverts commit 5f5975844a.
2016-11-08 11:59:16 +00:00
whitequark 798a5f70df Revert "runtime: remove some redundant libm functions copied inline."
This reverts commit fee75bd50f.

LLVM does not have lround as a libcall and this inhibits LICM.
2016-11-08 11:54:17 +00:00
David Nadlinger 6e77f65d50 compiler: Clarify recv_rpc value names and documentation [nfc]
Previously, the phi emitted for the pointer parameter to recv_rpc was –
rather confusingly – called "size", and the pseudo-code in the comment
had bit-rotted.

Signed-off-by: David Nadlinger <code@klickverbot.at>
2016-11-07 14:38:21 +00:00