forked from M-Labs/artiq
1
0
Fork 0
artiq/artiq/compiler
David Nadlinger 1f40f3ce15 compiler: Map host numpy.bool_ values to TBool
Since we don't implement any integer-like operations for TBool
(addition, bitwise not, etc.), TBool is currently neither
strictly equivalent to builtin bool nor numpy.bool_, but through
very obvious compiler errors (operation not supported) rather than
silently different runtime behaviour.

Just mapping both to TBool thus is a huge improvement over the
current behaviour (where numpy.False_ is a true-like object). In
the future, we could still implement more operations for TBool,
presumably following numpy.bool_ rather than the builtin type,
just like builtin integers get translated to the numpy-like
TInt{32,64}.

GitHub: Fixes #1275.
2021-03-20 00:54:41 +00:00
..
algorithms compiler: do not associate SSA values with iodelay even when inlining. 2015-12-25 15:02:33 +08:00
analyses compiler: Constness is a validator, not analysis. 2017-06-09 07:29:31 +00:00
testbench use tokenize.open() to open Python source files 2018-07-07 17:04:56 +08:00
transforms compiler: Map host numpy.bool_ values to TBool 2021-03-20 00:54:41 +00:00
validators compiler: T{C -> External}Function, clarify docs [nfc] 2020-08-09 03:54:41 +01:00
__init__.py compiler: pull in dependencies in more finely grained way (fixes #181). 2015-11-24 17:32:04 +08:00
asttyped.py compiler: allow specifying per-function "fast-math" flags. 2016-03-28 21:44:08 +00:00
builtins.py compiler: Change type inference rules for empty array() calls 2021-03-14 22:48:43 +00:00
embedding.py compiler: Map host numpy.bool_ values to TBool 2021-03-20 00:54:41 +00:00
import_cache.py import_cache: make sure last line ends with \n as linecache does. Closes #547 2016-09-02 11:01:28 +08:00
iodelay.py compiler.iodelay: correctly fold max(0, [0, ]...). 2015-11-24 00:46:55 +08:00
ir.py compiler/firmware: RPCs for ndarrays 2020-08-09 17:08:43 +01:00
math_fns.py compiler: Provide libm special functions (erf, Bessel functions, …) 2020-11-11 19:15:30 +01:00
module.py compiler: Raise AssertionErrors instead of abort()ing on all targets 2020-11-10 20:40:18 +01:00
prelude.py compiler: remove obsolete watchdog code (#1458) 2020-12-08 13:25:08 +08:00
targets.py Revert "compiler: enabled vectorize option" 2021-01-11 19:43:12 +08:00
types.py compiler: Implement broadcasting of math functions 2020-08-09 03:54:42 +01:00