Nia Weiss
a5cf704d83
compiler: test float to int conversions and fix upper-bound calculation
4 years ago
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.
4 years ago
Ayke van Laethem
3e40b08ba0
compiler: implement negate for complex numbers
4 years ago
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
6 years ago
Ayke van Laethem
d7460b945e
compiler: implement complex multiplication
6 years ago
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)
6 years ago
Ayke van Laethem
e66d457c42
compiler: fix float <-> int conversions
6 years ago
Ayke van Laethem
9b9b66a09d
compiler: add complex manipulation
* builtins: real, imag, complex
* printing of complex numbers
No support for complex arithmetic yet.
6 years ago
Ayke van Laethem
c1a833c7cc
main: add basic float tests
6 years ago