Skip to content
  • Benjamin Kramer's avatar
    Add a neat little two's complement hack for x86. · 124ac2b9
    Benjamin Kramer authored
    On x86 we can't encode an immediate LHS of a sub directly. If the RHS comes from a XOR with a constant we can
    fold the negation into the xor and add one to the immediate of the sub. Then we can turn the sub into an add,
    which can be commuted and encoded efficiently.
    
    This code is generated for __builtin_clz and friends.
    
    llvm-svn: 136167
    124ac2b9
Loading