Closed puranjaymohan closed 3 months ago
Hi @puranjaymohan. Unless I am mistaken, &~
is not a standard C operator. I did not know that...
Hi @maranget,
I agree that lexing &~
is not a good way to implement this. I have update the PR to fix this.
Thanks
As far as I can see, the new style, with two lexemes looks closer to C.
As far as I can see, the new style, with two lexemes looks closer to C.
Yes, I also think this is a better approach.
Thanks @puranjaymohan, merge on its way.
Implement
atomic_andnot()
for the linux kernel.&
~
represents this atomic operation,~
has been added to the C lexer.&
is already lexed asLAND
. AndNot2 is already implemented so we can use it directly by mapping&~
to it in the parser.Testing
+atomic_andnot(V,X) { __atomic_op(X,&~,V); }
was added to the linux-kernel.def in the kernel tree and the following litmus test was run:This is doing:
which would clear the bit number 0 and 1 in 7 and that would mean the result should be 4: