-
Notifications
You must be signed in to change notification settings - Fork 8
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
Explicit casting proposal #111
Comments
Good points all. Here are some disorganized thoughts:
|
Here's my two cents about bit widths-
|
Fixed in #188 |
@sa2257 brought up some concerns in #53 and #102. I think his high level point is about the control over bitwidth specifications. The language already allows for
let
binders to specify their explicit types. However, the automatic casting of variables might not be desirable:Implicitly, the type checker did the following cast:
We can add the explicit casting operator
as
to change the bitwidths of variables. The naive is complicated for a few reasons:ap_int
doesn't allow addition of arbitrary bitwidths, casting will have to manually "move" a small bitwidth value into a larger memory:will have to turn into:
This will require full ANFing of all complex expressions.
Unsigned to signed: Should the value be reinterpreted? C does this but this is not necessarily desirable.
Casting down to smaller bitwidth: What should happen in this case?
The text was updated successfully, but these errors were encountered: