40
41 // -- This file was mechanically generated: Do not edit! -- //
42
43 @SuppressWarnings("cast") // warning: redundant cast
44 final class Byte64Vector extends ByteVector {
45 static final ByteSpecies VSPECIES =
46 (ByteSpecies) ByteVector.SPECIES_64;
47
48 static final VectorShape VSHAPE =
49 VSPECIES.vectorShape();
50
51 static final Class<Byte64Vector> VCLASS = Byte64Vector.class;
52
53 static final int VSIZE = VSPECIES.vectorBitSize();
54
55 static final int VLENGTH = VSPECIES.laneCount();
56
57 static final Class<Byte> ETYPE = byte.class;
58
59 // The JVM expects to find the state here.
60 private final byte[] vec; // Don't access directly, use getElements() instead.
61
62 Byte64Vector(byte[] v) {
63 vec = v;
64 }
65
66 // For compatibility as Byte64Vector::new,
67 // stored into species.vectorFactory.
68 Byte64Vector(Object v) {
69 this((byte[]) v);
70 }
71
72 static final Byte64Vector ZERO = new Byte64Vector(new byte[VLENGTH]);
73 static final Byte64Vector IOTA = new Byte64Vector(VSPECIES.iotaArray());
74
75 static {
76 // Warm up a few species caches.
77 // If we do this too much we will
78 // get NPEs from bootstrap circularity.
79 VSPECIES.dummyVector();
80 VSPECIES.withLanes(LaneType.BYTE);
101
102 @ForceInline
103 @Override
104 public final VectorShape shape() { return VSHAPE; }
105
106 @ForceInline
107 @Override
108 public final int length() { return VLENGTH; }
109
110 @ForceInline
111 @Override
112 public final int bitSize() { return VSIZE; }
113
114 @ForceInline
115 @Override
116 public final int byteSize() { return VSIZE / Byte.SIZE; }
117
118 /*package-private*/
119 @ForceInline
120 final @Override
121 byte[] getElements() {
122 return VectorIntrinsics.maybeRebox(this).vec;
123 }
124
125 // Virtualized constructors
126
127 @Override
128 @ForceInline
129 public final Byte64Vector broadcast(byte e) {
130 return (Byte64Vector) super.broadcastTemplate(e); // specialize
131 }
132
133 @Override
134 @ForceInline
135 public final Byte64Vector broadcast(long e) {
136 return (Byte64Vector) super.broadcastTemplate(e); // specialize
137 }
138
139 @Override
140 @ForceInline
141 Byte64Mask maskFromArray(boolean[] bits) {
460
461 @Override
462 @ForceInline
463 public Byte64Vector selectFrom(Vector<Byte> v,
464 VectorMask<Byte> m) {
465 return (Byte64Vector)
466 super.selectFromTemplate((Byte64Vector) v,
467 (Byte64Mask) m); // specialize
468 }
469
470
471 @Override
472 public byte lane(int i) {
473 if (i < 0 || i >= VLENGTH) {
474 throw new IllegalArgumentException("Index " + i + " must be zero or positive, and less than " + VLENGTH);
475 }
476 return (byte) VectorIntrinsics.extract(
477 VCLASS, ETYPE, VLENGTH,
478 this, i,
479 (vec, ix) -> {
480 byte[] vecarr = vec.getElements();
481 return (long)vecarr[ix];
482 });
483 }
484
485 @Override
486 public Byte64Vector withLane(int i, byte e) {
487 if (i < 0 || i >= VLENGTH) {
488 throw new IllegalArgumentException("Index " + i + " must be zero or positive, and less than " + VLENGTH);
489 }
490 return VectorIntrinsics.insert(
491 VCLASS, ETYPE, VLENGTH,
492 this, i, (long)e,
493 (v, ix, bits) -> {
494 byte[] res = v.getElements().clone();
495 res[ix] = (byte)bits;
496 return v.vectorFactory(res);
497 });
498 }
499
500 // Mask
501
502 static final class Byte64Mask extends AbstractMask<Byte> {
503
504 private final boolean[] bits; // Don't access directly, use getBits() instead.
505
506 public Byte64Mask(boolean[] bits) {
507 this(bits, 0);
508 }
509
510 public Byte64Mask(boolean[] bits, int offset) {
511 boolean[] a = new boolean[vspecies().laneCount()];
512 for (int i = 0; i < a.length; i++) {
513 a[i] = bits[offset + i];
514 }
|
40
41 // -- This file was mechanically generated: Do not edit! -- //
42
43 @SuppressWarnings("cast") // warning: redundant cast
44 final class Byte64Vector extends ByteVector {
45 static final ByteSpecies VSPECIES =
46 (ByteSpecies) ByteVector.SPECIES_64;
47
48 static final VectorShape VSHAPE =
49 VSPECIES.vectorShape();
50
51 static final Class<Byte64Vector> VCLASS = Byte64Vector.class;
52
53 static final int VSIZE = VSPECIES.vectorBitSize();
54
55 static final int VLENGTH = VSPECIES.laneCount();
56
57 static final Class<Byte> ETYPE = byte.class;
58
59 // The JVM expects to find the state here.
60 private final byte[] vec; // Don't access directly, use vec() instead.
61
62 Byte64Vector(byte[] v) {
63 vec = v;
64 }
65
66 // For compatibility as Byte64Vector::new,
67 // stored into species.vectorFactory.
68 Byte64Vector(Object v) {
69 this((byte[]) v);
70 }
71
72 static final Byte64Vector ZERO = new Byte64Vector(new byte[VLENGTH]);
73 static final Byte64Vector IOTA = new Byte64Vector(VSPECIES.iotaArray());
74
75 static {
76 // Warm up a few species caches.
77 // If we do this too much we will
78 // get NPEs from bootstrap circularity.
79 VSPECIES.dummyVector();
80 VSPECIES.withLanes(LaneType.BYTE);
101
102 @ForceInline
103 @Override
104 public final VectorShape shape() { return VSHAPE; }
105
106 @ForceInline
107 @Override
108 public final int length() { return VLENGTH; }
109
110 @ForceInline
111 @Override
112 public final int bitSize() { return VSIZE; }
113
114 @ForceInline
115 @Override
116 public final int byteSize() { return VSIZE / Byte.SIZE; }
117
118 /*package-private*/
119 @ForceInline
120 final @Override
121 byte[] vec() {
122 return VectorIntrinsics.maybeRebox(this).vec;
123 }
124
125 // Virtualized constructors
126
127 @Override
128 @ForceInline
129 public final Byte64Vector broadcast(byte e) {
130 return (Byte64Vector) super.broadcastTemplate(e); // specialize
131 }
132
133 @Override
134 @ForceInline
135 public final Byte64Vector broadcast(long e) {
136 return (Byte64Vector) super.broadcastTemplate(e); // specialize
137 }
138
139 @Override
140 @ForceInline
141 Byte64Mask maskFromArray(boolean[] bits) {
460
461 @Override
462 @ForceInline
463 public Byte64Vector selectFrom(Vector<Byte> v,
464 VectorMask<Byte> m) {
465 return (Byte64Vector)
466 super.selectFromTemplate((Byte64Vector) v,
467 (Byte64Mask) m); // specialize
468 }
469
470
471 @Override
472 public byte lane(int i) {
473 if (i < 0 || i >= VLENGTH) {
474 throw new IllegalArgumentException("Index " + i + " must be zero or positive, and less than " + VLENGTH);
475 }
476 return (byte) VectorIntrinsics.extract(
477 VCLASS, ETYPE, VLENGTH,
478 this, i,
479 (vec, ix) -> {
480 byte[] vecarr = vec.vec();
481 return (long)vecarr[ix];
482 });
483 }
484
485 @Override
486 public Byte64Vector withLane(int i, byte e) {
487 if (i < 0 || i >= VLENGTH) {
488 throw new IllegalArgumentException("Index " + i + " must be zero or positive, and less than " + VLENGTH);
489 }
490 return VectorIntrinsics.insert(
491 VCLASS, ETYPE, VLENGTH,
492 this, i, (long)e,
493 (v, ix, bits) -> {
494 byte[] res = v.vec().clone();
495 res[ix] = (byte)bits;
496 return v.vectorFactory(res);
497 });
498 }
499
500 // Mask
501
502 static final class Byte64Mask extends AbstractMask<Byte> {
503
504 private final boolean[] bits; // Don't access directly, use getBits() instead.
505
506 public Byte64Mask(boolean[] bits) {
507 this(bits, 0);
508 }
509
510 public Byte64Mask(boolean[] bits, int offset) {
511 boolean[] a = new boolean[vspecies().laneCount()];
512 for (int i = 0; i < a.length; i++) {
513 a[i] = bits[offset + i];
514 }
|