hg: panama/panama/jdk: Blend needs to select second source when mask is true

razvan.a.lupusoru at intel.com razvan.a.lupusoru at intel.com
Tue Nov 28 23:41:59 UTC 2017


Changeset: dbc85d61983d
Author:    Razvan A Lupusoru <razvan.a.lupusoru at intel.com>
Date:      2017-11-28 11:31 -0800
URL:       http://hg.openjdk.java.net/panama/panama/jdk/rev/dbc85d61983d

Blend needs to select second source when mask is true

The blend operation currently selects from the first operand when mask bits
are set to true. This patch updates it so it selects from second source instead.
Although it can be argued both ways, this change will keep the blend operation
consistent with all others that use mask. Namely, the thought process works as
follows: if mask is true, apply operation. In case of blend, it should be the
same: if mask is true, apply operation. Since the operation to be applied is blend,
it means that when mask is true, the blending should be happening. So therefore,
when mask is true, select from second operand. When mask is false, keep original
result (aka no blend happened).

In addition to correcting semantic intent to be consistent with rest of API using
masks, this change also makes it consistent with x86 blend instruction which uses
similar logic and selects from second source when mask is true.

! src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVector.java
! src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleVector.java
! src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatVector.java
! src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntVector.java
! src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongVector.java
! src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortVector.java
! src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-Vector.java.template



More information about the panama-dev mailing list