8308276: Change layout API to work with bytes, not bits

Reviewed-by: psandoz, pminborg
This commit is contained in:
Maurizio Cimadamore 2023-05-22 14:57:00 +00:00
parent 91aeb5de58
commit 5fc9b5787d
93 changed files with 527 additions and 721 deletions

View file

@ -57,7 +57,7 @@ public abstract class ByteVector extends AbstractVector<Byte> {
static final int FORBID_OPCODE_KIND = VO_ONLYFP;
static final ValueLayout.OfByte ELEMENT_LAYOUT = ValueLayout.JAVA_BYTE.withBitAlignment(8);
static final ValueLayout.OfByte ELEMENT_LAYOUT = ValueLayout.JAVA_BYTE.withByteAlignment(1);
@ForceInline
static int opCode(Operator op) {
@ -3302,7 +3302,7 @@ public abstract class ByteVector extends AbstractVector<Byte> {
* byte[] ar = new byte[species.length()];
* for (int n = 0; n < ar.length; n++) {
* if (m.laneIsSet(n)) {
* ar[n] = slice.getAtIndex(ValuaLayout.JAVA_BYTE.withBitAlignment(8), n);
* ar[n] = slice.getAtIndex(ValuaLayout.JAVA_BYTE.withByteAlignment(1), n);
* }
* }
* ByteVector r = ByteVector.fromArray(species, ar, 0);

View file

@ -57,7 +57,7 @@ public abstract class DoubleVector extends AbstractVector<Double> {
static final int FORBID_OPCODE_KIND = VO_NOFP;
static final ValueLayout.OfDouble ELEMENT_LAYOUT = ValueLayout.JAVA_DOUBLE.withBitAlignment(8);
static final ValueLayout.OfDouble ELEMENT_LAYOUT = ValueLayout.JAVA_DOUBLE.withByteAlignment(1);
@ForceInline
static int opCode(Operator op) {
@ -2985,7 +2985,7 @@ public abstract class DoubleVector extends AbstractVector<Double> {
* double[] ar = new double[species.length()];
* for (int n = 0; n < ar.length; n++) {
* if (m.laneIsSet(n)) {
* ar[n] = slice.getAtIndex(ValuaLayout.JAVA_DOUBLE.withBitAlignment(8), n);
* ar[n] = slice.getAtIndex(ValuaLayout.JAVA_DOUBLE.withByteAlignment(1), n);
* }
* }
* DoubleVector r = DoubleVector.fromArray(species, ar, 0);

View file

@ -57,7 +57,7 @@ public abstract class FloatVector extends AbstractVector<Float> {
static final int FORBID_OPCODE_KIND = VO_NOFP;
static final ValueLayout.OfFloat ELEMENT_LAYOUT = ValueLayout.JAVA_FLOAT.withBitAlignment(8);
static final ValueLayout.OfFloat ELEMENT_LAYOUT = ValueLayout.JAVA_FLOAT.withByteAlignment(1);
@ForceInline
static int opCode(Operator op) {
@ -2991,7 +2991,7 @@ public abstract class FloatVector extends AbstractVector<Float> {
* float[] ar = new float[species.length()];
* for (int n = 0; n < ar.length; n++) {
* if (m.laneIsSet(n)) {
* ar[n] = slice.getAtIndex(ValuaLayout.JAVA_FLOAT.withBitAlignment(8), n);
* ar[n] = slice.getAtIndex(ValuaLayout.JAVA_FLOAT.withByteAlignment(1), n);
* }
* }
* FloatVector r = FloatVector.fromArray(species, ar, 0);

View file

@ -57,7 +57,7 @@ public abstract class IntVector extends AbstractVector<Integer> {
static final int FORBID_OPCODE_KIND = VO_ONLYFP;
static final ValueLayout.OfInt ELEMENT_LAYOUT = ValueLayout.JAVA_INT.withBitAlignment(8);
static final ValueLayout.OfInt ELEMENT_LAYOUT = ValueLayout.JAVA_INT.withByteAlignment(1);
@ForceInline
static int opCode(Operator op) {
@ -3147,7 +3147,7 @@ public abstract class IntVector extends AbstractVector<Integer> {
* int[] ar = new int[species.length()];
* for (int n = 0; n < ar.length; n++) {
* if (m.laneIsSet(n)) {
* ar[n] = slice.getAtIndex(ValuaLayout.JAVA_INT.withBitAlignment(8), n);
* ar[n] = slice.getAtIndex(ValuaLayout.JAVA_INT.withByteAlignment(1), n);
* }
* }
* IntVector r = IntVector.fromArray(species, ar, 0);

View file

@ -57,7 +57,7 @@ public abstract class LongVector extends AbstractVector<Long> {
static final int FORBID_OPCODE_KIND = VO_ONLYFP;
static final ValueLayout.OfLong ELEMENT_LAYOUT = ValueLayout.JAVA_LONG.withBitAlignment(8);
static final ValueLayout.OfLong ELEMENT_LAYOUT = ValueLayout.JAVA_LONG.withByteAlignment(1);
@ForceInline
static int opCode(Operator op) {
@ -3026,7 +3026,7 @@ public abstract class LongVector extends AbstractVector<Long> {
* long[] ar = new long[species.length()];
* for (int n = 0; n < ar.length; n++) {
* if (m.laneIsSet(n)) {
* ar[n] = slice.getAtIndex(ValuaLayout.JAVA_LONG.withBitAlignment(8), n);
* ar[n] = slice.getAtIndex(ValuaLayout.JAVA_LONG.withByteAlignment(1), n);
* }
* }
* LongVector r = LongVector.fromArray(species, ar, 0);

View file

@ -57,7 +57,7 @@ public abstract class ShortVector extends AbstractVector<Short> {
static final int FORBID_OPCODE_KIND = VO_ONLYFP;
static final ValueLayout.OfShort ELEMENT_LAYOUT = ValueLayout.JAVA_SHORT.withBitAlignment(8);
static final ValueLayout.OfShort ELEMENT_LAYOUT = ValueLayout.JAVA_SHORT.withByteAlignment(1);
@ForceInline
static int opCode(Operator op) {
@ -3296,7 +3296,7 @@ public abstract class ShortVector extends AbstractVector<Short> {
* short[] ar = new short[species.length()];
* for (int n = 0; n < ar.length; n++) {
* if (m.laneIsSet(n)) {
* ar[n] = slice.getAtIndex(ValuaLayout.JAVA_SHORT.withBitAlignment(8), n);
* ar[n] = slice.getAtIndex(ValuaLayout.JAVA_SHORT.withByteAlignment(1), n);
* }
* }
* ShortVector r = ShortVector.fromArray(species, ar, 0);

View file

@ -61,7 +61,7 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> {
static final int FORBID_OPCODE_KIND = VO_ONLYFP;
#end[FP]
static final ValueLayout.Of$Type$ ELEMENT_LAYOUT = ValueLayout.JAVA_$TYPE$.withBitAlignment(8);
static final ValueLayout.Of$Type$ ELEMENT_LAYOUT = ValueLayout.JAVA_$TYPE$.withByteAlignment(1);
@ForceInline
static int opCode(Operator op) {
@ -4098,7 +4098,7 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> {
* $type$[] ar = new $type$[species.length()];
* for (int n = 0; n < ar.length; n++) {
* if (m.laneIsSet(n)) {
* ar[n] = slice.getAtIndex(ValuaLayout.JAVA_$TYPE$.withBitAlignment(8), n);
* ar[n] = slice.getAtIndex(ValuaLayout.JAVA_$TYPE$.withByteAlignment(1), n);
* }
* }
* $abstractvectortype$ r = $abstractvectortype$.fromArray(species, ar, 0);