Home | History | Annotate | Download | only in i18n

Lines Matching refs:ce32

96     // CE32 value for U+FFFD as well as illegal UTF-8 byte sequences (which behave like U+FFFD).
102 * A CE32 is special if its low byte is this or greater.
109 * Low byte of a long-primary special CE32.
150 * Special-CE32 tags, from bits 3..0 of a special 32-bit CE.
206 * The builder fetches the Jamo CE32 from the trie.
228 * Bits 31..13: Index into uint32_t table for non-numeric-collation CE32.
273 static UBool isAssignedCE32(uint32_t ce32) {
274 return ce32 != FALLBACK_CE32 && ce32 != UNASSIGNED_CE32;
290 * The default CE32 is used anyway if there is no suffix match.
308 /** Turns the long-primary CE32 into a primary weight pppppp00. */
309 static inline uint32_t primaryFromLongPrimaryCE32(uint32_t ce32) {
310 return ce32 & 0xffffff00;
312 static inline int64_t ceFromLongPrimaryCE32(uint32_t ce32) {
313 return ((int64_t)(ce32 & 0xffffff00) << 32) | COMMON_SEC_AND_TER_CE;
319 static inline int64_t ceFromLongSecondaryCE32(uint32_t ce32) {
320 return ce32 & 0xffffff00;
323 /** Makes a special CE32 with tag, index and length. */
327 /** Makes a special CE32 with only tag and index. */
332 static inline UBool isSpecialCE32(uint32_t ce32) {
333 return (ce32 & 0xff) >= SPECIAL_CE32_LOW_BYTE;
336 static inline int32_t tagFromCE32(uint32_t ce32) {
337 return (int32_t)(ce32 & 0xf);
340 static inline UBool hasCE32Tag(uint32_t ce32, int32_t tag) {
341 return isSpecialCE32(ce32) && tagFromCE32(ce32) == tag;
344 static inline UBool isLongPrimaryCE32(uint32_t ce32) {
345 return hasCE32Tag(ce32, LONG_PRIMARY_TAG);
348 static UBool isSimpleOrLongCE32(uint32_t ce32) {
349 return !isSpecialCE32(ce32) ||
350 tagFromCE32(ce32) == LONG_PRIMARY_TAG ||
351 tagFromCE32(ce32) == LONG_SECONDARY_TAG;
355 * @return TRUE if the ce32 yields one or more CEs without further data lookups
357 static UBool isSelfContainedCE32(uint32_t ce32) {
358 return !isSpecialCE32(ce32) ||
359 tagFromCE32(ce32) == LONG_PRIMARY_TAG ||
360 tagFromCE32(ce32) == LONG_SECONDARY_TAG ||
361 tagFromCE32(ce32) == LATIN_EXPANSION_TAG;
364 static inline UBool isPrefixCE32(uint32_t ce32) {
365 return hasCE32Tag(ce32, PREFIX_TAG);
368 static inline UBool isContractionCE32(uint32_t ce32) {
369 return hasCE32Tag(ce32, CONTRACTION_TAG);
372 static inline UBool ce32HasContext(uint32_t ce32) {
373 return isSpecialCE32(ce32) &&
374 (tagFromCE32(ce32) == PREFIX_TAG ||
375 tagFromCE32(ce32) == CONTRACTION_TAG);
379 * Get the first of the two Latin-expansion CEs encoded in ce32.
382 static inline int64_t latinCE0FromCE32(uint32_t ce32) {
383 return ((int64_t)(ce32 & 0xff000000) << 32) | COMMON_SECONDARY_CE | ((ce32 & 0xff0000) >> 8);
387 * Get the second of the two Latin-expansion CEs encoded in ce32.
390 static inline int64_t latinCE1FromCE32(uint32_t ce32) {
391 return ((ce32 & 0xff00) << 16) | COMMON_TERTIARY_CE;
395 * Returns the data index from a special CE32.
397 static inline int32_t indexFromCE32(uint32_t ce32) {
398 return (int32_t)(ce32 >> 13);
402 * Returns the data length from a ce32.
404 static inline int32_t lengthFromCE32(uint32_t ce32) {
405 return (ce32 >> 8) & 31;
409 * Returns the digit value from a DIGIT_TAG ce32.
411 static inline char digitFromCE32(uint32_t ce32) {
412 return (char)((ce32 >> 8) & 0xf);
415 /** Returns a 64-bit CE from a simple CE32 (not special). */
416 static inline int64_t ceFromSimpleCE32(uint32_t ce32) {
418 // assert (ce32 & 0xff) < SPECIAL_CE32_LOW_BYTE
419 return ((int64_t)(ce32 & 0xffff0000) << 32) | ((ce32 & 0xff00) << 16) | ((ce32 & 0xff) << 8);
422 /** Returns a 64-bit CE from a simple/long-primary/long-secondary CE32. */
423 ce32) {
424 uint32_t tertiary = ce32 & 0xff;
427 return ((int64_t)(ce32 & 0xffff0000) << 32) | ((ce32 & 0xff00) << 16) | (tertiary << 8);
429 ce32 -= tertiary;
432 return ((int64_t)ce32 << 32) | COMMON_SEC_AND_TER_CE;
436 return ce32;