lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r1375495 [2/3] - in /lucene/dev/branches/branch_4x: ./ dev-tools/ lucene/ lucene/analysis/ lucene/benchmark/ lucene/core/ lucene/core/src/java/org/apache/lucene/codecs/ lucene/core/src/java/org/apache/lucene/codecs/block/ lucene/core/src/ja...
Date Tue, 21 Aug 2012 12:14:42 GMT
Modified: lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/util/packed/BulkOperation.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/util/packed/BulkOperation.java?rev=1375495&r1=1375494&r2=1375495&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/util/packed/BulkOperation.java (original)
+++ lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/util/packed/BulkOperation.java Tue Aug 21 12:14:39 2012
@@ -19,7784 +19,31486 @@ package org.apache.lucene.util.packed;
  * limitations under the License.
  */
 
-import java.util.EnumMap;
+import java.nio.LongBuffer;
+import java.nio.ByteBuffer;
 
 /**
  * Efficient sequential read/write of packed integers.
  */
-abstract class BulkOperation {
+enum BulkOperation implements PackedInts.Decoder, PackedInts.Encoder {
+  PACKED_1 {
 
-  static final EnumMap<PackedInts.Format, BulkOperation[]> BULK_OPERATIONS = new EnumMap<PackedInts.Format, BulkOperation[]>(PackedInts.Format.class);
-
-  public static BulkOperation of(PackedInts.Format format, int bitsPerValue) {
-    assert bitsPerValue > 0 && bitsPerValue <= 64;
-    BulkOperation[] ops = BULK_OPERATIONS.get(format);
-    if (ops == null || ops[bitsPerValue] == null) {
-      throw new IllegalArgumentException("format: " + format + ", bitsPerValue: " + bitsPerValue);
-    }
-    return ops[bitsPerValue];
-  }
-
-  /**
-   * For every number of bits per value, there is a minimum number of
-   * blocks (b) / values (v) you need to write in order to reach the next block
-   * boundary:
-   *  - 16 bits per value -> b=1, v=4
-   *  - 24 bits per value -> b=3, v=8
-   *  - 50 bits per value -> b=25, v=32
-   *  - 63 bits per value -> b=63, v = 64
-   *  - ...
-   *
-   * A bulk read consists in copying <code>iterations*v</code> values that are
-   * contained in <code>iterations*b</code> blocks into a <code>long[]</code>
-   * (higher values of <code>iterations</code> are likely to yield a better
-   * throughput) => this requires n * (b + v) longs in memory.
-   *
-   * This method computes <code>iterations</code> as
-   * <code>ramBudget / (8 * (b + v))</code> (since a long is 8 bytes).
-   */
-  public final int computeIterations(int valueCount, int ramBudget) {
-    final int iterations = (ramBudget >>> 3) / (blocks() + values());
-    if (iterations == 0) {
-      // at least 1
+    public int blockCount() {
       return 1;
-    } else if ((iterations - 1) * blocks() >= valueCount) {
-      // don't allocate for more than the size of the reader
-      return (int) Math.ceil((double) valueCount / values());
-    } else {
-      return iterations;
     }
-  }
-
-  /**
-   * The minimum number of blocks required to perform a bulk get/set.
-   */
-  public abstract int blocks();
 
-  /**
-   * The number of values that can be stored in <code>blocks()</code> blocks.
-   */
-  public abstract int values();
-
-  /**
-   * Get <code>n * values()</code> values from <code>n * blocks()</code> blocks.
-   */
-  public abstract void get(long[] blocks, int blockIndex, long[] values, int valuesIndex, int iterations);
-
-  /**
-   * Set <code>n * values()</code> values into <code>n * blocks()</code> blocks.
-   */
-  public abstract void set(long[] blocks, int blockIndex, long[] values, int valuesIndex, int iterations);
-
-  static {
-    BULK_OPERATIONS.put(PackedInts.Format.PACKED, new BulkOperation[65]);    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[1] = new Packed64BulkOperation1();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[2] = new Packed64BulkOperation2();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[3] = new Packed64BulkOperation3();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[4] = new Packed64BulkOperation4();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[5] = new Packed64BulkOperation5();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[6] = new Packed64BulkOperation6();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[7] = new Packed64BulkOperation7();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[8] = new Packed64BulkOperation8();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[9] = new Packed64BulkOperation9();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[10] = new Packed64BulkOperation10();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[11] = new Packed64BulkOperation11();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[12] = new Packed64BulkOperation12();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[13] = new Packed64BulkOperation13();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[14] = new Packed64BulkOperation14();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[15] = new Packed64BulkOperation15();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[16] = new Packed64BulkOperation16();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[17] = new Packed64BulkOperation17();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[18] = new Packed64BulkOperation18();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[19] = new Packed64BulkOperation19();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[20] = new Packed64BulkOperation20();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[21] = new Packed64BulkOperation21();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[22] = new Packed64BulkOperation22();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[23] = new Packed64BulkOperation23();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[24] = new Packed64BulkOperation24();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[25] = new Packed64BulkOperation25();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[26] = new Packed64BulkOperation26();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[27] = new Packed64BulkOperation27();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[28] = new Packed64BulkOperation28();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[29] = new Packed64BulkOperation29();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[30] = new Packed64BulkOperation30();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[31] = new Packed64BulkOperation31();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[32] = new Packed64BulkOperation32();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[33] = new Packed64BulkOperation33();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[34] = new Packed64BulkOperation34();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[35] = new Packed64BulkOperation35();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[36] = new Packed64BulkOperation36();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[37] = new Packed64BulkOperation37();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[38] = new Packed64BulkOperation38();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[39] = new Packed64BulkOperation39();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[40] = new Packed64BulkOperation40();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[41] = new Packed64BulkOperation41();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[42] = new Packed64BulkOperation42();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[43] = new Packed64BulkOperation43();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[44] = new Packed64BulkOperation44();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[45] = new Packed64BulkOperation45();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[46] = new Packed64BulkOperation46();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[47] = new Packed64BulkOperation47();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[48] = new Packed64BulkOperation48();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[49] = new Packed64BulkOperation49();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[50] = new Packed64BulkOperation50();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[51] = new Packed64BulkOperation51();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[52] = new Packed64BulkOperation52();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[53] = new Packed64BulkOperation53();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[54] = new Packed64BulkOperation54();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[55] = new Packed64BulkOperation55();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[56] = new Packed64BulkOperation56();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[57] = new Packed64BulkOperation57();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[58] = new Packed64BulkOperation58();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[59] = new Packed64BulkOperation59();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[60] = new Packed64BulkOperation60();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[61] = new Packed64BulkOperation61();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[62] = new Packed64BulkOperation62();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[63] = new Packed64BulkOperation63();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED)[64] = new Packed64BulkOperation64();
-    BULK_OPERATIONS.put(PackedInts.Format.PACKED_SINGLE_BLOCK, new BulkOperation[65]);
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED_SINGLE_BLOCK)[1] = new Packed64SingleBlockBulkOperation1();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED_SINGLE_BLOCK)[2] = new Packed64SingleBlockBulkOperation2();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED_SINGLE_BLOCK)[3] = new Packed64SingleBlockBulkOperation3();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED_SINGLE_BLOCK)[4] = new Packed64SingleBlockBulkOperation4();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED_SINGLE_BLOCK)[5] = new Packed64SingleBlockBulkOperation5();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED_SINGLE_BLOCK)[6] = new Packed64SingleBlockBulkOperation6();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED_SINGLE_BLOCK)[7] = new Packed64SingleBlockBulkOperation7();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED_SINGLE_BLOCK)[8] = new Packed64SingleBlockBulkOperation8();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED_SINGLE_BLOCK)[9] = new Packed64SingleBlockBulkOperation9();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED_SINGLE_BLOCK)[10] = new Packed64SingleBlockBulkOperation10();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED_SINGLE_BLOCK)[12] = new Packed64SingleBlockBulkOperation12();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED_SINGLE_BLOCK)[16] = new Packed64SingleBlockBulkOperation16();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED_SINGLE_BLOCK)[21] = new Packed64SingleBlockBulkOperation21();
-    BULK_OPERATIONS.get(PackedInts.Format.PACKED_SINGLE_BLOCK)[32] = new Packed64SingleBlockBulkOperation32();
-  }
-  static final class Packed64BulkOperation1 extends BulkOperation {
-
-    public int blocks() {
-      return 1;
-    }
-
-    public int values() {
+    public int valueCount() {
       return 64;
     }
 
-    public void get(long[] blocks, int bi, long[] values, int vi, int iterations) {
-      assert bi + iterations * blocks() <= blocks.length;
-      assert vi + iterations * values() <= values.length;
-      for (int i = 0; i < iterations; ++i) {
-        final long block0 = blocks[bi++];
-        values[vi++] = block0 >>> 63;
-        values[vi++] = (block0 >>> 62) & 1L;
-        values[vi++] = (block0 >>> 61) & 1L;
-        values[vi++] = (block0 >>> 60) & 1L;
-        values[vi++] = (block0 >>> 59) & 1L;
-        values[vi++] = (block0 >>> 58) & 1L;
-        values[vi++] = (block0 >>> 57) & 1L;
-        values[vi++] = (block0 >>> 56) & 1L;
-        values[vi++] = (block0 >>> 55) & 1L;
-        values[vi++] = (block0 >>> 54) & 1L;
-        values[vi++] = (block0 >>> 53) & 1L;
-        values[vi++] = (block0 >>> 52) & 1L;
-        values[vi++] = (block0 >>> 51) & 1L;
-        values[vi++] = (block0 >>> 50) & 1L;
-        values[vi++] = (block0 >>> 49) & 1L;
-        values[vi++] = (block0 >>> 48) & 1L;
-        values[vi++] = (block0 >>> 47) & 1L;
-        values[vi++] = (block0 >>> 46) & 1L;
-        values[vi++] = (block0 >>> 45) & 1L;
-        values[vi++] = (block0 >>> 44) & 1L;
-        values[vi++] = (block0 >>> 43) & 1L;
-        values[vi++] = (block0 >>> 42) & 1L;
-        values[vi++] = (block0 >>> 41) & 1L;
-        values[vi++] = (block0 >>> 40) & 1L;
-        values[vi++] = (block0 >>> 39) & 1L;
-        values[vi++] = (block0 >>> 38) & 1L;
-        values[vi++] = (block0 >>> 37) & 1L;
-        values[vi++] = (block0 >>> 36) & 1L;
-        values[vi++] = (block0 >>> 35) & 1L;
-        values[vi++] = (block0 >>> 34) & 1L;
-        values[vi++] = (block0 >>> 33) & 1L;
-        values[vi++] = (block0 >>> 32) & 1L;
-        values[vi++] = (block0 >>> 31) & 1L;
-        values[vi++] = (block0 >>> 30) & 1L;
-        values[vi++] = (block0 >>> 29) & 1L;
-        values[vi++] = (block0 >>> 28) & 1L;
-        values[vi++] = (block0 >>> 27) & 1L;
-        values[vi++] = (block0 >>> 26) & 1L;
-        values[vi++] = (block0 >>> 25) & 1L;
-        values[vi++] = (block0 >>> 24) & 1L;
-        values[vi++] = (block0 >>> 23) & 1L;
-        values[vi++] = (block0 >>> 22) & 1L;
-        values[vi++] = (block0 >>> 21) & 1L;
-        values[vi++] = (block0 >>> 20) & 1L;
-        values[vi++] = (block0 >>> 19) & 1L;
-        values[vi++] = (block0 >>> 18) & 1L;
-        values[vi++] = (block0 >>> 17) & 1L;
-        values[vi++] = (block0 >>> 16) & 1L;
-        values[vi++] = (block0 >>> 15) & 1L;
-        values[vi++] = (block0 >>> 14) & 1L;
-        values[vi++] = (block0 >>> 13) & 1L;
-        values[vi++] = (block0 >>> 12) & 1L;
-        values[vi++] = (block0 >>> 11) & 1L;
-        values[vi++] = (block0 >>> 10) & 1L;
-        values[vi++] = (block0 >>> 9) & 1L;
-        values[vi++] = (block0 >>> 8) & 1L;
-        values[vi++] = (block0 >>> 7) & 1L;
-        values[vi++] = (block0 >>> 6) & 1L;
-        values[vi++] = (block0 >>> 5) & 1L;
-        values[vi++] = (block0 >>> 4) & 1L;
-        values[vi++] = (block0 >>> 3) & 1L;
-        values[vi++] = (block0 >>> 2) & 1L;
-        values[vi++] = (block0 >>> 1) & 1L;
-        values[vi++] = block0 & 1L;
-      }
-    }
-
-    public void set(long[] blocks, int bi, long[] values, int vi, int iterations) {
-      assert bi + iterations * blocks() <= blocks.length;
-      assert vi + iterations * values() <= values.length;
-      for (int i = 0; i < iterations; ++i) {
-        blocks[bi++] = (values[vi++] << 63) | (values[vi++] << 62) | (values[vi++] << 61) | (values[vi++] << 60) | (values[vi++] << 59) | (values[vi++] << 58) | (values[vi++] << 57) | (values[vi++] << 56) | (values[vi++] << 55) | (values[vi++] << 54) | (values[vi++] << 53) | (values[vi++] << 52) | (values[vi++] << 51) | (values[vi++] << 50) | (values[vi++] << 49) | (values[vi++] << 48) | (values[vi++] << 47) | (values[vi++] << 46) | (values[vi++] << 45) | (values[vi++] << 44) | (values[vi++] << 43) | (values[vi++] << 42) | (values[vi++] << 41) | (values[vi++] << 40) | (values[vi++] << 39) | (values[vi++] << 38) | (values[vi++] << 37) | (values[vi++] << 36) | (values[vi++] << 35) | (values[vi++] << 34) | (values[vi++] << 33) | (values[vi++] << 32) | (values[vi++] << 31) | (values[vi++] << 30) | (values[vi++] << 29) | (values[vi++] << 28) | (values[vi++] << 27) | (values[vi++] << 26) | (values[vi++] << 25) | (values[vi++] << 24) | (values[vi++] << 23) | (values[vi++] << 22) | 
 (values[vi++] << 21) | (values[vi++] << 20) | (values[vi++] << 19) | (values[vi++] << 18) | (values[vi++] << 17) | (values[vi++] << 16) | (values[vi++] << 15) | (values[vi++] << 14) | (values[vi++] << 13) | (values[vi++] << 12) | (values[vi++] << 11) | (values[vi++] << 10) | (values[vi++] << 9) | (values[vi++] << 8) | (values[vi++] << 7) | (values[vi++] << 6) | (values[vi++] << 5) | (values[vi++] << 4) | (values[vi++] << 3) | (values[vi++] << 2) | (values[vi++] << 1) | values[vi++];
+    public void decode(long[] blocks, int blocksOffset, int[] values, int valuesOffset, int iterations) {
+      assert blocksOffset + iterations * blockCount() <= blocks.length;
+      assert valuesOffset + iterations * valueCount() <= values.length;
+      for (int i = 0; i < iterations; ++i) {
+        final long block0 = blocks[blocksOffset++];
+        values[valuesOffset++] = (int) (block0 >>> 63);
+        values[valuesOffset++] = (int) ((block0 >>> 62) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 61) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 60) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 59) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 58) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 57) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 56) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 55) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 54) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 53) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 52) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 51) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 50) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 49) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 48) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 47) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 46) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 45) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 44) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 43) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 42) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 41) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 40) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 39) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 38) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 37) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 36) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 35) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 34) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 33) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 32) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 31) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 30) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 29) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 28) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 27) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 26) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 25) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 24) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 23) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 22) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 21) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 20) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 19) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 18) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 17) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 16) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 15) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 14) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 13) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 12) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 11) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 10) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 9) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 8) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 7) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 6) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 5) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 4) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 3) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 2) & 1L);
+        values[valuesOffset++] = (int) ((block0 >>> 1) & 1L);
+        values[valuesOffset++] = (int) (block0 & 1L);
+      }
+    }
+
+    public void decode(byte[] blocks, int blocksOffset, int[] values, int valuesOffset, int iterations) {
+      assert blocksOffset + 8 * iterations * blockCount() <= blocks.length;
+      assert valuesOffset + iterations * valueCount() <= values.length;
+      for (int i = 0; i < iterations; ++i) {
+        final int byte0 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte0 >>> 7;
+        values[valuesOffset++] = (byte0 >>> 6) & 1;
+        values[valuesOffset++] = (byte0 >>> 5) & 1;
+        values[valuesOffset++] = (byte0 >>> 4) & 1;
+        values[valuesOffset++] = (byte0 >>> 3) & 1;
+        values[valuesOffset++] = (byte0 >>> 2) & 1;
+        values[valuesOffset++] = (byte0 >>> 1) & 1;
+        values[valuesOffset++] = byte0 & 1;
+        final int byte1 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte1 >>> 7;
+        values[valuesOffset++] = (byte1 >>> 6) & 1;
+        values[valuesOffset++] = (byte1 >>> 5) & 1;
+        values[valuesOffset++] = (byte1 >>> 4) & 1;
+        values[valuesOffset++] = (byte1 >>> 3) & 1;
+        values[valuesOffset++] = (byte1 >>> 2) & 1;
+        values[valuesOffset++] = (byte1 >>> 1) & 1;
+        values[valuesOffset++] = byte1 & 1;
+        final int byte2 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte2 >>> 7;
+        values[valuesOffset++] = (byte2 >>> 6) & 1;
+        values[valuesOffset++] = (byte2 >>> 5) & 1;
+        values[valuesOffset++] = (byte2 >>> 4) & 1;
+        values[valuesOffset++] = (byte2 >>> 3) & 1;
+        values[valuesOffset++] = (byte2 >>> 2) & 1;
+        values[valuesOffset++] = (byte2 >>> 1) & 1;
+        values[valuesOffset++] = byte2 & 1;
+        final int byte3 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte3 >>> 7;
+        values[valuesOffset++] = (byte3 >>> 6) & 1;
+        values[valuesOffset++] = (byte3 >>> 5) & 1;
+        values[valuesOffset++] = (byte3 >>> 4) & 1;
+        values[valuesOffset++] = (byte3 >>> 3) & 1;
+        values[valuesOffset++] = (byte3 >>> 2) & 1;
+        values[valuesOffset++] = (byte3 >>> 1) & 1;
+        values[valuesOffset++] = byte3 & 1;
+        final int byte4 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte4 >>> 7;
+        values[valuesOffset++] = (byte4 >>> 6) & 1;
+        values[valuesOffset++] = (byte4 >>> 5) & 1;
+        values[valuesOffset++] = (byte4 >>> 4) & 1;
+        values[valuesOffset++] = (byte4 >>> 3) & 1;
+        values[valuesOffset++] = (byte4 >>> 2) & 1;
+        values[valuesOffset++] = (byte4 >>> 1) & 1;
+        values[valuesOffset++] = byte4 & 1;
+        final int byte5 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte5 >>> 7;
+        values[valuesOffset++] = (byte5 >>> 6) & 1;
+        values[valuesOffset++] = (byte5 >>> 5) & 1;
+        values[valuesOffset++] = (byte5 >>> 4) & 1;
+        values[valuesOffset++] = (byte5 >>> 3) & 1;
+        values[valuesOffset++] = (byte5 >>> 2) & 1;
+        values[valuesOffset++] = (byte5 >>> 1) & 1;
+        values[valuesOffset++] = byte5 & 1;
+        final int byte6 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte6 >>> 7;
+        values[valuesOffset++] = (byte6 >>> 6) & 1;
+        values[valuesOffset++] = (byte6 >>> 5) & 1;
+        values[valuesOffset++] = (byte6 >>> 4) & 1;
+        values[valuesOffset++] = (byte6 >>> 3) & 1;
+        values[valuesOffset++] = (byte6 >>> 2) & 1;
+        values[valuesOffset++] = (byte6 >>> 1) & 1;
+        values[valuesOffset++] = byte6 & 1;
+        final int byte7 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte7 >>> 7;
+        values[valuesOffset++] = (byte7 >>> 6) & 1;
+        values[valuesOffset++] = (byte7 >>> 5) & 1;
+        values[valuesOffset++] = (byte7 >>> 4) & 1;
+        values[valuesOffset++] = (byte7 >>> 3) & 1;
+        values[valuesOffset++] = (byte7 >>> 2) & 1;
+        values[valuesOffset++] = (byte7 >>> 1) & 1;
+        values[valuesOffset++] = byte7 & 1;
+      }
+    }
+
+    public void decode(long[] blocks, int blocksOffset, long[] values, int valuesOffset, int iterations) {
+      assert blocksOffset + iterations * blockCount() <= blocks.length;
+      assert valuesOffset + iterations * valueCount() <= values.length;
+      for (int i = 0; i < iterations; ++i) {
+        final long block0 = blocks[blocksOffset++];
+        values[valuesOffset++] = block0 >>> 63;
+        values[valuesOffset++] = (block0 >>> 62) & 1L;
+        values[valuesOffset++] = (block0 >>> 61) & 1L;
+        values[valuesOffset++] = (block0 >>> 60) & 1L;
+        values[valuesOffset++] = (block0 >>> 59) & 1L;
+        values[valuesOffset++] = (block0 >>> 58) & 1L;
+        values[valuesOffset++] = (block0 >>> 57) & 1L;
+        values[valuesOffset++] = (block0 >>> 56) & 1L;
+        values[valuesOffset++] = (block0 >>> 55) & 1L;
+        values[valuesOffset++] = (block0 >>> 54) & 1L;
+        values[valuesOffset++] = (block0 >>> 53) & 1L;
+        values[valuesOffset++] = (block0 >>> 52) & 1L;
+        values[valuesOffset++] = (block0 >>> 51) & 1L;
+        values[valuesOffset++] = (block0 >>> 50) & 1L;
+        values[valuesOffset++] = (block0 >>> 49) & 1L;
+        values[valuesOffset++] = (block0 >>> 48) & 1L;
+        values[valuesOffset++] = (block0 >>> 47) & 1L;
+        values[valuesOffset++] = (block0 >>> 46) & 1L;
+        values[valuesOffset++] = (block0 >>> 45) & 1L;
+        values[valuesOffset++] = (block0 >>> 44) & 1L;
+        values[valuesOffset++] = (block0 >>> 43) & 1L;
+        values[valuesOffset++] = (block0 >>> 42) & 1L;
+        values[valuesOffset++] = (block0 >>> 41) & 1L;
+        values[valuesOffset++] = (block0 >>> 40) & 1L;
+        values[valuesOffset++] = (block0 >>> 39) & 1L;
+        values[valuesOffset++] = (block0 >>> 38) & 1L;
+        values[valuesOffset++] = (block0 >>> 37) & 1L;
+        values[valuesOffset++] = (block0 >>> 36) & 1L;
+        values[valuesOffset++] = (block0 >>> 35) & 1L;
+        values[valuesOffset++] = (block0 >>> 34) & 1L;
+        values[valuesOffset++] = (block0 >>> 33) & 1L;
+        values[valuesOffset++] = (block0 >>> 32) & 1L;
+        values[valuesOffset++] = (block0 >>> 31) & 1L;
+        values[valuesOffset++] = (block0 >>> 30) & 1L;
+        values[valuesOffset++] = (block0 >>> 29) & 1L;
+        values[valuesOffset++] = (block0 >>> 28) & 1L;
+        values[valuesOffset++] = (block0 >>> 27) & 1L;
+        values[valuesOffset++] = (block0 >>> 26) & 1L;
+        values[valuesOffset++] = (block0 >>> 25) & 1L;
+        values[valuesOffset++] = (block0 >>> 24) & 1L;
+        values[valuesOffset++] = (block0 >>> 23) & 1L;
+        values[valuesOffset++] = (block0 >>> 22) & 1L;
+        values[valuesOffset++] = (block0 >>> 21) & 1L;
+        values[valuesOffset++] = (block0 >>> 20) & 1L;
+        values[valuesOffset++] = (block0 >>> 19) & 1L;
+        values[valuesOffset++] = (block0 >>> 18) & 1L;
+        values[valuesOffset++] = (block0 >>> 17) & 1L;
+        values[valuesOffset++] = (block0 >>> 16) & 1L;
+        values[valuesOffset++] = (block0 >>> 15) & 1L;
+        values[valuesOffset++] = (block0 >>> 14) & 1L;
+        values[valuesOffset++] = (block0 >>> 13) & 1L;
+        values[valuesOffset++] = (block0 >>> 12) & 1L;
+        values[valuesOffset++] = (block0 >>> 11) & 1L;
+        values[valuesOffset++] = (block0 >>> 10) & 1L;
+        values[valuesOffset++] = (block0 >>> 9) & 1L;
+        values[valuesOffset++] = (block0 >>> 8) & 1L;
+        values[valuesOffset++] = (block0 >>> 7) & 1L;
+        values[valuesOffset++] = (block0 >>> 6) & 1L;
+        values[valuesOffset++] = (block0 >>> 5) & 1L;
+        values[valuesOffset++] = (block0 >>> 4) & 1L;
+        values[valuesOffset++] = (block0 >>> 3) & 1L;
+        values[valuesOffset++] = (block0 >>> 2) & 1L;
+        values[valuesOffset++] = (block0 >>> 1) & 1L;
+        values[valuesOffset++] = block0 & 1L;
+      }
+    }
+
+    public void decode(byte[] blocks, int blocksOffset, long[] values, int valuesOffset, int iterations) {
+      assert blocksOffset + 8 * iterations * blockCount() <= blocks.length;
+      assert valuesOffset + iterations * valueCount() <= values.length;
+      for (int i = 0; i < iterations; ++i) {
+        final long byte0 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte0 >>> 7;
+        values[valuesOffset++] = (byte0 >>> 6) & 1;
+        values[valuesOffset++] = (byte0 >>> 5) & 1;
+        values[valuesOffset++] = (byte0 >>> 4) & 1;
+        values[valuesOffset++] = (byte0 >>> 3) & 1;
+        values[valuesOffset++] = (byte0 >>> 2) & 1;
+        values[valuesOffset++] = (byte0 >>> 1) & 1;
+        values[valuesOffset++] = byte0 & 1;
+        final long byte1 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte1 >>> 7;
+        values[valuesOffset++] = (byte1 >>> 6) & 1;
+        values[valuesOffset++] = (byte1 >>> 5) & 1;
+        values[valuesOffset++] = (byte1 >>> 4) & 1;
+        values[valuesOffset++] = (byte1 >>> 3) & 1;
+        values[valuesOffset++] = (byte1 >>> 2) & 1;
+        values[valuesOffset++] = (byte1 >>> 1) & 1;
+        values[valuesOffset++] = byte1 & 1;
+        final long byte2 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte2 >>> 7;
+        values[valuesOffset++] = (byte2 >>> 6) & 1;
+        values[valuesOffset++] = (byte2 >>> 5) & 1;
+        values[valuesOffset++] = (byte2 >>> 4) & 1;
+        values[valuesOffset++] = (byte2 >>> 3) & 1;
+        values[valuesOffset++] = (byte2 >>> 2) & 1;
+        values[valuesOffset++] = (byte2 >>> 1) & 1;
+        values[valuesOffset++] = byte2 & 1;
+        final long byte3 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte3 >>> 7;
+        values[valuesOffset++] = (byte3 >>> 6) & 1;
+        values[valuesOffset++] = (byte3 >>> 5) & 1;
+        values[valuesOffset++] = (byte3 >>> 4) & 1;
+        values[valuesOffset++] = (byte3 >>> 3) & 1;
+        values[valuesOffset++] = (byte3 >>> 2) & 1;
+        values[valuesOffset++] = (byte3 >>> 1) & 1;
+        values[valuesOffset++] = byte3 & 1;
+        final long byte4 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte4 >>> 7;
+        values[valuesOffset++] = (byte4 >>> 6) & 1;
+        values[valuesOffset++] = (byte4 >>> 5) & 1;
+        values[valuesOffset++] = (byte4 >>> 4) & 1;
+        values[valuesOffset++] = (byte4 >>> 3) & 1;
+        values[valuesOffset++] = (byte4 >>> 2) & 1;
+        values[valuesOffset++] = (byte4 >>> 1) & 1;
+        values[valuesOffset++] = byte4 & 1;
+        final long byte5 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte5 >>> 7;
+        values[valuesOffset++] = (byte5 >>> 6) & 1;
+        values[valuesOffset++] = (byte5 >>> 5) & 1;
+        values[valuesOffset++] = (byte5 >>> 4) & 1;
+        values[valuesOffset++] = (byte5 >>> 3) & 1;
+        values[valuesOffset++] = (byte5 >>> 2) & 1;
+        values[valuesOffset++] = (byte5 >>> 1) & 1;
+        values[valuesOffset++] = byte5 & 1;
+        final long byte6 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte6 >>> 7;
+        values[valuesOffset++] = (byte6 >>> 6) & 1;
+        values[valuesOffset++] = (byte6 >>> 5) & 1;
+        values[valuesOffset++] = (byte6 >>> 4) & 1;
+        values[valuesOffset++] = (byte6 >>> 3) & 1;
+        values[valuesOffset++] = (byte6 >>> 2) & 1;
+        values[valuesOffset++] = (byte6 >>> 1) & 1;
+        values[valuesOffset++] = byte6 & 1;
+        final long byte7 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte7 >>> 7;
+        values[valuesOffset++] = (byte7 >>> 6) & 1;
+        values[valuesOffset++] = (byte7 >>> 5) & 1;
+        values[valuesOffset++] = (byte7 >>> 4) & 1;
+        values[valuesOffset++] = (byte7 >>> 3) & 1;
+        values[valuesOffset++] = (byte7 >>> 2) & 1;
+        values[valuesOffset++] = (byte7 >>> 1) & 1;
+        values[valuesOffset++] = byte7 & 1;
+      }
+    }
+
+    public void encode(int[] values, int valuesOffset, long[] blocks, int blocksOffset, int iterations) {
+      assert blocksOffset + iterations * blockCount() <= blocks.length;
+      assert valuesOffset + iterations * valueCount() <= values.length;
+      for (int i = 0; i < iterations; ++i) {
+        blocks[blocksOffset++] = ((values[valuesOffset++] & 0xffffffffL) << 63) | ((values[valuesOffset++] & 0xffffffffL) << 62) | ((values[valuesOffset++] & 0xffffffffL) << 61) | ((values[valuesOffset++] & 0xffffffffL) << 60) | ((values[valuesOffset++] & 0xffffffffL) << 59) | ((values[valuesOffset++] & 0xffffffffL) << 58) | ((values[valuesOffset++] & 0xffffffffL) << 57) | ((values[valuesOffset++] & 0xffffffffL) << 56) | ((values[valuesOffset++] & 0xffffffffL) << 55) | ((values[valuesOffset++] & 0xffffffffL) << 54) | ((values[valuesOffset++] & 0xffffffffL) << 53) | ((values[valuesOffset++] & 0xffffffffL) << 52) | ((values[valuesOffset++] & 0xffffffffL) << 51) | ((values[valuesOffset++] & 0xffffffffL) << 50) | ((values[valuesOffset++] & 0xffffffffL) << 49) | ((values[valuesOffset++] & 0xffffffffL) << 48) | ((values[valuesOffset++] & 0xffffffffL) << 47) | ((values[valuesOffset++] & 0xffffffffL) << 46) | ((values[valuesOffset++] & 0xffffffffL) << 45) | ((values[valuesOffset++] 
 & 0xffffffffL) << 44) | ((values[valuesOffset++] & 0xffffffffL) << 43) | ((values[valuesOffset++] & 0xffffffffL) << 42) | ((values[valuesOffset++] & 0xffffffffL) << 41) | ((values[valuesOffset++] & 0xffffffffL) << 40) | ((values[valuesOffset++] & 0xffffffffL) << 39) | ((values[valuesOffset++] & 0xffffffffL) << 38) | ((values[valuesOffset++] & 0xffffffffL) << 37) | ((values[valuesOffset++] & 0xffffffffL) << 36) | ((values[valuesOffset++] & 0xffffffffL) << 35) | ((values[valuesOffset++] & 0xffffffffL) << 34) | ((values[valuesOffset++] & 0xffffffffL) << 33) | ((values[valuesOffset++] & 0xffffffffL) << 32) | ((values[valuesOffset++] & 0xffffffffL) << 31) | ((values[valuesOffset++] & 0xffffffffL) << 30) | ((values[valuesOffset++] & 0xffffffffL) << 29) | ((values[valuesOffset++] & 0xffffffffL) << 28) | ((values[valuesOffset++] & 0xffffffffL) << 27) | ((values[valuesOffset++] & 0xffffffffL) << 26) | ((values[valuesOffset++] & 0xffffffffL) << 25) | ((values[valuesOffset++] & 0xfffff
 fffL) << 24) | ((values[valuesOffset++] & 0xffffffffL) << 23) | ((values[valuesOffset++] & 0xffffffffL) << 22) | ((values[valuesOffset++] & 0xffffffffL) << 21) | ((values[valuesOffset++] & 0xffffffffL) << 20) | ((values[valuesOffset++] & 0xffffffffL) << 19) | ((values[valuesOffset++] & 0xffffffffL) << 18) | ((values[valuesOffset++] & 0xffffffffL) << 17) | ((values[valuesOffset++] & 0xffffffffL) << 16) | ((values[valuesOffset++] & 0xffffffffL) << 15) | ((values[valuesOffset++] & 0xffffffffL) << 14) | ((values[valuesOffset++] & 0xffffffffL) << 13) | ((values[valuesOffset++] & 0xffffffffL) << 12) | ((values[valuesOffset++] & 0xffffffffL) << 11) | ((values[valuesOffset++] & 0xffffffffL) << 10) | ((values[valuesOffset++] & 0xffffffffL) << 9) | ((values[valuesOffset++] & 0xffffffffL) << 8) | ((values[valuesOffset++] & 0xffffffffL) << 7) | ((values[valuesOffset++] & 0xffffffffL) << 6) | ((values[valuesOffset++] & 0xffffffffL) << 5) | ((values[valuesOffset++] & 0xffffffffL) << 4) | 
 ((values[valuesOffset++] & 0xffffffffL) << 3) | ((values[valuesOffset++] & 0xffffffffL) << 2) | ((values[valuesOffset++] & 0xffffffffL) << 1) | (values[valuesOffset++] & 0xffffffffL);
+      }
+    }
+
+    public void encode(long[] values, int valuesOffset, long[] blocks, int blocksOffset, int iterations) {
+      assert blocksOffset + iterations * blockCount() <= blocks.length;
+      assert valuesOffset + iterations * valueCount() <= values.length;
+      for (int i = 0; i < iterations; ++i) {
+        blocks[blocksOffset++] = (values[valuesOffset++] << 63) | (values[valuesOffset++] << 62) | (values[valuesOffset++] << 61) | (values[valuesOffset++] << 60) | (values[valuesOffset++] << 59) | (values[valuesOffset++] << 58) | (values[valuesOffset++] << 57) | (values[valuesOffset++] << 56) | (values[valuesOffset++] << 55) | (values[valuesOffset++] << 54) | (values[valuesOffset++] << 53) | (values[valuesOffset++] << 52) | (values[valuesOffset++] << 51) | (values[valuesOffset++] << 50) | (values[valuesOffset++] << 49) | (values[valuesOffset++] << 48) | (values[valuesOffset++] << 47) | (values[valuesOffset++] << 46) | (values[valuesOffset++] << 45) | (values[valuesOffset++] << 44) | (values[valuesOffset++] << 43) | (values[valuesOffset++] << 42) | (values[valuesOffset++] << 41) | (values[valuesOffset++] << 40) | (values[valuesOffset++] << 39) | (values[valuesOffset++] << 38) | (values[valuesOffset++] << 37) | (values[valuesOffset++] << 36) | (values[valuesOffset++] << 35) |
  (values[valuesOffset++] << 34) | (values[valuesOffset++] << 33) | (values[valuesOffset++] << 32) | (values[valuesOffset++] << 31) | (values[valuesOffset++] << 30) | (values[valuesOffset++] << 29) | (values[valuesOffset++] << 28) | (values[valuesOffset++] << 27) | (values[valuesOffset++] << 26) | (values[valuesOffset++] << 25) | (values[valuesOffset++] << 24) | (values[valuesOffset++] << 23) | (values[valuesOffset++] << 22) | (values[valuesOffset++] << 21) | (values[valuesOffset++] << 20) | (values[valuesOffset++] << 19) | (values[valuesOffset++] << 18) | (values[valuesOffset++] << 17) | (values[valuesOffset++] << 16) | (values[valuesOffset++] << 15) | (values[valuesOffset++] << 14) | (values[valuesOffset++] << 13) | (values[valuesOffset++] << 12) | (values[valuesOffset++] << 11) | (values[valuesOffset++] << 10) | (values[valuesOffset++] << 9) | (values[valuesOffset++] << 8) | (values[valuesOffset++] << 7) | (values[valuesOffset++] << 6) | (values[valuesOffset++] << 5) | (va
 lues[valuesOffset++] << 4) | (values[valuesOffset++] << 3) | (values[valuesOffset++] << 2) | (values[valuesOffset++] << 1) | values[valuesOffset++];
       }
     }
