-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
ISLE: support bool types and constants properly #3573
Comments
Subscribe to Label Action
This issue or pull request has been labeled: "isle"
Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
FWIW, we use wasmtime/cranelift/codegen/src/isa/x64/lower.isle Lines 24 to 30 in 0580c84
Not convinced that |
Yep, we'd want to clean up said uses all at the same time. I'm not as concerned about syntax; we could even just accept tokens |
ISLE's prototype compiler was built with the simplifying assumption that all constants are integers. "Symbolic constants" (imported opaque values) like
$MYVALUE
were added later. It's possible to definebool
as a primitive type, but the syntax for bool constants,#t
and#f
, results in generated code that uses integer values1
and0
because... everything is (was) an integer. This is clearly suboptimal! In #3572 @alexcrichton used the clever workaround of$false
, leveraging the support for arbitrary passthrough of constant names to actually get afalse
in the code.We should (i) add a
ConstBool
alongsideConstInt
in the IR (PatternInst
andExprInst
), and (ii) codegen these properly as Rust bool types. We might also consider at some point making our "primitive" type hierarchy a bit richer and distinguishing ints and bools, but that's lower-priority.The text was updated successfully, but these errors were encountered: