introduce bitloops
This commit is contained in:
@@ -26,7 +26,7 @@ import static java.nio.charset.StandardCharsets.US_ASCII;
|
||||
*/
|
||||
@SuppressWarnings("ALL")
|
||||
public record SwedishGenerator() {
|
||||
public static final int THRESS = 800;
|
||||
|
||||
public static final long X = 0L;
|
||||
public static final int LOG_EVERY_MS = 200;
|
||||
public static final int BAR_LEN = 22;
|
||||
@@ -97,7 +97,7 @@ public record SwedishGenerator() {
|
||||
public static interface Lemma {
|
||||
|
||||
static final long LETTER_MASK = (1L << 40) - 1; // low 40 bits
|
||||
static final long INDEX_MASK = (1L << 24) - 1; // 24 bits
|
||||
static final long INDEX_MASK = (1L << 43) - 1; // 24 bits
|
||||
|
||||
static long from(byte[] word) { return packShiftIn(word) | ((long) (word.length - 1) << 40); }
|
||||
static long pack(long w, int shardIndex) { return w | (((long) shardIndex) << 43) | ((long) length0(w)) << 40; }
|
||||
@@ -117,7 +117,10 @@ public record SwedishGenerator() {
|
||||
static int unpackIndex(long w) { return (int) (w >>> 40); }
|
||||
static int unpackShardIndex(long w) { return (int) (w >>> 43); }
|
||||
static int unpackSize(long w) { return (int) (w >>> 40) & 7; }
|
||||
static int unpackLetters(long w) { return (int) (w & LETTER_MASK); }
|
||||
static int unpackLetters(long w) { return (int) (w & LETTER_MASK); }
|
||||
static long pack43(long w) {
|
||||
return w & INDEX_MASK;
|
||||
}
|
||||
}
|
||||
|
||||
public static record Slotinfo(int key, long lo, long hi, int score, Assign assign, DictEntry entry, int minL) {
|
||||
|
||||
Reference in New Issue
Block a user