-
Notifications
You must be signed in to change notification settings - Fork 22
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
add support for lnot on ints and uints #574
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pub(crate) fn mk_lnot() -> impl IntoIterator<Item = (mir::UnOp, Sig<1>)> { | ||
let int_lnots = INT_TYS.map(|int_ty| { | ||
define_btys! { let Int = BaseTy::Int(int_ty); }; | ||
(mir::UnOp::Not, s!(fn(a: Int) -> Int[E::tt()])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be
(mir::UnOp::Not, s!(fn(a: Int) -> Int[E::tt()])) | |
(mir::UnOp::Not, s!(fn(a: Int) -> Int{ v: E::tt() })) |
Int[E::tt()]
would mean the integer is indexed by a bool
which is not well-formed.
|
||
let uint_lnots = UINT_TYS.map(|uint_ty| { | ||
define_btys! { let Uint = BaseTy::Uint(uint_ty); }; | ||
(mir::UnOp::Not, s!(fn(a: Uint) -> Uint[E::tt()])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
sgtm, I'll add the duplicate signature and test. I'll take a look at the other |
wait, the shift functions use (Shl, s!(fn(a: Int, b: Int) -> Int{ v: E::tt() })), |
it was my impression (from context) that // BIT
(BitAnd, s!(fn(a: Int, b: Int) -> Int{v: E::tt()})),
(BitOr, s!(fn(a: Int, b: Int) -> Int{v: E::tt()})), |
The problem is not |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. I'm going to mer it.
fixes #571