[flang-commits] [PATCH] D129316: Shift intrinsics

Tarun Prabhu via Phabricator via flang-commits flang-commits at lists.llvm.org
Thu Jul 7 11:57:20 PDT 2022


tarunprabhu created this revision.
tarunprabhu added reviewers: klausler, vdonaldson, clementval, jeanPerier, awarzynski, kiranchandramohan.
tarunprabhu added a project: Flang.
Herald added subscribers: mehdi_amini, jdoerfert.
Herald added a project: All.
tarunprabhu requested review of this revision.

This patch implements support for lowering the Shift intrinsics in Fortran 2008.

The SHIFTL, SHIFTR and SHIFTA intrinsics take an integer argument I and a SHIFT argument.

If SHIFT < 0, the intrinsics will always return 0
If SHIFT >= BIT_SIZE(I), the intrinsics will always return 0

The DSHIFTL and DSHIFTR intrinsics are implemented using calls to SHIFTL and SHIFTR as described in the standard.


https://reviews.llvm.org/D129316

Files:
  flang/lib/Lower/IntrinsicCall.cpp
  flang/test/Lower/Intrinsics/dshiftl.f90
  flang/test/Lower/Intrinsics/dshiftr.f90
  flang/test/Lower/Intrinsics/shifta.f90
  flang/test/Lower/Intrinsics/shiftl.f90
  flang/test/Lower/Intrinsics/shiftr.f90

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D129316.443012.patch
Type: text/x-patch
Size: 37194 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220707/bda50983/attachment-0001.bin>


More information about the flang-commits mailing list