-  }
 
-  static final class Packed64BulkOperation2 extends BulkOperation {
+  }
+  ,
+  PACKED_2 {
 
-    public int blocks() {
+    public int blockCount() {
       return 1;
     }
 
-    public int values() {
+    public int valueCount() {
       return 32;
     }
 
-    public void get(long[] blocks, int bi, long[] values, int vi, int iterations) {
-      assert bi + iterations * blocks() <= blocks.length;
-      assert vi + iterations * values() <= values.length;
-      for (int i = 0; i < iterations; ++i) {
-        final long block0 = blocks[bi++];
-        values[vi++] = block0 >>> 62;
-        values[vi++] = (block0 >>> 60) & 3L;
-        values[vi++] = (block0 >>> 58) & 3L;
-        values[vi++] = (block0 >>> 56) & 3L;
-        values[vi++] = (block0 >>> 54) & 3L;
-        values[vi++] = (block0 >>> 52) & 3L;
-        values[vi++] = (block0 >>> 50) & 3L;
-        values[vi++] = (block0 >>> 48) & 3L;
-        values[vi++] = (block0 >>> 46) & 3L;
-        values[vi++] = (block0 >>> 44) & 3L;
-        values[vi++] = (block0 >>> 42) & 3L;
-        values[vi++] = (block0 >>> 40) & 3L;
-        values[vi++] = (block0 >>> 38) & 3L;
-        values[vi++] = (block0 >>> 36) & 3L;
-        values[vi++] = (block0 >>> 34) & 3L;
-        values[vi++] = (block0 >>> 32) & 3L;
-        values[vi++] = (block0 >>> 30) & 3L;
-        values[vi++] = (block0 >>> 28) & 3L;
-        values[vi++] = (block0 >>> 26) & 3L;
-        values[vi++] = (block0 >>> 24) & 3L;
-        values[vi++] = (block0 >>> 22) & 3L;
-        values[vi++] = (block0 >>> 20) & 3L;
-        values[vi++] = (block0 >>> 18) & 3L;
-        values[vi++] = (block0 >>> 16) & 3L;
-        values[vi++] = (block0 >>> 14) & 3L;
-        values[vi++] = (block0 >>> 12) & 3L;
-        values[vi++] = (block0 >>> 10) & 3L;
-        values[vi++] = (block0 >>> 8) & 3L;
-        values[vi++] = (block0 >>> 6) & 3L;
-        values[vi++] = (block0 >>> 4) & 3L;
-        values[vi++] = (block0 >>> 2) & 3L;
-        values[vi++] = block0 & 3L;
+    public void decode(long[] blocks, int blocksOffset, int[] values, int valuesOffset, int iterations) {
+      assert blocksOffset + iterations * blockCount() <= blocks.length;
+      assert valuesOffset + iterations * valueCount() <= values.length;
+      for (int i = 0; i < iterations; ++i) {
+        final long block0 = blocks[blocksOffset++];
+        values[valuesOffset++] = (int) (block0 >>> 62);
+        values[valuesOffset++] = (int) ((block0 >>> 60) & 3L);
+        values[valuesOffset++] = (int) ((block0 >>> 58) & 3L);
+        values[valuesOffset++] = (int) ((block0 >>> 56) & 3L);
+        values[valuesOffset++] = (int) ((block0 >>> 54) & 3L);
+        values[valuesOffset++] = (int) ((block0 >>> 52) & 3L);
+        values[valuesOffset++] = (int) ((block0 >>> 50) & 3L);
+        values[valuesOffset++] = (int) ((block0 >>> 48) & 3L);
+        values[valuesOffset++] = (int) ((block0 >>> 46) & 3L);
+        values[valuesOffset++] = (int) ((block0 >>> 44) & 3L);
+        values[valuesOffset++] = (int) ((block0 >>> 42) & 3L);
+        values[valuesOffset++] = (int) ((block0 >>> 40) & 3L);
+        values[valuesOffset++] = (int) ((block0 >>> 38) & 3L);
+        values[valuesOffset++] = (int) ((block0 >>> 36) & 3L);
+        values[valuesOffset++] = (int) ((block0 >>> 34) & 3L);
+        values[valuesOffset++] = (int) ((block0 >>> 32) & 3L);
+        values[valuesOffset++] = (int) ((block0 >>> 30) & 3L);
+        values[valuesOffset++] = (int) ((block0 >>> 28) & 3L);
+        values[valuesOffset++] = (int) ((block0 >>> 26) & 3L);
+        values[valuesOffset++] = (int) ((block0 >>> 24) & 3L);
+        values[valuesOffset++] = (int) ((block0 >>> 22) & 3L);
+        values[valuesOffset++] = (int) ((block0 >>> 20) & 3L);
+        values[valuesOffset++] = (int) ((block0 >>> 18) & 3L);
+        values[valuesOffset++] = (int) ((block0 >>> 16) & 3L);
+        values[valuesOffset++] = (int) ((block0 >>> 14) & 3L);
+        values[valuesOffset++] = (int) ((block0 >>> 12) & 3L);
+        values[valuesOffset++] = (int) ((block0 >>> 10) & 3L);
+        values[valuesOffset++] = (int) ((block0 >>> 8) & 3L);
+        values[valuesOffset++] = (int) ((block0 >>> 6) & 3L);
+        values[valuesOffset++] = (int) ((block0 >>> 4) & 3L);
+        values[valuesOffset++] = (int) ((block0 >>> 2) & 3L);
+        values[valuesOffset++] = (int) (block0 & 3L);
+      }
+    }
+
+    public void decode(byte[] blocks, int blocksOffset, int[] values, int valuesOffset, int iterations) {
+      assert blocksOffset + 8 * iterations * blockCount() <= blocks.length;
+      assert valuesOffset + iterations * valueCount() <= values.length;
+      for (int i = 0; i < iterations; ++i) {
+        final int byte0 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte0 >>> 6;
+        values[valuesOffset++] = (byte0 >>> 4) & 3;
+        values[valuesOffset++] = (byte0 >>> 2) & 3;
+        values[valuesOffset++] = byte0 & 3;
+        final int byte1 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte1 >>> 6;
+        values[valuesOffset++] = (byte1 >>> 4) & 3;
+        values[valuesOffset++] = (byte1 >>> 2) & 3;
+        values[valuesOffset++] = byte1 & 3;
+        final int byte2 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte2 >>> 6;
+        values[valuesOffset++] = (byte2 >>> 4) & 3;
+        values[valuesOffset++] = (byte2 >>> 2) & 3;
+        values[valuesOffset++] = byte2 & 3;
+        final int byte3 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte3 >>> 6;
+        values[valuesOffset++] = (byte3 >>> 4) & 3;
+        values[valuesOffset++] = (byte3 >>> 2) & 3;
+        values[valuesOffset++] = byte3 & 3;
+        final int byte4 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte4 >>> 6;
+        values[valuesOffset++] = (byte4 >>> 4) & 3;
+        values[valuesOffset++] = (byte4 >>> 2) & 3;
+        values[valuesOffset++] = byte4 & 3;
+        final int byte5 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte5 >>> 6;
+        values[valuesOffset++] = (byte5 >>> 4) & 3;
+        values[valuesOffset++] = (byte5 >>> 2) & 3;
+        values[valuesOffset++] = byte5 & 3;
+        final int byte6 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte6 >>> 6;
+        values[valuesOffset++] = (byte6 >>> 4) & 3;
+        values[valuesOffset++] = (byte6 >>> 2) & 3;
+        values[valuesOffset++] = byte6 & 3;
+        final int byte7 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte7 >>> 6;
+        values[valuesOffset++] = (byte7 >>> 4) & 3;
+        values[valuesOffset++] = (byte7 >>> 2) & 3;
+        values[valuesOffset++] = byte7 & 3;
+      }
+    }
+
+    public void decode(long[] blocks, int blocksOffset, long[] values, int valuesOffset, int iterations) {
+      assert blocksOffset + iterations * blockCount() <= blocks.length;
+      assert valuesOffset + iterations * valueCount() <= values.length;
+      for (int i = 0; i < iterations; ++i) {
+        final long block0 = blocks[blocksOffset++];
+        values[valuesOffset++] = block0 >>> 62;
+        values[valuesOffset++] = (block0 >>> 60) & 3L;
+        values[valuesOffset++] = (block0 >>> 58) & 3L;
+        values[valuesOffset++] = (block0 >>> 56) & 3L;
+        values[valuesOffset++] = (block0 >>> 54) & 3L;
+        values[valuesOffset++] = (block0 >>> 52) & 3L;
+        values[valuesOffset++] = (block0 >>> 50) & 3L;
+        values[valuesOffset++] = (block0 >>> 48) & 3L;
+        values[valuesOffset++] = (block0 >>> 46) & 3L;
+        values[valuesOffset++] = (block0 >>> 44) & 3L;
+        values[valuesOffset++] = (block0 >>> 42) & 3L;
+        values[valuesOffset++] = (block0 >>> 40) & 3L;
+        values[valuesOffset++] = (block0 >>> 38) & 3L;
+        values[valuesOffset++] = (block0 >>> 36) & 3L;
+        values[valuesOffset++] = (block0 >>> 34) & 3L;
+        values[valuesOffset++] = (block0 >>> 32) & 3L;
+        values[valuesOffset++] = (block0 >>> 30) & 3L;
+        values[valuesOffset++] = (block0 >>> 28) & 3L;
+        values[valuesOffset++] = (block0 >>> 26) & 3L;
+        values[valuesOffset++] = (block0 >>> 24) & 3L;
+        values[valuesOffset++] = (block0 >>> 22) & 3L;
+        values[valuesOffset++] = (block0 >>> 20) & 3L;
+        values[valuesOffset++] = (block0 >>> 18) & 3L;
+        values[valuesOffset++] = (block0 >>> 16) & 3L;
+        values[valuesOffset++] = (block0 >>> 14) & 3L;
+        values[valuesOffset++] = (block0 >>> 12) & 3L;
+        values[valuesOffset++] = (block0 >>> 10) & 3L;
+        values[valuesOffset++] = (block0 >>> 8) & 3L;
+        values[valuesOffset++] = (block0 >>> 6) & 3L;
+        values[valuesOffset++] = (block0 >>> 4) & 3L;
+        values[valuesOffset++] = (block0 >>> 2) & 3L;
+        values[valuesOffset++] = block0 & 3L;
+      }
+    }
+
+    public void decode(byte[] blocks, int blocksOffset, long[] values, int valuesOffset, int iterations) {
+      assert blocksOffset + 8 * iterations * blockCount() <= blocks.length;
+      assert valuesOffset + iterations * valueCount() <= values.length;
+      for (int i = 0; i < iterations; ++i) {
+        final long byte0 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte0 >>> 6;
+        values[valuesOffset++] = (byte0 >>> 4) & 3;
+        values[valuesOffset++] = (byte0 >>> 2) & 3;
+        values[valuesOffset++] = byte0 & 3;
+        final long byte1 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte1 >>> 6;
+        values[valuesOffset++] = (byte1 >>> 4) & 3;
+        values[valuesOffset++] = (byte1 >>> 2) & 3;
+        values[valuesOffset++] = byte1 & 3;
+        final long byte2 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte2 >>> 6;
+        values[valuesOffset++] = (byte2 >>> 4) & 3;
+        values[valuesOffset++] = (byte2 >>> 2) & 3;
+        values[valuesOffset++] = byte2 & 3;
+        final long byte3 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte3 >>> 6;
+        values[valuesOffset++] = (byte3 >>> 4) & 3;
+        values[valuesOffset++] = (byte3 >>> 2) & 3;
+        values[valuesOffset++] = byte3 & 3;
+        final long byte4 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte4 >>> 6;
+        values[valuesOffset++] = (byte4 >>> 4) & 3;
+        values[valuesOffset++] = (byte4 >>> 2) & 3;
+        values[valuesOffset++] = byte4 & 3;
+        final long byte5 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte5 >>> 6;
+        values[valuesOffset++] = (byte5 >>> 4) & 3;
+        values[valuesOffset++] = (byte5 >>> 2) & 3;
+        values[valuesOffset++] = byte5 & 3;
+        final long byte6 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte6 >>> 6;
+        values[valuesOffset++] = (byte6 >>> 4) & 3;
+        values[valuesOffset++] = (byte6 >>> 2) & 3;
+        values[valuesOffset++] = byte6 & 3;
+        final long byte7 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte7 >>> 6;
+        values[valuesOffset++] = (byte7 >>> 4) & 3;
+        values[valuesOffset++] = (byte7 >>> 2) & 3;
+        values[valuesOffset++] = byte7 & 3;
+      }
+    }
+
+    public void encode(int[] values, int valuesOffset, long[] blocks, int blocksOffset, int iterations) {
+      assert blocksOffset + iterations * blockCount() <= blocks.length;
+      assert valuesOffset + iterations * valueCount() <= values.length;
+      for (int i = 0; i < iterations; ++i) {
+        blocks[blocksOffset++] = ((values[valuesOffset++] & 0xffffffffL) << 62) | ((values[valuesOffset++] & 0xffffffffL) << 60) | ((values[valuesOffset++] & 0xffffffffL) << 58) | ((values[valuesOffset++] & 0xffffffffL) << 56) | ((values[valuesOffset++] & 0xffffffffL) << 54) | ((values[valuesOffset++] & 0xffffffffL) << 52) | ((values[valuesOffset++] & 0xffffffffL) << 50) | ((values[valuesOffset++] & 0xffffffffL) << 48) | ((values[valuesOffset++] & 0xffffffffL) << 46) | ((values[valuesOffset++] & 0xffffffffL) << 44) | ((values[valuesOffset++] & 0xffffffffL) << 42) | ((values[valuesOffset++] & 0xffffffffL) << 40) | ((values[valuesOffset++] & 0xffffffffL) << 38) | ((values[valuesOffset++] & 0xffffffffL) << 36) | ((values[valuesOffset++] & 0xffffffffL) << 34) | ((values[valuesOffset++] & 0xffffffffL) << 32) | ((values[valuesOffset++] & 0xffffffffL) << 30) | ((values[valuesOffset++] & 0xffffffffL) << 28) | ((values[valuesOffset++] & 0xffffffffL) << 26) | ((values[valuesOffset++] 
 & 0xffffffffL) << 24) | ((values[valuesOffset++] & 0xffffffffL) << 22) | ((values[valuesOffset++] & 0xffffffffL) << 20) | ((values[valuesOffset++] & 0xffffffffL) << 18) | ((values[valuesOffset++] & 0xffffffffL) << 16) | ((values[valuesOffset++] & 0xffffffffL) << 14) | ((values[valuesOffset++] & 0xffffffffL) << 12) | ((values[valuesOffset++] & 0xffffffffL) << 10) | ((values[valuesOffset++] & 0xffffffffL) << 8) | ((values[valuesOffset++] & 0xffffffffL) << 6) | ((values[valuesOffset++] & 0xffffffffL) << 4) | ((values[valuesOffset++] & 0xffffffffL) << 2) | (values[valuesOffset++] & 0xffffffffL);
+      }
+    }
+
+    public void encode(long[] values, int valuesOffset, long[] blocks, int blocksOffset, int iterations) {
+      assert blocksOffset + iterations * blockCount() <= blocks.length;
+      assert valuesOffset + iterations * valueCount() <= values.length;
+      for (int i = 0; i < iterations; ++i) {
+        blocks[blocksOffset++] = (values[valuesOffset++] << 62) | (values[valuesOffset++] << 60) | (values[valuesOffset++] << 58) | (values[valuesOffset++] << 56) | (values[valuesOffset++] << 54) | (values[valuesOffset++] << 52) | (values[valuesOffset++] << 50) | (values[valuesOffset++] << 48) | (values[valuesOffset++] << 46) | (values[valuesOffset++] << 44) | (values[valuesOffset++] << 42) | (values[valuesOffset++] << 40) | (values[valuesOffset++] << 38) | (values[valuesOffset++] << 36) | (values[valuesOffset++] << 34) | (values[valuesOffset++] << 32) | (values[valuesOffset++] << 30) | (values[valuesOffset++] << 28) | (values[valuesOffset++] << 26) | (values[valuesOffset++] << 24) | (values[valuesOffset++] << 22) | (values[valuesOffset++] << 20) | (values[valuesOffset++] << 18) | (values[valuesOffset++] << 16) | (values[valuesOffset++] << 14) | (values[valuesOffset++] << 12) | (values[valuesOffset++] << 10) | (values[valuesOffset++] << 8) | (values[valuesOffset++] << 6) | (
 values[valuesOffset++] << 4) | (values[valuesOffset++] << 2) | values[valuesOffset++];
       }
     }
 
-    public void set(long[] blocks, int bi, long[] values, int vi, int iterations) {
-      assert bi + iterations * blocks() <= blocks.length;
-      assert vi + iterations * values() <= values.length;
-      for (int i = 0; i < iterations; ++i) {
-        blocks[bi++] = (values[vi++] << 62) | (values[vi++] << 60) | (values[vi++] << 58) | (values[vi++] << 56) | (values[vi++] << 54) | (values[vi++] << 52) | (values[vi++] << 50) | (values[vi++] << 48) | (values[vi++] << 46) | (values[vi++] << 44) | (values[vi++] << 42) | (values[vi++] << 40) | (values[vi++] << 38) | (values[vi++] << 36) | (values[vi++] << 34) | (values[vi++] << 32) | (values[vi++] << 30) | (values[vi++] << 28) | (values[vi++] << 26) | (values[vi++] << 24) | (values[vi++] << 22) | (values[vi++] << 20) | (values[vi++] << 18) | (values[vi++] << 16) | (values[vi++] << 14) | (values[vi++] << 12) | (values[vi++] << 10) | (values[vi++] << 8) | (values[vi++] << 6) | (values[vi++] << 4) | (values[vi++] << 2) | values[vi++];
-      }
-    }
   }
+  ,
+  PACKED_3 {
 
-  static final class Packed64BulkOperation3 extends BulkOperation {
-
-    public int blocks() {
+    public int blockCount() {
       return 3;
     }
 
-    public int values() {
+    public int valueCount() {
       return 64;
     }
 
-    public void get(long[] blocks, int bi, long[] values, int vi, int iterations) {
-      assert bi + iterations * blocks() <= blocks.length;
-      assert vi + iterations * values() <= values.length;
-      for (int i = 0; i < iterations; ++i) {
-        final long block0 = blocks[bi++];
-        values[vi++] = block0 >>> 61;
-        values[vi++] = (block0 >>> 58) & 7L;
-        values[vi++] = (block0 >>> 55) & 7L;
-        values[vi++] = (block0 >>> 52) & 7L;
-        values[vi++] = (block0 >>> 49) & 7L;
-        values[vi++] = (block0 >>> 46) & 7L;
-        values[vi++] = (block0 >>> 43) & 7L;
-        values[vi++] = (block0 >>> 40) & 7L;
-        values[vi++] = (block0 >>> 37) & 7L;
-        values[vi++] = (block0 >>> 34) & 7L;
-        values[vi++] = (block0 >>> 31) & 7L;
-        values[vi++] = (block0 >>> 28) & 7L;
-        values[vi++] = (block0 >>> 25) & 7L;
-        values[vi++] = (block0 >>> 22) & 7L;
-        values[vi++] = (block0 >>> 19) & 7L;
-        values[vi++] = (block0 >>> 16) & 7L;
-        values[vi++] = (block0 >>> 13) & 7L;
-        values[vi++] = (block0 >>> 10) & 7L;
-        values[vi++] = (block0 >>> 7) & 7L;
-        values[vi++] = (block0 >>> 4) & 7L;
-        values[vi++] = (block0 >>> 1) & 7L;
-        final long block1 = blocks[bi++];
-        values[vi++] = ((block0 & 1L) << 2) | (block1 >>> 62);
-        values[vi++] = (block1 >>> 59) & 7L;
-        values[vi++] = (block1 >>> 56) & 7L;
-        values[vi++] = (block1 >>> 53) & 7L;
-        values[vi++] = (block1 >>> 50) & 7L;
-        values[vi++] = (block1 >>> 47) & 7L;
-        values[vi++] = (block1 >>> 44) & 7L;
-        values[vi++] = (block1 >>> 41) & 7L;
-        values[vi++] = (block1 >>> 38) & 7L;
-        values[vi++] = (block1 >>> 35) & 7L;
-        values[vi++] = (block1 >>> 32) & 7L;
-        values[vi++] = (block1 >>> 29) & 7L;
-        values[vi++] = (block1 >>> 26) & 7L;
-        values[vi++] = (block1 >>> 23) & 7L;
-        values[vi++] = (block1 >>> 20) & 7L;
-        values[vi++] = (block1 >>> 17) & 7L;
-        values[vi++] = (block1 >>> 14) & 7L;
-        values[vi++] = (block1 >>> 11) & 7L;
-        values[vi++] = (block1 >>> 8) & 7L;
-        values[vi++] = (block1 >>> 5) & 7L;
-        values[vi++] = (block1 >>> 2) & 7L;
-        final long block2 = blocks[bi++];
-        values[vi++] = ((block1 & 3L) << 1) | (block2 >>> 63);
-        values[vi++] = (block2 >>> 60) & 7L;
-        values[vi++] = (block2 >>> 57) & 7L;
-        values[vi++] = (block2 >>> 54) & 7L;
-        values[vi++] = (block2 >>> 51) & 7L;
-        values[vi++] = (block2 >>> 48) & 7L;
-        values[vi++] = (block2 >>> 45) & 7L;
-        values[vi++] = (block2 >>> 42) & 7L;
-        values[vi++] = (block2 >>> 39) & 7L;
-        values[vi++] = (block2 >>> 36) & 7L;
-        values[vi++] = (block2 >>> 33) & 7L;
-        values[vi++] = (block2 >>> 30) & 7L;
-        values[vi++] = (block2 >>> 27) & 7L;
-        values[vi++] = (block2 >>> 24) & 7L;
-        values[vi++] = (block2 >>> 21) & 7L;
-        values[vi++] = (block2 >>> 18) & 7L;
-        values[vi++] = (block2 >>> 15) & 7L;
-        values[vi++] = (block2 >>> 12) & 7L;
-        values[vi++] = (block2 >>> 9) & 7L;
-        values[vi++] = (block2 >>> 6) & 7L;
-        values[vi++] = (block2 >>> 3) & 7L;
-        values[vi++] = block2 & 7L;
-      }
-    }
-
-    public void set(long[] blocks, int bi, long[] values, int vi, int iterations) {
-      assert bi + iterations * blocks() <= blocks.length;
-      assert vi + iterations * values() <= values.length;
-      for (int i = 0; i < iterations; ++i) {
-        blocks[bi++] = (values[vi++] << 61) | (values[vi++] << 58) | (values[vi++] << 55) | (values[vi++] << 52) | (values[vi++] << 49) | (values[vi++] << 46) | (values[vi++] << 43) | (values[vi++] << 40) | (values[vi++] << 37) | (values[vi++] << 34) | (values[vi++] << 31) | (values[vi++] << 28) | (values[vi++] << 25) | (values[vi++] << 22) | (values[vi++] << 19) | (values[vi++] << 16) | (values[vi++] << 13) | (values[vi++] << 10) | (values[vi++] << 7) | (values[vi++] << 4) | (values[vi++] << 1) | (values[vi] >>> 2);
-        blocks[bi++] = (values[vi++] << 62) | (values[vi++] << 59) | (values[vi++] << 56) | (values[vi++] << 53) | (values[vi++] << 50) | (values[vi++] << 47) | (values[vi++] << 44) | (values[vi++] << 41) | (values[vi++] << 38) | (values[vi++] << 35) | (values[vi++] << 32) | (values[vi++] << 29) | (values[vi++] << 26) | (values[vi++] << 23) | (values[vi++] << 20) | (values[vi++] << 17) | (values[vi++] << 14) | (values[vi++] << 11) | (values[vi++] << 8) | (values[vi++] << 5) | (values[vi++] << 2) | (values[vi] >>> 1);
-        blocks[bi++] = (values[vi++] << 63) | (values[vi++] << 60) | (values[vi++] << 57) | (values[vi++] << 54) | (values[vi++] << 51) | (values[vi++] << 48) | (values[vi++] << 45) | (values[vi++] << 42) | (values[vi++] << 39) | (values[vi++] << 36) | (values[vi++] << 33) | (values[vi++] << 30) | (values[vi++] << 27) | (values[vi++] << 24) | (values[vi++] << 21) | (values[vi++] << 18) | (values[vi++] << 15) | (values[vi++] << 12) | (values[vi++] << 9) | (values[vi++] << 6) | (values[vi++] << 3) | values[vi++];
+    public void decode(long[] blocks, int blocksOffset, int[] values, int valuesOffset, int iterations) {
+      assert blocksOffset + iterations * blockCount() <= blocks.length;
+      assert valuesOffset + iterations * valueCount() <= values.length;
+      for (int i = 0; i < iterations; ++i) {
+        final long block0 = blocks[blocksOffset++];
+        values[valuesOffset++] = (int) (block0 >>> 61);
+        values[valuesOffset++] = (int) ((block0 >>> 58) & 7L);
+        values[valuesOffset++] = (int) ((block0 >>> 55) & 7L);
+        values[valuesOffset++] = (int) ((block0 >>> 52) & 7L);
+        values[valuesOffset++] = (int) ((block0 >>> 49) & 7L);
+        values[valuesOffset++] = (int) ((block0 >>> 46) & 7L);
+        values[valuesOffset++] = (int) ((block0 >>> 43) & 7L);
+        values[valuesOffset++] = (int) ((block0 >>> 40) & 7L);
+        values[valuesOffset++] = (int) ((block0 >>> 37) & 7L);
+        values[valuesOffset++] = (int) ((block0 >>> 34) & 7L);
+        values[valuesOffset++] = (int) ((block0 >>> 31) & 7L);
+        values[valuesOffset++] = (int) ((block0 >>> 28) & 7L);
+        values[valuesOffset++] = (int) ((block0 >>> 25) & 7L);
+        values[valuesOffset++] = (int) ((block0 >>> 22) & 7L);
+        values[valuesOffset++] = (int) ((block0 >>> 19) & 7L);
+        values[valuesOffset++] = (int) ((block0 >>> 16) & 7L);
+        values[valuesOffset++] = (int) ((block0 >>> 13) & 7L);
+        values[valuesOffset++] = (int) ((block0 >>> 10) & 7L);
+        values[valuesOffset++] = (int) ((block0 >>> 7) & 7L);
+        values[valuesOffset++] = (int) ((block0 >>> 4) & 7L);
+        values[valuesOffset++] = (int) ((block0 >>> 1) & 7L);
+        final long block1 = blocks[blocksOffset++];
+        values[valuesOffset++] = (int) (((block0 & 1L) << 2) | (block1 >>> 62));
+        values[valuesOffset++] = (int) ((block1 >>> 59) & 7L);
+        values[valuesOffset++] = (int) ((block1 >>> 56) & 7L);
+        values[valuesOffset++] = (int) ((block1 >>> 53) & 7L);
+        values[valuesOffset++] = (int) ((block1 >>> 50) & 7L);
+        values[valuesOffset++] = (int) ((block1 >>> 47) & 7L);
+        values[valuesOffset++] = (int) ((block1 >>> 44) & 7L);
+        values[valuesOffset++] = (int) ((block1 >>> 41) & 7L);
+        values[valuesOffset++] = (int) ((block1 >>> 38) & 7L);
+        values[valuesOffset++] = (int) ((block1 >>> 35) & 7L);
+        values[valuesOffset++] = (int) ((block1 >>> 32) & 7L);
+        values[valuesOffset++] = (int) ((block1 >>> 29) & 7L);
+        values[valuesOffset++] = (int) ((block1 >>> 26) & 7L);
+        values[valuesOffset++] = (int) ((block1 >>> 23) & 7L);
+        values[valuesOffset++] = (int) ((block1 >>> 20) & 7L);
+        values[valuesOffset++] = (int) ((block1 >>> 17) & 7L);
+        values[valuesOffset++] = (int) ((block1 >>> 14) & 7L);
+        values[valuesOffset++] = (int) ((block1 >>> 11) & 7L);
+        values[valuesOffset++] = (int) ((block1 >>> 8) & 7L);
+        values[valuesOffset++] = (int) ((block1 >>> 5) & 7L);
+        values[valuesOffset++] = (int) ((block1 >>> 2) & 7L);
+        final long block2 = blocks[blocksOffset++];
+        values[valuesOffset++] = (int) (((block1 & 3L) << 1) | (block2 >>> 63));
+        values[valuesOffset++] = (int) ((block2 >>> 60) & 7L);
+        values[valuesOffset++] = (int) ((block2 >>> 57) & 7L);
+        values[valuesOffset++] = (int) ((block2 >>> 54) & 7L);
+        values[valuesOffset++] = (int) ((block2 >>> 51) & 7L);
+        values[valuesOffset++] = (int) ((block2 >>> 48) & 7L);
+        values[valuesOffset++] = (int) ((block2 >>> 45) & 7L);
+        values[valuesOffset++] = (int) ((block2 >>> 42) & 7L);
+        values[valuesOffset++] = (int) ((block2 >>> 39) & 7L);
+        values[valuesOffset++] = (int) ((block2 >>> 36) & 7L);
+        values[valuesOffset++] = (int) ((block2 >>> 33) & 7L);
+        values[valuesOffset++] = (int) ((block2 >>> 30) & 7L);
+        values[valuesOffset++] = (int) ((block2 >>> 27) & 7L);
+        values[valuesOffset++] = (int) ((block2 >>> 24) & 7L);
+        values[valuesOffset++] = (int) ((block2 >>> 21) & 7L);
+        values[valuesOffset++] = (int) ((block2 >>> 18) & 7L);
+        values[valuesOffset++] = (int) ((block2 >>> 15) & 7L);
+        values[valuesOffset++] = (int) ((block2 >>> 12) & 7L);
+        values[valuesOffset++] = (int) ((block2 >>> 9) & 7L);
+        values[valuesOffset++] = (int) ((block2 >>> 6) & 7L);
+        values[valuesOffset++] = (int) ((block2 >>> 3) & 7L);
+        values[valuesOffset++] = (int) (block2 & 7L);
+      }
+    }
+
+    public void decode(byte[] blocks, int blocksOffset, int[] values, int valuesOffset, int iterations) {
+      assert blocksOffset + 8 * iterations * blockCount() <= blocks.length;
+      assert valuesOffset + iterations * valueCount() <= values.length;
+      for (int i = 0; i < iterations; ++i) {
+        final int byte0 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte0 >>> 5;
+        values[valuesOffset++] = (byte0 >>> 2) & 7;
+        final int byte1 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = ((byte0 & 3) << 1) | (byte1 >>> 7);
+        values[valuesOffset++] = (byte1 >>> 4) & 7;
+        values[valuesOffset++] = (byte1 >>> 1) & 7;
+        final int byte2 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = ((byte1 & 1) << 2) | (byte2 >>> 6);
+        values[valuesOffset++] = (byte2 >>> 3) & 7;
+        values[valuesOffset++] = byte2 & 7;
+        final int byte3 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte3 >>> 5;
+        values[valuesOffset++] = (byte3 >>> 2) & 7;
+        final int byte4 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = ((byte3 & 3) << 1) | (byte4 >>> 7);
+        values[valuesOffset++] = (byte4 >>> 4) & 7;
+        values[valuesOffset++] = (byte4 >>> 1) & 7;
+        final int byte5 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = ((byte4 & 1) << 2) | (byte5 >>> 6);
+        values[valuesOffset++] = (byte5 >>> 3) & 7;
+        values[valuesOffset++] = byte5 & 7;
+        final int byte6 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte6 >>> 5;
+        values[valuesOffset++] = (byte6 >>> 2) & 7;
+        final int byte7 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = ((byte6 & 3) << 1) | (byte7 >>> 7);
+        values[valuesOffset++] = (byte7 >>> 4) & 7;
+        values[valuesOffset++] = (byte7 >>> 1) & 7;
+        final int byte8 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = ((byte7 & 1) << 2) | (byte8 >>> 6);
+        values[valuesOffset++] = (byte8 >>> 3) & 7;
+        values[valuesOffset++] = byte8 & 7;
+        final int byte9 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte9 >>> 5;
+        values[valuesOffset++] = (byte9 >>> 2) & 7;
+        final int byte10 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = ((byte9 & 3) << 1) | (byte10 >>> 7);
+        values[valuesOffset++] = (byte10 >>> 4) & 7;
+        values[valuesOffset++] = (byte10 >>> 1) & 7;
+        final int byte11 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = ((byte10 & 1) << 2) | (byte11 >>> 6);
+        values[valuesOffset++] = (byte11 >>> 3) & 7;
+        values[valuesOffset++] = byte11 & 7;
+        final int byte12 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte12 >>> 5;
+        values[valuesOffset++] = (byte12 >>> 2) & 7;
+        final int byte13 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = ((byte12 & 3) << 1) | (byte13 >>> 7);
+        values[valuesOffset++] = (byte13 >>> 4) & 7;
+        values[valuesOffset++] = (byte13 >>> 1) & 7;
+        final int byte14 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = ((byte13 & 1) << 2) | (byte14 >>> 6);
+        values[valuesOffset++] = (byte14 >>> 3) & 7;
+        values[valuesOffset++] = byte14 & 7;
+        final int byte15 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte15 >>> 5;
+        values[valuesOffset++] = (byte15 >>> 2) & 7;
+        final int byte16 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = ((byte15 & 3) << 1) | (byte16 >>> 7);
+        values[valuesOffset++] = (byte16 >>> 4) & 7;
+        values[valuesOffset++] = (byte16 >>> 1) & 7;
+        final int byte17 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = ((byte16 & 1) << 2) | (byte17 >>> 6);
+        values[valuesOffset++] = (byte17 >>> 3) & 7;
+        values[valuesOffset++] = byte17 & 7;
+        final int byte18 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte18 >>> 5;
+        values[valuesOffset++] = (byte18 >>> 2) & 7;
+        final int byte19 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = ((byte18 & 3) << 1) | (byte19 >>> 7);
+        values[valuesOffset++] = (byte19 >>> 4) & 7;
+        values[valuesOffset++] = (byte19 >>> 1) & 7;
+        final int byte20 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = ((byte19 & 1) << 2) | (byte20 >>> 6);
+        values[valuesOffset++] = (byte20 >>> 3) & 7;
+        values[valuesOffset++] = byte20 & 7;
+        final int byte21 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte21 >>> 5;
+        values[valuesOffset++] = (byte21 >>> 2) & 7;
+        final int byte22 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = ((byte21 & 3) << 1) | (byte22 >>> 7);
+        values[valuesOffset++] = (byte22 >>> 4) & 7;
+        values[valuesOffset++] = (byte22 >>> 1) & 7;
+        final int byte23 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = ((byte22 & 1) << 2) | (byte23 >>> 6);
+        values[valuesOffset++] = (byte23 >>> 3) & 7;
+        values[valuesOffset++] = byte23 & 7;
+      }
+    }
+
+    public void decode(long[] blocks, int blocksOffset, long[] values, int valuesOffset, int iterations) {
+      assert blocksOffset + iterations * blockCount() <= blocks.length;
+      assert valuesOffset + iterations * valueCount() <= values.length;
+      for (int i = 0; i < iterations; ++i) {
+        final long block0 = blocks[blocksOffset++];
+        values[valuesOffset++] = block0 >>> 61;
+        values[valuesOffset++] = (block0 >>> 58) & 7L;
+        values[valuesOffset++] = (block0 >>> 55) & 7L;
+        values[valuesOffset++] = (block0 >>> 52) & 7L;
+        values[valuesOffset++] = (block0 >>> 49) & 7L;
+        values[valuesOffset++] = (block0 >>> 46) & 7L;
+        values[valuesOffset++] = (block0 >>> 43) & 7L;
+        values[valuesOffset++] = (block0 >>> 40) & 7L;
+        values[valuesOffset++] = (block0 >>> 37) & 7L;
+        values[valuesOffset++] = (block0 >>> 34) & 7L;
+        values[valuesOffset++] = (block0 >>> 31) & 7L;
+        values[valuesOffset++] = (block0 >>> 28) & 7L;
+        values[valuesOffset++] = (block0 >>> 25) & 7L;
+        values[valuesOffset++] = (block0 >>> 22) & 7L;
+        values[valuesOffset++] = (block0 >>> 19) & 7L;
+        values[valuesOffset++] = (block0 >>> 16) & 7L;
+        values[valuesOffset++] = (block0 >>> 13) & 7L;
+        values[valuesOffset++] = (block0 >>> 10) & 7L;
+        values[valuesOffset++] = (block0 >>> 7) & 7L;
+        values[valuesOffset++] = (block0 >>> 4) & 7L;
+        values[valuesOffset++] = (block0 >>> 1) & 7L;
+        final long block1 = blocks[blocksOffset++];
+        values[valuesOffset++] = ((block0 & 1L) << 2) | (block1 >>> 62);
+        values[valuesOffset++] = (block1 >>> 59) & 7L;
+        values[valuesOffset++] = (block1 >>> 56) & 7L;
+        values[valuesOffset++] = (block1 >>> 53) & 7L;
+        values[valuesOffset++] = (block1 >>> 50) & 7L;
+        values[valuesOffset++] = (block1 >>> 47) & 7L;
+        values[valuesOffset++] = (block1 >>> 44) & 7L;
+        values[valuesOffset++] = (block1 >>> 41) & 7L;
+        values[valuesOffset++] = (block1 >>> 38) & 7L;
+        values[valuesOffset++] = (block1 >>> 35) & 7L;
+        values[valuesOffset++] = (block1 >>> 32) & 7L;
+        values[valuesOffset++] = (block1 >>> 29) & 7L;
+        values[valuesOffset++] = (block1 >>> 26) & 7L;
+        values[valuesOffset++] = (block1 >>> 23) & 7L;
+        values[valuesOffset++] = (block1 >>> 20) & 7L;
+        values[valuesOffset++] = (block1 >>> 17) & 7L;
+        values[valuesOffset++] = (block1 >>> 14) & 7L;
+        values[valuesOffset++] = (block1 >>> 11) & 7L;
+        values[valuesOffset++] = (block1 >>> 8) & 7L;
+        values[valuesOffset++] = (block1 >>> 5) & 7L;
+        values[valuesOffset++] = (block1 >>> 2) & 7L;
+        final long block2 = blocks[blocksOffset++];
+        values[valuesOffset++] = ((block1 & 3L) << 1) | (block2 >>> 63);
+        values[valuesOffset++] = (block2 >>> 60) & 7L;
+        values[valuesOffset++] = (block2 >>> 57) & 7L;
+        values[valuesOffset++] = (block2 >>> 54) & 7L;
+        values[valuesOffset++] = (block2 >>> 51) & 7L;
+        values[valuesOffset++] = (block2 >>> 48) & 7L;
+        values[valuesOffset++] = (block2 >>> 45) & 7L;
+        values[valuesOffset++] = (block2 >>> 42) & 7L;
+        values[valuesOffset++] = (block2 >>> 39) & 7L;
+        values[valuesOffset++] = (block2 >>> 36) & 7L;
+        values[valuesOffset++] = (block2 >>> 33) & 7L;
+        values[valuesOffset++] = (block2 >>> 30) & 7L;
+        values[valuesOffset++] = (block2 >>> 27) & 7L;
+        values[valuesOffset++] = (block2 >>> 24) & 7L;
+        values[valuesOffset++] = (block2 >>> 21) & 7L;
+        values[valuesOffset++] = (block2 >>> 18) & 7L;
+        values[valuesOffset++] = (block2 >>> 15) & 7L;
+        values[valuesOffset++] = (block2 >>> 12) & 7L;
+        values[valuesOffset++] = (block2 >>> 9) & 7L;
+        values[valuesOffset++] = (block2 >>> 6) & 7L;
+        values[valuesOffset++] = (block2 >>> 3) & 7L;
+        values[valuesOffset++] = block2 & 7L;
+      }
+    }
+
+    public void decode(byte[] blocks, int blocksOffset, long[] values, int valuesOffset, int iterations) {
+      assert blocksOffset + 8 * iterations * blockCount() <= blocks.length;
+      assert valuesOffset + iterations * valueCount() <= values.length;
+      for (int i = 0; i < iterations; ++i) {
+        final long byte0 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte0 >>> 5;
+        values[valuesOffset++] = (byte0 >>> 2) & 7;
+        final long byte1 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = ((byte0 & 3) << 1) | (byte1 >>> 7);
+        values[valuesOffset++] = (byte1 >>> 4) & 7;
+        values[valuesOffset++] = (byte1 >>> 1) & 7;
+        final long byte2 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = ((byte1 & 1) << 2) | (byte2 >>> 6);
+        values[valuesOffset++] = (byte2 >>> 3) & 7;
+        values[valuesOffset++] = byte2 & 7;
+        final long byte3 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte3 >>> 5;
+        values[valuesOffset++] = (byte3 >>> 2) & 7;
+        final long byte4 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = ((byte3 & 3) << 1) | (byte4 >>> 7);
+        values[valuesOffset++] = (byte4 >>> 4) & 7;
+        values[valuesOffset++] = (byte4 >>> 1) & 7;
+        final long byte5 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = ((byte4 & 1) << 2) | (byte5 >>> 6);
+        values[valuesOffset++] = (byte5 >>> 3) & 7;
+        values[valuesOffset++] = byte5 & 7;
+        final long byte6 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte6 >>> 5;
+        values[valuesOffset++] = (byte6 >>> 2) & 7;
+        final long byte7 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = ((byte6 & 3) << 1) | (byte7 >>> 7);
+        values[valuesOffset++] = (byte7 >>> 4) & 7;
+        values[valuesOffset++] = (byte7 >>> 1) & 7;
+        final long byte8 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = ((byte7 & 1) << 2) | (byte8 >>> 6);
+        values[valuesOffset++] = (byte8 >>> 3) & 7;
+        values[valuesOffset++] = byte8 & 7;
+        final long byte9 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte9 >>> 5;
+        values[valuesOffset++] = (byte9 >>> 2) & 7;
+        final long byte10 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = ((byte9 & 3) << 1) | (byte10 >>> 7);
+        values[valuesOffset++] = (byte10 >>> 4) & 7;
+        values[valuesOffset++] = (byte10 >>> 1) & 7;
+        final long byte11 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = ((byte10 & 1) << 2) | (byte11 >>> 6);
+        values[valuesOffset++] = (byte11 >>> 3) & 7;
+        values[valuesOffset++] = byte11 & 7;
+        final long byte12 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte12 >>> 5;
+        values[valuesOffset++] = (byte12 >>> 2) & 7;
+        final long byte13 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = ((byte12 & 3) << 1) | (byte13 >>> 7);
+        values[valuesOffset++] = (byte13 >>> 4) & 7;
+        values[valuesOffset++] = (byte13 >>> 1) & 7;
+        final long byte14 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = ((byte13 & 1) << 2) | (byte14 >>> 6);
+        values[valuesOffset++] = (byte14 >>> 3) & 7;
+        values[valuesOffset++] = byte14 & 7;
+        final long byte15 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte15 >>> 5;
+        values[valuesOffset++] = (byte15 >>> 2) & 7;
+        final long byte16 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = ((byte15 & 3) << 1) | (byte16 >>> 7);
+        values[valuesOffset++] = (byte16 >>> 4) & 7;
+        values[valuesOffset++] = (byte16 >>> 1) & 7;
+        final long byte17 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = ((byte16 & 1) << 2) | (byte17 >>> 6);
+        values[valuesOffset++] = (byte17 >>> 3) & 7;
+        values[valuesOffset++] = byte17 & 7;
+        final long byte18 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte18 >>> 5;
+        values[valuesOffset++] = (byte18 >>> 2) & 7;
+        final long byte19 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = ((byte18 & 3) << 1) | (byte19 >>> 7);
+        values[valuesOffset++] = (byte19 >>> 4) & 7;
+        values[valuesOffset++] = (byte19 >>> 1) & 7;
+        final long byte20 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = ((byte19 & 1) << 2) | (byte20 >>> 6);
+        values[valuesOffset++] = (byte20 >>> 3) & 7;
+        values[valuesOffset++] = byte20 & 7;
+        final long byte21 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte21 >>> 5;
+        values[valuesOffset++] = (byte21 >>> 2) & 7;
+        final long byte22 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = ((byte21 & 3) << 1) | (byte22 >>> 7);
+        values[valuesOffset++] = (byte22 >>> 4) & 7;
+        values[valuesOffset++] = (byte22 >>> 1) & 7;
+        final long byte23 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = ((byte22 & 1) << 2) | (byte23 >>> 6);
+        values[valuesOffset++] = (byte23 >>> 3) & 7;
+        values[valuesOffset++] = byte23 & 7;
+      }
+    }
+
+    public void encode(int[] values, int valuesOffset, long[] blocks, int blocksOffset, int iterations) {
+      assert blocksOffset + iterations * blockCount() <= blocks.length;
+      assert valuesOffset + iterations * valueCount() <= values.length;
+      for (int i = 0; i < iterations; ++i) {
+        blocks[blocksOffset++] = ((values[valuesOffset++] & 0xffffffffL) << 61) | ((values[valuesOffset++] & 0xffffffffL) << 58) | ((values[valuesOffset++] & 0xffffffffL) << 55) | ((values[valuesOffset++] & 0xffffffffL) << 52) | ((values[valuesOffset++] & 0xffffffffL) << 49) | ((values[valuesOffset++] & 0xffffffffL) << 46) | ((values[valuesOffset++] & 0xffffffffL) << 43) | ((values[valuesOffset++] & 0xffffffffL) << 40) | ((values[valuesOffset++] & 0xffffffffL) << 37) | ((values[valuesOffset++] & 0xffffffffL) << 34) | ((values[valuesOffset++] & 0xffffffffL) << 31) | ((values[valuesOffset++] & 0xffffffffL) << 28) | ((values[valuesOffset++] & 0xffffffffL) << 25) | ((values[valuesOffset++] & 0xffffffffL) << 22) | ((values[valuesOffset++] & 0xffffffffL) << 19) | ((values[valuesOffset++] & 0xffffffffL) << 16) | ((values[valuesOffset++] & 0xffffffffL) << 13) | ((values[valuesOffset++] & 0xffffffffL) << 10) | ((values[valuesOffset++] & 0xffffffffL) << 7) | ((values[valuesOffset++] &
  0xffffffffL) << 4) | ((values[valuesOffset++] & 0xffffffffL) << 1) | ((values[valuesOffset] & 0xffffffffL) >>> 2);
+        blocks[blocksOffset++] = ((values[valuesOffset++] & 0xffffffffL) << 62) | ((values[valuesOffset++] & 0xffffffffL) << 59) | ((values[valuesOffset++] & 0xffffffffL) << 56) | ((values[valuesOffset++] & 0xffffffffL) << 53) | ((values[valuesOffset++] & 0xffffffffL) << 50) | ((values[valuesOffset++] & 0xffffffffL) << 47) | ((values[valuesOffset++] & 0xffffffffL) << 44) | ((values[valuesOffset++] & 0xffffffffL) << 41) | ((values[valuesOffset++] & 0xffffffffL) << 38) | ((values[valuesOffset++] & 0xffffffffL) << 35) | ((values[valuesOffset++] & 0xffffffffL) << 32) | ((values[valuesOffset++] & 0xffffffffL) << 29) | ((values[valuesOffset++] & 0xffffffffL) << 26) | ((values[valuesOffset++] & 0xffffffffL) << 23) | ((values[valuesOffset++] & 0xffffffffL) << 20) | ((values[valuesOffset++] & 0xffffffffL) << 17) | ((values[valuesOffset++] & 0xffffffffL) << 14) | ((values[valuesOffset++] & 0xffffffffL) << 11) | ((values[valuesOffset++] & 0xffffffffL) << 8) | ((values[valuesOffset++] &
  0xffffffffL) << 5) | ((values[valuesOffset++] & 0xffffffffL) << 2) | ((values[valuesOffset] & 0xffffffffL) >>> 1);
+        blocks[blocksOffset++] = ((values[valuesOffset++] & 0xffffffffL) << 63) | ((values[valuesOffset++] & 0xffffffffL) << 60) | ((values[valuesOffset++] & 0xffffffffL) << 57) | ((values[valuesOffset++] & 0xffffffffL) << 54) | ((values[valuesOffset++] & 0xffffffffL) << 51) | ((values[valuesOffset++] & 0xffffffffL) << 48) | ((values[valuesOffset++] & 0xffffffffL) << 45) | ((values[valuesOffset++] & 0xffffffffL) << 42) | ((values[valuesOffset++] & 0xffffffffL) << 39) | ((values[valuesOffset++] & 0xffffffffL) << 36) | ((values[valuesOffset++] & 0xffffffffL) << 33) | ((values[valuesOffset++] & 0xffffffffL) << 30) | ((values[valuesOffset++] & 0xffffffffL) << 27) | ((values[valuesOffset++] & 0xffffffffL) << 24) | ((values[valuesOffset++] & 0xffffffffL) << 21) | ((values[valuesOffset++] & 0xffffffffL) << 18) | ((values[valuesOffset++] & 0xffffffffL) << 15) | ((values[valuesOffset++] & 0xffffffffL) << 12) | ((values[valuesOffset++] & 0xffffffffL) << 9) | ((values[valuesOffset++] &
  0xffffffffL) << 6) | ((values[valuesOffset++] & 0xffffffffL) << 3) | (values[valuesOffset++] & 0xffffffffL);
+      }
+    }
+
+    public void encode(long[] values, int valuesOffset, long[] blocks, int blocksOffset, int iterations) {
+      assert blocksOffset + iterations * blockCount() <= blocks.length;
+      assert valuesOffset + iterations * valueCount() <= values.length;
+      for (int i = 0; i < iterations; ++i) {
+        blocks[blocksOffset++] = (values[valuesOffset++] << 61) | (values[valuesOffset++] << 58) | (values[valuesOffset++] << 55) | (values[valuesOffset++] << 52) | (values[valuesOffset++] << 49) | (values[valuesOffset++] << 46) | (values[valuesOffset++] << 43) | (values[valuesOffset++] << 40) | (values[valuesOffset++] << 37) | (values[valuesOffset++] << 34) | (values[valuesOffset++] << 31) | (values[valuesOffset++] << 28) | (values[valuesOffset++] << 25) | (values[valuesOffset++] << 22) | (values[valuesOffset++] << 19) | (values[valuesOffset++] << 16) | (values[valuesOffset++] << 13) | (values[valuesOffset++] << 10) | (values[valuesOffset++] << 7) | (values[valuesOffset++] << 4) | (values[valuesOffset++] << 1) | (values[valuesOffset] >>> 2);
+        blocks[blocksOffset++] = (values[valuesOffset++] << 62) | (values[valuesOffset++] << 59) | (values[valuesOffset++] << 56) | (values[valuesOffset++] << 53) | (values[valuesOffset++] << 50) | (values[valuesOffset++] << 47) | (values[valuesOffset++] << 44) | (values[valuesOffset++] << 41) | (values[valuesOffset++] << 38) | (values[valuesOffset++] << 35) | (values[valuesOffset++] << 32) | (values[valuesOffset++] << 29) | (values[valuesOffset++] << 26) | (values[valuesOffset++] << 23) | (values[valuesOffset++] << 20) | (values[valuesOffset++] << 17) | (values[valuesOffset++] << 14) | (values[valuesOffset++] << 11) | (values[valuesOffset++] << 8) | (values[valuesOffset++] << 5) | (values[valuesOffset++] << 2) | (values[valuesOffset] >>> 1);
+        blocks[blocksOffset++] = (values[valuesOffset++] << 63) | (values[valuesOffset++] << 60) | (values[valuesOffset++] << 57) | (values[valuesOffset++] << 54) | (values[valuesOffset++] << 51) | (values[valuesOffset++] << 48) | (values[valuesOffset++] << 45) | (values[valuesOffset++] << 42) | (values[valuesOffset++] << 39) | (values[valuesOffset++] << 36) | (values[valuesOffset++] << 33) | (values[valuesOffset++] << 30) | (values[valuesOffset++] << 27) | (values[valuesOffset++] << 24) | (values[valuesOffset++] << 21) | (values[valuesOffset++] << 18) | (values[valuesOffset++] << 15) | (values[valuesOffset++] << 12) | (values[valuesOffset++] << 9) | (values[valuesOffset++] << 6) | (values[valuesOffset++] << 3) | values[valuesOffset++];
       }
     }
-  }
 
-  static final class Packed64BulkOperation4 extends BulkOperation {
+  }
+  ,
+  PACKED_4 {
 
-    public int blocks() {
+    public int blockCount() {
       return 1;
     }
 
-    public int values() {
+    public int valueCount() {
       return 16;
     }
 
-    public void get(long[] blocks, int bi, long[] values, int vi, int iterations) {
-      assert bi + iterations * blocks() <= blocks.length;
-      assert vi + iterations * values() <= values.length;
-      for (int i = 0; i < iterations; ++i) {
-        final long block0 = blocks[bi++];
-        values[vi++] = block0 >>> 60;
-        values[vi++] = (block0 >>> 56) & 15L;
-        values[vi++] = (block0 >>> 52) & 15L;
-        values[vi++] = (block0 >>> 48) & 15L;
-        values[vi++] = (block0 >>> 44) & 15L;
-        values[vi++] = (block0 >>> 40) & 15L;
-        values[vi++] = (block0 >>> 36) & 15L;
-        values[vi++] = (block0 >>> 32) & 15L;
-        values[vi++] = (block0 >>> 28) & 15L;
-        values[vi++] = (block0 >>> 24) & 15L;
-        values[vi++] = (block0 >>> 20) & 15L;
-        values[vi++] = (block0 >>> 16) & 15L;
-        values[vi++] = (block0 >>> 12) & 15L;
-        values[vi++] = (block0 >>> 8) & 15L;
-        values[vi++] = (block0 >>> 4) & 15L;
-        values[vi++] = block0 & 15L;
+    public void decode(long[] blocks, int blocksOffset, int[] values, int valuesOffset, int iterations) {
+      assert blocksOffset + iterations * blockCount() <= blocks.length;
+      assert valuesOffset + iterations * valueCount() <= values.length;
+      for (int i = 0; i < iterations; ++i) {
+        final long block0 = blocks[blocksOffset++];
+        values[valuesOffset++] = (int) (block0 >>> 60);
+        values[valuesOffset++] = (int) ((block0 >>> 56) & 15L);
+        values[valuesOffset++] = (int) ((block0 >>> 52) & 15L);
+        values[valuesOffset++] = (int) ((block0 >>> 48) & 15L);
+        values[valuesOffset++] = (int) ((block0 >>> 44) & 15L);
+        values[valuesOffset++] = (int) ((block0 >>> 40) & 15L);
+        values[valuesOffset++] = (int) ((block0 >>> 36) & 15L);
+        values[valuesOffset++] = (int) ((block0 >>> 32) & 15L);
+        values[valuesOffset++] = (int) ((block0 >>> 28) & 15L);
+        values[valuesOffset++] = (int) ((block0 >>> 24) & 15L);
+        values[valuesOffset++] = (int) ((block0 >>> 20) & 15L);
+        values[valuesOffset++] = (int) ((block0 >>> 16) & 15L);
+        values[valuesOffset++] = (int) ((block0 >>> 12) & 15L);
+        values[valuesOffset++] = (int) ((block0 >>> 8) & 15L);
+        values[valuesOffset++] = (int) ((block0 >>> 4) & 15L);
+        values[valuesOffset++] = (int) (block0 & 15L);
+      }
+    }
+
+    public void decode(byte[] blocks, int blocksOffset, int[] values, int valuesOffset, int iterations) {
+      assert blocksOffset + 8 * iterations * blockCount() <= blocks.length;
+      assert valuesOffset + iterations * valueCount() <= values.length;
+      for (int i = 0; i < iterations; ++i) {
+        final int byte0 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte0 >>> 4;
+        values[valuesOffset++] = byte0 & 15;
+        final int byte1 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte1 >>> 4;
+        values[valuesOffset++] = byte1 & 15;
+        final int byte2 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte2 >>> 4;
+        values[valuesOffset++] = byte2 & 15;
+        final int byte3 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte3 >>> 4;
+        values[valuesOffset++] = byte3 & 15;
+        final int byte4 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte4 >>> 4;
+        values[valuesOffset++] = byte4 & 15;
+        final int byte5 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte5 >>> 4;
+        values[valuesOffset++] = byte5 & 15;
+        final int byte6 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte6 >>> 4;
+        values[valuesOffset++] = byte6 & 15;
+        final int byte7 = blocks[blocksOffset++] & 0xFF;
+        values[valuesOffset++] = byte7 >>> 4;
+        values[valuesOffset++] = byte7 & 15;
+      }
+    }
+
+    public void decode(long[] blocks, int blocksOffset, long[] values, int valuesOffset, int iterations) {
+      assert blocksOffset + iterations * blockCount() <= blocks.length;
+      assert valuesOffset + iterations * valueCount() <= values.length;
+      for (int i = 0; i < iterations; ++i) {
+        final long block0 = blocks[blocksOffset++];
+        values[valuesOffset++] = block0 >>> 60;
+        values[valuesOffset++] = (block0 >>> 56) & 15L;
+        values[valuesOffset++] = (block0 >>> 52) & 15L;
+        values[valuesOffset++] = (block0 >>> 48) & 15L;
+        values[valuesOffset++] = (block0 >>> 44) & 15L;
+        values[valuesOffset++] = (block0 >>> 40) & 15L;
+        values[valuesOffset++] = (block0 >>> 36) & 15L;
+        values[valuesOffset++] = (block0 >>> 32) & 15L;

[... 37025 lines stripped ...]


Mime
View raw message