[PATCH] D142288: [X86] Add basic vector handling for ISD::ABDS/ABDU (absolute difference) nodes

Phoebe Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 23 03:52:56 PST 2023


pengfei added inline comments.


================
Comment at: llvm/test/CodeGen/X86/abds-vector-128.ll:159
   %sub = sub <16 x i64> %aext, %bext
   %abs = call <16 x i64> @llvm.abs.v16i64(<16 x i64> %sub, i1 false)
   %trunc = trunc <16 x i64> %abs to <16 x i8>
----------------
RKSimon wrote:
> pengfei wrote:
> > This seems not correct.
> > The SDM says `When an individual result is too large or too small to be represented in a byte, the result is wrapped around and the low 8 bits are written to the destination element`
> > While LangRef says `If the argument is INT_MIN, then the result is also INT_MIN if is_int_min_poison == 0 and poison otherwise.`
> Aren't we making use of the sext to guarantee that the sub result is in bounds: https://alive2.llvm.org/ce/z/5UECxJ
Oh, yes. My mistake! Sorry for the noise.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142288/new/

https://reviews.llvm.org/D142288



More information about the llvm-commits mailing list