Home | History | Annotate | Download | only in i18n

Lines Matching full:ce32

100     // CE32 value for U+FFFD as well as illegal UTF-8 byte sequences (which behave like U+FFFD).
106 * A CE32 is special if its low byte is this or greater.
113 * Low byte of a long-primary special CE32.
154 * Special-CE32 tags, from bits 3..0 of a special 32-bit CE.
210 * The builder fetches the Jamo CE32 from the trie.
232 * Bits 31..13: Index into uint32_t table for non-numeric-collation CE32.
277 static UBool isAssignedCE32(uint32_t ce32) {
278 return ce32 != FALLBACK_CE32 && ce32 != UNASSIGNED_CE32;
294 * The default CE32 is used anyway if there is no suffix match.
312 /** Turns the long-primary CE32 into a primary weight pppppp00. */
313 static inline uint32_t primaryFromLongPrimaryCE32(uint32_t ce32) {
314 return ce32 & 0xffffff00;
316 static inline int64_t ceFromLongPrimaryCE32(uint32_t ce32) {
317 return ((int64_t)(ce32 & 0xffffff00) << 32) | COMMON_SEC_AND_TER_CE;
323 static inline int64_t ceFromLongSecondaryCE32(uint32_t ce32) {
324 return ce32 & 0xffffff00;
327 /** Makes a special CE32 with tag, index and length. */
331 /** Makes a special CE32 with only tag and index. */
336 static inline UBool isSpecialCE32(uint32_t ce32) {
337 return (ce32 & 0xff) >= SPECIAL_CE32_LOW_BYTE;
340 static inline int32_t tagFromCE32(uint32_t ce32) {
341 return (int32_t)(ce32 & 0xf);
344 static inline UBool hasCE32Tag(uint32_t ce32, int32_t tag) {
345 return isSpecialCE32(ce32) && tagFromCE32(ce32) == tag;
348 static inline UBool isLongPrimaryCE32(uint32_t ce32) {
349 return hasCE32Tag(ce32, LONG_PRIMARY_TAG);
352 static UBool isSimpleOrLongCE32(uint32_t ce32) {
353 return !isSpecialCE32(ce32) ||
354 tagFromCE32(ce32) == LONG_PRIMARY_TAG ||
355 tagFromCE32(ce32) == LONG_SECONDARY_TAG;
359 * @return TRUE if the ce32 yields one or more CEs without further data lookups
361 static UBool isSelfContainedCE32(uint32_t ce32) {
362 return !isSpecialCE32(ce32) ||
363 tagFromCE32(ce32) == LONG_PRIMARY_TAG ||
364 tagFromCE32(ce32) == LONG_SECONDARY_TAG ||
365 tagFromCE32(ce32) == LATIN_EXPANSION_TAG;
368 static inline UBool isPrefixCE32(uint32_t ce32) {
369 return hasCE32Tag(ce32, PREFIX_TAG);
372 static inline UBool isContractionCE32(uint32_t ce32) {
373 return hasCE32Tag(ce32, CONTRACTION_TAG);
376 static inline UBool ce32HasContext(uint32_t ce32) {
377 return isSpecialCE32(ce32) &&
378 (tagFromCE32(ce32) == PREFIX_TAG ||
379 tagFromCE32(ce32) == CONTRACTION_TAG);
383 * Get the first of the two Latin-expansion CEs encoded in ce32.
386 static inline int64_t latinCE0FromCE32(uint32_t ce32) {
387 return ((int64_t)(ce32 & 0xff000000) << 32) | COMMON_SECONDARY_CE | ((ce32 & 0xff0000) >> 8);
391 * Get the second of the two Latin-expansion CEs encoded in ce32.
394 static inline int64_t latinCE1FromCE32(uint32_t ce32) {
395 return ((ce32 & 0xff00) << 16) | COMMON_TERTIARY_CE;
399 * Returns the data index from a special CE32.
401 static inline int32_t indexFromCE32(uint32_t ce32) {
402 return (int32_t)(ce32 >> 13);
406 * Returns the data length from a ce32.
408 static inline int32_t lengthFromCE32(uint32_t ce32) {
409 return (ce32 >> 8) & 31;
413 * Returns the digit value from a DIGIT_TAG ce32.
415 static inline char digitFromCE32(uint32_t ce32) {
416 return (char)((ce32 >> 8) & 0xf);
419 /** Returns a 64-bit CE from a simple CE32 (not special). */
420 static inline int64_t ceFromSimpleCE32(uint32_t ce32) {
422 // assert (ce32 & 0xff) < SPECIAL_CE32_LOW_BYTE
423 return ((int64_t)(ce32 & 0xffff0000) << 32) | ((ce32ce32 & 0xff) << 8);
426 /** Returns a 64-bit CE from a simple/long-primary/long-secondary CE32. */
427 static inline int64_t ceFromCE32(uint32_t ce32) {
428 uint32_t tertiary = ce32 & 0xff;
431 return ((int64_t)(ce32 & 0xffff0000) << 32) | ((ce32 & 0xff00) << 16) | (tertiary << 8);
433 ce32 -= tertiary;
436 return ((int64_t)ce32 << 32) | COMMON_SEC_AND_TER_CE;
440 return ce32;