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

Eliminate useless sign extension before some subword integer operations

    XMLWordPrintable

Details

    • generic
    • generic

    Description

      public static short[] addShort(short[] a, short[] b) {
              for (int i = 0; i < SIZE; i++) {
                 b[i] = (short) (a[i] + 8);
                 sres[i] = (short) (b[i] + 7);
               }
              return res;
          }

      For the case above, SLP doesn't succeed in vectorization. But it succeeds in vectorizing similar cases of int/long/float/double, like

        public static void addInt(int[] a, int[] b) {
              for (int i = 0; i < LENGTH; i++) {
                 b[i] = (a[i] + 8);
                 ires[i] = (b[i] + 7);
               }
          }

      Attachments

        Issue Links

          Activity

            People

              fgao Fei Gao (Inactive)
              fgao Fei Gao (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: