-
Notifications
You must be signed in to change notification settings - Fork 95
Open
Description
According to B users' reference: "complement operator ~, when applied to an rvalue, turns all 1 bits to 0 and all 0 bits to 1."
But current implementation doesn't support ~ operator with LEXER ERROR: Unknown token ~
Actually ~x = -x - 1, so we can leave without complement operator. But imo it's better to have it.
I implemented it locally on my machine, it's just one notq operator for x86_64:
Op::Complement { result, arg } => {
load_arg_to_reg(arg, c!("rax"), output, os);
sb_appendf(output, c!(" notq %%rax\n"));
.....
So I can create a pull-request. Not sure how to implement (and test) it for other targets though.
Metadata
Metadata
Assignees
Labels
No labels