Nia Weiss
a5cf704d83
compiler: test float to int conversions and fix upper-bound calculation
2021-01-19 14:02:32 +01:00
Nia Weiss
a867b56e5f
compiler: saturate float-to-int conversions
...
This works around some UB in LLVM, where an out-of-bounds conversion would produce a poison value.
The selected behavior is saturating, except that NaN is mapped to the minimum value.
2021-01-16 19:12:36 +01:00
Ayke van Laethem
3e40b08ba0
compiler: implement negate for complex numbers
2020-10-28 07:38:51 +01:00
cornelk
1461563e3f
testdata: fix formatting
2020-05-12 01:17:27 +02:00
Ayke van Laethem
4ae4ef5e12
compiler: implement complex division
...
This is hard to do correctly, so copy the relevant files from the Go
compiler itself.
For related discussions:
* https://github.com/golang/go/issues/14644
* https://github.com/golang/go/issues/29846
2019-05-11 15:33:37 +02:00
Ayke van Laethem
d7460b945e
compiler: implement complex multiplication
2019-05-11 15:33:37 +02:00
Ayke van Laethem
638bc17eeb
compiler: add support for complex add and sub
...
This is fairly trivial to add and follows the implementation of gc:
170b8b4b12/src/cmd/compile/internal/gc/ssa.go (L2179-L2192)
2019-05-11 15:33:37 +02:00
Ayke van Laethem
e66d457c42
compiler: fix float <-> int conversions
2018-11-03 12:20:55 +01:00
Ayke van Laethem
9b9b66a09d
compiler: add complex manipulation
...
* builtins: real, imag, complex
* printing of complex numbers
No support for complex arithmetic yet.
2018-10-22 13:49:03 +02:00
Ayke van Laethem
c1a833c7cc
main: add basic float tests
2018-09-29 00:12:23 +02:00