-
Notifications
You must be signed in to change notification settings - Fork 431
Draft implementation of real(16)
, imag(16)
, complex(32)
#27010
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Sufficient to compile ```chapel var pi16: real(16) = 3.14159265; writeln(pi16); ``` using the C back-end --- Signed-off-by: Brad Chamberlain <[email protected]>
It seems lack of these broke some tests... maybe we do some automatic conversions between enums s.t. missing the corresponding COMPLEX enums broke things? --- Signed-off-by: Brad Chamberlain <[email protected]>
--- Signed-off-by: Brad Chamberlain <[email protected]>
…implicity --- Signed-off-by: Brad Chamberlain <[email protected]>
--- Signed-off-by: Brad Chamberlain <[email protected]>
Also add --ignore-errors for pass to the *-1.chpl version since only locking in the first error makes it equivalent to the *-2.chpl version matching its .bad file. --- Signed-off-by: Brad Chamberlain <[email protected]>
real(16)
, imag(16)
, complex(32)
The main thing I'm aware of that's completely busted currently is that my casts to complex rely on .re and .im which themselves currently rely on casts in order to use chpl_crealf() implemented in terms of __builtin_crealf, as I haven't found a 16-bit equivalent. This results in an infinite recursion in the compiler. I think the way to break it is to enable something like the commented-out code in chpl_anycomplex.re/.im I think there are also updates needed to the CPP_IS_LAME macros in frontend/lib/immediates/num.h, but I don't quite follow the second of these yet. --- Signed-off-by: Brad Chamberlain <[email protected]>
A place where this PR is currently failing comes up with a simple test case like: var c32: complex(32);
var r = c32.re; Specifically, my current implementation implements the |
Thanks to Jade for the tip about __builtin_crealf() working for complex(32) (though I have no intuition as to why that would be...) --- Signed-off-by: Brad Chamberlain <[email protected]>
--- Signed-off-by: Brad Chamberlain <[email protected]>
--- Signed-off-by: Brad Chamberlain <[email protected]>
--- Signed-off-by: Brad Chamberlain <[email protected]>
This PR represents a work in progress to try and add support for 16-bit floats, such as
real(16)
,imag(16)
, andcomplex(32)
for platforms and back-end compilers that support_Float16
.TODO:
_Float16
(like our CI's compiler, apparently)