[PATCH] D74608: [ARM] Setting missing isLaneQ attribute on Neon Intrisics definitions

Lucas Prates via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 14 05:55:44 PST 2020


pratlucas created this revision.
Herald added subscribers: cfe-commits, kristof.beyls.
Herald added a project: clang.

Some of the '*_laneq' intrinsics defined in arm_neon.td were missing the
setting of the 'isLaneQ' attribute. This patch sets the attribute on the
re lated definitions, as they will be required to properly perform range
checks on their lane arguments.

[ARM] Keeping sign information on bitcasts for Neon vdot_lane intrinsics

Sign information was being lost on Neon's vdot_lane intrinsics arguments
when bitcasting explicitly to uint32 vector types. This patch introduces
a new cast option to allow casting the operand to the equivalent vector
type of 32-bit integers, keeping the sign information.

[ARM] Creating 'call_mangled' for Neon intrinsics definitions

As multiple versions ofthe same Neon intrinsic can be created through
the same TableGen definition with the same argument types, the existing
'call' operator is not always able to properly perform overload
resolutions.

As these different intrinsic versions are diferentiated later on by the
NeonEmitter through name mangling, this patch introduces a new
'call_mangled' operator to the TableGen definitions, which allows a call
for an otherwise ambiguous intrinsic by matching its mangled name with
the mangled variation of the caller.

[ARM] Enabling range checks on Neon intrinsics' lane arguments

Range checks were not properly performed in the lane arguments of Neon
intrinsics implemented based on splat operations. Calls to those
intrinsics where translated to __builtin__shufflevector calls directly
by the pre-processor through the arm_neon.h macros, missing the chance
for the proper range checks.

This patch enables the range check by introducing an auxiliary splat
instruction in arm_neon.td, delaying the translation to shufflevector
calls to CGBuiltin.cpp in clang after the checks were performed.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D74608

Files:
  clang/include/clang/Basic/arm_neon.td
  clang/include/clang/Basic/arm_neon_incl.td
  clang/lib/CodeGen/CGBuiltin.cpp
  clang/lib/CodeGen/CodeGenFunction.h
  clang/test/CodeGen/aarch64-neon-2velem.c
  clang/test/CodeGen/aarch64-neon-fma.c
  clang/test/CodeGen/aarch64-poly64.c
  clang/test/CodeGen/aarch64-v8.2a-neon-intrinsics.c
  clang/test/CodeGen/arm-v8.2a-neon-intrinsics.c
  clang/test/CodeGen/arm64_vdupq_n_f64.c
  clang/test/CodeGen/arm_neon_intrinsics.c
  clang/utils/TableGen/NeonEmitter.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74608.244637.patch
Type: text/x-patch
Size: 398198 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200214/15f65140/attachment-0001.bin>


More information about the cfe-commits mailing list