Bitwise comparison intrinsics
authorTarun Prabhu <tarunprabhu@gmail.com>
Tue, 19 Jul 2022 16:24:29 +0000 (16:24 +0000)
committerAndrzej Warzynski <andrzej.warzynski@arm.com>
Tue, 19 Jul 2022 16:41:04 +0000 (16:41 +0000)
commit7709f12ed08d2d80afa8b3a95b8abe99a112dcd4
tree793f59dd413cc947afd4b5f789676b811bda5784
parent70039be62774ae8fc53bb3b8f1bdbd2b0efb3355
Bitwise comparison intrinsics

This patch implements lowering for the F08 bitwise comparison intrinsics
(BGE, BGT, BLE and BLT).

This does not create any runtime functions since the functionality is
simple enough to carry out in IR.

The existing semantic check has been changed because it unconditionally
converted the arguments to the largest possible integer type. This
resulted in the argument with the smaller bit-size being sign-extended.
However, the standard requires the argument with the smaller bit-size to
be zero-extended.

Reviewed By: klausler, jeanPerier

Differential Revision: https://reviews.llvm.org/D127805
flang/lib/Evaluate/fold-logical.cpp
flang/lib/Lower/IntrinsicCall.cpp
flang/test/Evaluate/fold-bitwise-compare.f90 [new file with mode: 0644]
flang/test/Lower/Intrinsics/bge.f90 [new file with mode: 0644]
flang/test/Lower/Intrinsics/bgt.f90 [new file with mode: 0644]
flang/test/Lower/Intrinsics/ble.f90 [new file with mode: 0644]
flang/test/Lower/Intrinsics/blt.f90 [new file with mode: 0644]