[PATCH] D72268: [ARM,MVE] Support -ve offsets in gather-load intrinsics.

Simon Tatham via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 6 07:01:31 PST 2020


simon_tatham created this revision.
simon_tatham added reviewers: dmgreen, miyuki, MarkMurrayARM.
Herald added subscribers: llvm-commits, cfe-commits, kristof.beyls.
Herald added projects: clang, LLVM.

The ACLE intrinsics with `gather_base` or `scatter_base` in the name
are wrappers on the MVE load/store instructions that take a vector of
base addresses and an immediate offset. The immediate offset can be up
to 127 times the alignment unit, and it can be positive or negative.

At the MC layer, we got that right. But in the Sema error checking for
the wrapping intrinsics, the offset was erroneously constrained to be
positive.

To fix this I've adjusted the `imm_mem7bit` class in the Tablegen that
defines the intrinsics. But that causes integer literals like
`0xfffffffffffffe04` to appear in the autogenerated calls to
`SemaBuiltinConstantArgRange`, which provokes a compiler warning
because that's out of the non-overflowing range of an `int64_t`. So
I've also tweaked `MveEmitter` to emit that as `-0x1fc` instead.

Updated the tests of the Sema checks themselves, and also adjusted a
random sample of the CodeGen tests to actually use negative offsets
and prove they get all the way through code generation without causing
a crash.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D72268

Files:
  clang/include/clang/Basic/arm_mve_defs.td
  clang/test/CodeGen/arm-mve-intrinsics/scatter-gather.c
  clang/test/Sema/arm-mve-immediates.c
  clang/utils/TableGen/MveEmitter.cpp
  llvm/test/CodeGen/Thumb2/mve-intrinsics/scatter-gather.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72268.236356.patch
Type: text/x-patch
Size: 24931 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200106/a4482947/attachment.bin>


More information about the llvm-commits mailing list