[flang-commits] [PATCH] D129296: Lower mask intrinsics

vdonaldson via Phabricator via flang-commits flang-commits at lists.llvm.org
Fri Jul 8 10:41:31 PDT 2022


vdonaldson added a comment.

For comparison, here is a test program that generates both conformant and nonconformant `ibits` calls for default integer kind, and distinguishes between the two in the output.  If compiled with multiple compilers, you can verify that results for conformant calls agree across compilers.  (If not, there is a bug somewhere in new code or another compiler.)  You can also specifically compare nonconformant results to inform implementation decisions.  Copy and tweak for other argument kinds or other intrinsics.

    integer, parameter :: v(17) = [-1000, -130, -129, -128, -127, -126, -1, 0, 1, 5, 10, 14, 31, 32, 33, 666, 99999999]
    integer, parameter :: x(18) = [-33333333, -1111, -2, -1, 0, 1, 2, 3, 14, 15, 16, 17, 30, 31, 32, 33, 7777, 8888888]
    character ok
  
    do i = lbound(v,1), ubound(v,1)
      do j = lbound(x,1), ubound(x,1)
        print*
        do k = lbound(x,1), ubound(x,1)
          ok = ' '
          ii = v(i)
          jj = x(j)
          kk = x(k)
          if (jj < 0) ok = '!'
          if (kk < 0) ok = '!'
          if (jj + kk > 32) ok = '!'
          print "(A, '   ', 3I12,'     =',I12)", ok, ii, jj, kk, ibits(ii, jj, kk)
        enddo
      enddo
    enddo
  end


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129296/new/

https://reviews.llvm.org/D129296



More information about the flang-commits mailing list