[PATCH] D69374: [AArch64] Select sadd_sat, uadd_sat, usub_sat and ssub_sat.

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 24 04:18:05 PDT 2019


dmgreen created this revision.
dmgreen added reviewers: t.p.northover, SjoerdMeijer, samparker, efriedma.
Herald added subscribers: hiraditya, kristof.beyls.
Herald added a project: LLVM.

This adds some extra patterns to select AArch64 Neon SQADD, UQADD, SQSUB and UQSUB from the existing target independent _sat nodes.

It does not attempt to replace the existing int_aarch64_neon_uqadd intrinsic nodes as they are apparently used for both scalar and vector, and need to be legal on scalar types for some of the patterns to work. The int_aarch64_neon_uqadd on scalar would move the two integers into floating point registers, perform a Neon uqadd and move the value back. I don't believe this is good idea for uadd_sat to do the same as the scalar alternative is simpler (an adds with a csinv). For signed it may be smaller, but I'm not sure about it being better.

So this just adds some extra patterns for the existing vector instructions, matching on the _sat nodes.


https://reviews.llvm.org/D69374

Files:
  llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
  llvm/lib/Target/AArch64/AArch64InstrFormats.td
  llvm/lib/Target/AArch64/AArch64InstrInfo.td
  llvm/test/CodeGen/AArch64/sadd_sat.ll
  llvm/test/CodeGen/AArch64/sadd_sat_vec.ll
  llvm/test/CodeGen/AArch64/ssub_sat.ll
  llvm/test/CodeGen/AArch64/ssub_sat_vec.ll
  llvm/test/CodeGen/AArch64/uadd_sat_vec.ll
  llvm/test/CodeGen/AArch64/usub_sat_vec.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69374.226221.patch
Type: text/x-patch
Size: 69174 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191024/0e2083f7/attachment.bin>


More information about the llvm-commits mailing list