Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8305717

SuperWord: Vectorization in opposite direction traversal cases

    XMLWordPrintable

Details

    Description

      Given this loop:

          for (int i = 0; i < DST.length; i++) {
              DST[i] = SRC1[i] + SRC2[DST.length - 1 - i];
          }

      C2 should be able to vectorize this loop by reversing the elements after loading from SRC2. Similarly, a reduction loop like this should also be vectorized:

          int sum = 0;
          for (int i = 0; i < DST.length; i++) {
              sum += SRC1[i] + SRC2[DST.length - 1 - i];
          }

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              qamai Quan Anh Mai
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: