[PATCH] [ARM] Fix issue with SMLAL (Signed Multiply Accumulate Long) lowering

Tim Northover t.p.northover at gmail.com
Mon Jan 19 09:42:51 PST 2015


> I suspect you could get wrong codegen if you could arrange that the low half of SMUL_LOHI gets fed into the ADDE and the high half into the ADDC.


Yep:

  #include <stdint.h>
  
  uint64_t foo(uint64_t acc, int lhs, int rhs) {
    uint64_t prod = (uint64_t)lhs * rhs;
    uint64_t prod_swap = ((prod & 0xffffffffULL) << 32) | (prod >> 32);
    return acc + prod_swap;
  }

I don't think that should be an smlal.


REPOSITORY
  rL LLVM

http://reviews.llvm.org/D6998

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list