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

[vector] Masked reductions are broken

    Details

      Description

      Reported by Lev Serebryakov:
      http://mail.openjdk.java.net/pipermail/panama-dev/2019-March/004961.html

       This code gives me 100.0f and not expected 10.0f (Preferred Spices in
      256 on my system, as I don't have AVX-512):

      FloatVector.FloatSpecies PFS = FloatVector.preferredSpecies();
      FloatVector.Mask m = FloatVector.maskFromValues(PFS,
        true, false, true, false, true, false, true, false
      );
      FloatVector v = FloatVector.fromArray(PFS, new float[]
         { 1.0f, 10.0f, 2.0f, 20.0f, 3.0f, 30.0f, 4.0f, 40.0f }, 0
      );
      float sum = v.addAll(m);


       Same problem with `mulAll()`.

        Attachments

          Activity

            People

            • Assignee:
              srukmannagar Shravya Rukmannagari
              Reporter:
              vlivanov Vladimir Ivanov
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: