gsmiller commented on a change in pull request #69:
URL: https://github.com/apache/lucene/pull/69#discussion_r608685445
##########
File path: lucene/core/src/java/org/apache/lucene/codecs/lucene90/ForUtil.java
##########
@@ -513,6 +513,108 @@ void decode(int bitsPerValue, DataInput in, long[] longs)
throws IOException {
}
}
+ /**
+ * Decodes 128 integers into 64 {@code longs} such that each long contains
two values, each
+ * represented with 32 bits. Values [0..63] are encoded in the high-order
bits of {@code longs}
+ * [0..63], and values [64..127] are encoded in the low-order bits of {@code
longs} [0..63]. This
+ * representation may allow subsequent operations to be performed on two
values at a time.
+ */
+ void decodeTo32(int bitsPerValue, DataInput in, long[] longs) throws
IOException {
+ switch (bitsPerValue) {
+ case 1:
+ decode1(in, tmp, longs);
+ expand8To32(longs);
+ break;
+ case 2:
+ decode2(in, tmp, longs);
+ expand8To32(longs);
+ break;
+ case 3:
+ decode3(in, tmp, longs);
+ expand8To32(longs);
+ break;
+ case 4:
+ decode4(in, tmp, longs);
+ expand8To32(longs);
+ break;
+ case 5:
+ decode5(in, tmp, longs);
+ expand8To32(longs);
+ break;
+ case 6:
+ decode6(in, tmp, longs);
+ expand8To32(longs);
+ break;
+ case 7:
+ decode7(in, tmp, longs);
+ expand8To32(longs);
+ break;
+ case 8:
+ decode8(in, tmp, longs);
+ expand8To32(longs);
+ break;
+ case 9:
+ decode9(in, tmp, longs);
+ expand16To32(longs);
+ break;
+ case 10:
+ decode10(in, tmp, longs);
+ expand16To32(longs);
+ break;
+ case 11:
+ decode11(in, tmp, longs);
+ expand16To32(longs);
+ break;
+ case 12:
+ decode12(in, tmp, longs);
+ expand16To32(longs);
+ break;
+ case 13:
+ decode13(in, tmp, longs);
+ expand16To32(longs);
+ break;
+ case 14:
+ decode14(in, tmp, longs);
+ expand16To32(longs);
+ break;
+ case 15:
+ decode15(in, tmp, longs);
+ expand16To32(longs);
+ break;
+ case 16:
+ decode16(in, tmp, longs);
+ expand16To32(longs);
+ break;
+ case 17:
+ decode17(in, tmp, longs);
+ break;
+ case 18:
+ decode18(in, tmp, longs);
+ break;
+ case 19:
+ decode19(in, tmp, longs);
+ break;
+ case 20:
+ decode20(in, tmp, longs);
+ break;
+ case 21:
+ decode21(in, tmp, longs);
+ break;
+ case 22:
+ decode22(in, tmp, longs);
+ break;
+ case 23:
+ decode23(in, tmp, longs);
+ break;
+ case 24:
+ decode24(in, tmp, longs);
+ break;
+ default:
+ decodeSlow(bitsPerValue, in, tmp, longs);
+ break;
+ }
+ }
+
Review comment:
Good call. I updated it to add this method. I also realized some more
functionality in ForUtil could be removed with this change, so I did so and
updated the generator script to reflect this. You'll also see some general
cleanup in the generator script to update the package location and generate
code in our current formatting. I confirmed that the file generated with this
script is an exact match.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]