NOT operator not implemented?
Hello! I tried converting some c code I have, which makes frequent use of bitwise operators and I've traced the error to "unimplemented: 'not.32'", or something similar, from cg.c. The not operator seems pretty important! (or at least with the code I'm doing right now). How could I go about implementing the not operator?
I would actually not suggest using clue for anything --- there are some critical bugs. (Sparse tries to generate code which casts a pointer to an integer, does maths on it, then casts it back, which can never work.)
It's been a while, but from a quick look at the code, to add support do this:
- add OP_NOT to the uniop block in
generate_one_insn()in clue/cg.c - in
generate_uniop(), duplicate the OP_NEG block, but call it OP_NOT, and callcg->not()rather thancg->negate() - in globals.h, in
struct codegenerator, add anotcallback similar tonegate - and now in every single code generator backend (clue/cg-c.c etc) actually add an implementation.
...but you're still going to run into the aforementioned bugs, so it may not be worth the effort. I'd welcome a PL, though. (I can't believe I never ran any code which needed not...)