[PATCH] D25485: [x86] use 'neg' for negation of bool

Simon Dardis via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 13 09:24:29 PDT 2016


sdardis added a comment.

There are some neg<-> aliases in LLVM for MIPS which is what you're seeing in the produced assembly. The main reason for the different is it's not possible to use $zero with the 16 bit instructions.

As Daniel pointed out, you can use subtraction in that case. The produced assembly from that selection dag patch is actually better than what we're currently getting in terms of size as li16, subu16 are 16 bits each, the two constant shifts are 32bits each. The optimal case would be to use a 32bit microMIPS instruction with the register $zero (better than current in terms of size and # instructions). The new instruction pattern for microMIPS should be easy to fold away.


https://reviews.llvm.org/D25485





More information about the llvm-commits mailing list