On Mon, 11 Aug 2014, Kyrill Tkachov wrote:
The aarch64 target has a conditional negation instruction CSNEG Rd, Rs1, Rs2, condwith semantics Rd = if cond then Rs1 else -Rs2. This, however doesn't get end up getting matched for code such as: int foo2 (unsigned a, unsigned b) { int r = 0; r = a & b; if (a & b) return -r; return r; }
Note that in this particular case, we should just return -(a&b) like llvm does.
-- Marc Glisse